Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1435767rwi; Wed, 26 Oct 2022 15:34:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5A5WR5PYezFZ56Mf8qCRi4zGK7U6iZxrhelR9jYAIkOMZFBKwZUPIeT6jBGYKOQuv9WXkB X-Received: by 2002:a17:906:4bd3:b0:731:3bdf:b95c with SMTP id x19-20020a1709064bd300b007313bdfb95cmr39976017ejv.677.1666823681429; Wed, 26 Oct 2022 15:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666823681; cv=none; d=google.com; s=arc-20160816; b=C9o0XJ2Nk3F7sQBCZuC+WBAj261gpFl6Wl07eKlGCqfx2Rfp8LnZTpXdy4TWBZNLrH MSqy2gOj2U2lYpwq6to5b2608IRQQj5ob1i8NmNJX5KaoNeCQFLYPc0HpACVMzalWwpk 7TktCIB8mPpXtpnaSS0ZFI1ecRqvO/Aw77IsRzVqxDd9RTp66rB6oB62njGddvNKIAln FgZ3nVI3i9xIGFWtGBx6RE6r3J8r+npav+7cJ7sIUMsQ6rBd09v5Dlgt0vqEMrDDKz7f c2YYA8D0u/fenZCg+arLJixqS/ZIWrfvBGjlIO5L2KRXnXo9sCttQy3LZU8Jut/6S7yT KSHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:dkim-signature; bh=avrg0p0zcjNQXnwku7LjBEc26ITlI2L8ZDmV7YUxLHk=; b=TrBwa/v1U0RS79SfD1F9TjxZouem4FCPUx2p8QzmElWRsxfhqdWtNDZIO5mJK20Yga sIZkfbQv5qrhgdnXtcmIOrBEaAKc/Jn+JoWQXTUNfSMVzrTRHBLN77BZMnZfIZTvwNRk LJX/UHsfw94OaeAW3xNg7L5ehOYoGjeMVbZ1X48StOJUoDPdB2VFDsLS3JFDKqkcbV7m p32UtZ5AbBRlbEnauc18hmNSGadVVTRDGbHYswH8WwQ/PJAT+QmxDmBD2wFUoN+BQoAg yel6d6DG8NTszfd8sMW6RC5Tr6+EMHZDis6FD696Xrq4STdgpxiv7xCygsl/4fr9T7nt xMNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hNP1eWcS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a17090619c400b0078168566b26si5030644ejd.356.2022.10.26.15.34.15; Wed, 26 Oct 2022 15:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hNP1eWcS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232528AbiJZWc5 (ORCPT + 99 others); Wed, 26 Oct 2022 18:32:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiJZWc4 (ORCPT ); Wed, 26 Oct 2022 18:32:56 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5AEE11F4B9 for ; Wed, 26 Oct 2022 15:32:54 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id o12so31840692lfq.9 for ; Wed, 26 Oct 2022 15:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=avrg0p0zcjNQXnwku7LjBEc26ITlI2L8ZDmV7YUxLHk=; b=hNP1eWcSKtSWB1d/Pitcegm6aBvNbn9ZZwOPfvyAHeLfSpWgKviYSn4HdfxqpmVxLx 3hqUT8rGLCtA1WbTsRwnPe5u3UcMos9xSnD5TZv+rOmijKDGBBCh8NVOtzeenY0qOWJW oh4drqCKFAmxuzjfWyqczkgGVY4e/XY9DK8cne6pWop/CZJOjY5RUV1N/4OKtEk0nxJO UC4dx27z4ITheuTf5vkslf5rQZRUk0qCvLfi1+DCcHCbS9nB8ML9tKunPxRfZ0ivAOEf qxDLwB203CFgLYKKW5ACXrIXmtd/8O6FmrNt5N5n34ARyUZHAOHdwbczBPdcJL3R4Gsa ONMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=avrg0p0zcjNQXnwku7LjBEc26ITlI2L8ZDmV7YUxLHk=; b=SzXB73U876tYuT9Q+v1u/B7ODE4k48FXFnSX2/i0YuwbYHd1ofhoAt4yt8cr2GpYDz zos0TL9juWnv9fTnRtos2c8gI8EErC1EgCah+i4uI/NDp2GI967iF1nvhjy2Id9arPxY jkPFCG4hhPRyQ87oficDVAVqeaK4CjwH27H1crZ0YLmJ2TNZdR3h/zUyY03xc5NkB/tK E8FWMAzWQizNNVcC35haX8q8zJ+WRQB4O+hKW0+KMV5Ht4Hbjw/SkDWGsk4C19tIxMaM Dv80QZwtO7DgOhyM6w26QB8ly3c49DH5Bi557pymx03/oR9vHz0UByN7SUM7ulR7IjYR P92w== X-Gm-Message-State: ACrzQf348hBL83aAAzl+nPjokWWcJxGYxtjd5aE4eniECzU2xHHg03YU 2U+hG2wNcEcMQ4WdhaZDt0E= X-Received: by 2002:ac2:4c47:0:b0:4a2:c07b:4b62 with SMTP id o7-20020ac24c47000000b004a2c07b4b62mr15855128lfk.426.1666823572924; Wed, 26 Oct 2022 15:32:52 -0700 (PDT) Received: from ?IPV6:2a02:a31a:a240:1700:c898:de98:30b3:a07? ([2a02:a31a:a240:1700:c898:de98:30b3:a07]) by smtp.googlemail.com with ESMTPSA id n11-20020ac2490b000000b004979df1c1fasm994280lfi.61.2022.10.26.15.32.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Oct 2022 15:32:52 -0700 (PDT) From: Mateusz Kwiatkowski X-Google-Original-From: Mateusz Kwiatkowski Message-ID: Date: Thu, 27 Oct 2022 00:32:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v6 22/23] drm/vc4: vec: Add support for more analog TV standards Content-Language: pl To: maxime@cerno.tech, Karol Herbst , Emma Anholt , Ben Skeggs , Chen-Yu Tsai , Rodrigo Vivi , Maarten Lankhorst , Jani Nikula , Daniel Vetter , Thomas Zimmermann , Tvrtko Ursulin , Samuel Holland , Jernej Skrabec , David Airlie , Maxime Ripard , Joonas Lahtinen , Lyude Paul Cc: linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org, Phil Elwell , linux-arm-kernel@lists.infradead.org, nouveau@lists.freedesktop.org, Hans de Goede , Dom Cobley , dri-devel@lists.freedesktop.org, Dave Stevenson , linux-kernel@vger.kernel.org, =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Geert Uytterhoeven References: <20220728-rpi-analog-tv-properties-v6-0-e7792734108f@cerno.tech> <20220728-rpi-analog-tv-properties-v6-22-e7792734108f@cerno.tech> In-Reply-To: <20220728-rpi-analog-tv-properties-v6-22-e7792734108f@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, I've seen that you've incorporated my PAL60 patch. Thanks! I still yet need to test your v6 changes, but looking at this code with just my mental static analysis, it seems to me that the vc4_vec_encoder_atomic_check() should have the tv_mode validation. I should've added it to the PAL60 patch, but it somehow slipped my mind then. Anyway, I mentioned it previously here: https://lore.kernel.org/dri-devel/0f2beec2-ae8e-5579-f0b6-a73d9dae1af4@gmail.com/ It would look something like this, inside vc4_vec_encoder_atomic_check(): + const struct vc4_vec_tv_mode *tv_mode = + vc4_vec_tv_mode_lookup(conn_state->tv.mode); + + if (!tv_mode) + return -EINVAL; Without this, it's possible to set e.g. 480i mode and SECAM, which will fail - but with the current version it will only fail in vc4_vec_encoder_enable(), which cannot return an error, and in my experience that causes a rather lengthy lockup. But, like I said, I still need to actually test that with this version. Anyway, I was also thinking about adding support for the more "exotic" non-standard modes. NTSC-50 is, unfortunately, impossible with VEC, but PAL-N-60 and PAL-M-50 should work. The necessary vc4_vec_tv_modes entries would look something like: @@ -325,12 +325,28 @@ static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = { .config0 = VEC_CONFIG0_PAL_M_STD, .config1 = VEC_CONFIG1_C_CVBS_CVBS, }, + { + /* PAL-M-50 */ + .mode = DRM_MODE_TV_MODE_PAL, + .expected_htotal = 864, + .config0 = VEC_CONFIG0_PAL_BDGHI_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, + .custom_freq = 0x21e6efe3, + }, { .mode = DRM_MODE_TV_MODE_PAL_N, .expected_htotal = 864, .config0 = VEC_CONFIG0_PAL_N_STD, .config1 = VEC_CONFIG1_C_CVBS_CVBS, }, + { + /* PAL-N-60 */ + .mode = DRM_MODE_TV_MODE_PAL_N, + .expected_htotal = 858, + .config0 = VEC_CONFIG0_PAL_M_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, + .custom_freq = 0x21f69446, + }, { .mode = DRM_MODE_TV_MODE_SECAM, .expected_htotal = 864, I'm not sure if we actually want to add that. The two arguments for doing so I can think of is 1. it should work, so "why not", 2. it means that more modes will result in _some_ kind of a valid signal, rather than erroring out, which is always a plus in my book. I can also think of a hypothetical use case, like someone in South America with an old PAL-N-only set that would nevertheless still sync at 60 Hz (perhaps with the help of messing with vertical hold knob), who would like to play retro games at 60 Hz in color. But on the other hand, I admit that this scenario is likely a stretch and the number of people who would actually use it is probably close to the proverbial two ;) So it's your call, I'm just leaving those settings here just in case. I'll get back in a couple of days when I do some testing of this v6 patchset. Best regards, Mateusz Kwiatkowski W dniu 26.10.2022 o 17:33, maxime@cerno.tech pisze: > From: Mateusz Kwiatkowski > > Add support for the following composite output modes (all of them are > somewhat more obscure than the previously defined ones): > > - NTSC_443 - NTSC-style signal with the chroma subcarrier shifted to > 4.43361875 MHz (the PAL subcarrier frequency). Never used for > broadcasting, but sometimes used as a hack to play NTSC content in PAL > regions (e.g. on VCRs). > - PAL_N - PAL with alternative chroma subcarrier frequency, > 3.58205625 MHz. Used as a broadcast standard in Argentina, Paraguay > and Uruguay to fit 576i50 with colour in 6 MHz channel raster. > - PAL60 - 480i60 signal with PAL-style color at normal European PAL > frequency. Another non-standard, non-broadcast mode, used in similar > contexts as NTSC_443. Some displays support one but not the other. > - SECAM - French frequency-modulated analog color standard; also have > been broadcast in Eastern Europe and various parts of Africa and Asia. > Uses the same 576i50 timings as PAL. > > Also added some comments explaining color subcarrier frequency > registers. > > Acked-by: Noralf Trønnes > Signed-off-by: Mateusz Kwiatkowski > Signed-off-by: Maxime Ripard > > --- > Changes in v6: > - Support PAL60 again > --- > drivers/gpu/drm/vc4/vc4_vec.c | 111 ++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 107 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c > index 1dda451c8def..d82aef168075 100644 > --- a/drivers/gpu/drm/vc4/vc4_vec.c > +++ b/drivers/gpu/drm/vc4/vc4_vec.c > @@ -46,6 +46,7 @@ > #define VEC_CONFIG0_YDEL(x) ((x) << 26) > #define VEC_CONFIG0_CDEL_MASK GENMASK(25, 24) > #define VEC_CONFIG0_CDEL(x) ((x) << 24) > +#define VEC_CONFIG0_SECAM_STD BIT(21) > #define VEC_CONFIG0_PBPR_FIL BIT(18) > #define VEC_CONFIG0_CHROMA_GAIN_MASK GENMASK(17, 16) > #define VEC_CONFIG0_CHROMA_GAIN_UNITY (0 << 16) > @@ -76,6 +77,27 @@ > #define VEC_SOFT_RESET 0x10c > #define VEC_CLMP0_START 0x144 > #define VEC_CLMP0_END 0x148 > + > +/* > + * These set the color subcarrier frequency > + * if VEC_CONFIG1_CUSTOM_FREQ is enabled. > + * > + * VEC_FREQ1_0 contains the most significant 16-bit half-word, > + * VEC_FREQ3_2 contains the least significant 16-bit half-word. > + * 0x80000000 seems to be equivalent to the pixel clock > + * (which itself is the VEC clock divided by 8). > + * > + * Reference values (with the default pixel clock of 13.5 MHz): > + * > + * NTSC (3579545.[45] Hz) - 0x21F07C1F > + * PAL (4433618.75 Hz) - 0x2A098ACB > + * PAL-M (3575611.[888111] Hz) - 0x21E6EFE3 > + * PAL-N (3582056.25 Hz) - 0x21F69446 > + * > + * NOTE: For SECAM, it is used as the Dr center frequency, > + * regardless of whether VEC_CONFIG1_CUSTOM_FREQ is enabled or not; > + * that is specified as 4406250 Hz, which corresponds to 0x29C71C72. > + */ > #define VEC_FREQ3_2 0x180 > #define VEC_FREQ1_0 0x184 > > @@ -118,6 +140,14 @@ > > #define VEC_INTERRUPT_CONTROL 0x190 > #define VEC_INTERRUPT_STATUS 0x194 > + > +/* > + * Db center frequency for SECAM; the clock for this is the same as for > + * VEC_FREQ3_2/VEC_FREQ1_0, which is used for Dr center frequency. > + * > + * This is specified as 4250000 Hz, which corresponds to 0x284BDA13. > + * That is also the default value, so no need to set it explicitly. > + */ > #define VEC_FCW_SECAM_B 0x198 > #define VEC_SECAM_GAIN_VAL 0x19c > > @@ -197,10 +227,15 @@ enum vc4_vec_tv_mode_id { > VC4_VEC_TV_MODE_NTSC_J, > VC4_VEC_TV_MODE_PAL, > VC4_VEC_TV_MODE_PAL_M, > + VC4_VEC_TV_MODE_NTSC_443, > + VC4_VEC_TV_MODE_PAL_60, > + VC4_VEC_TV_MODE_PAL_N, > + VC4_VEC_TV_MODE_SECAM, > }; > > struct vc4_vec_tv_mode { > unsigned int mode; > + u16 expected_htotal; > u32 config0; > u32 config1; > u32 custom_freq; > @@ -236,35 +271,68 @@ static const struct debugfs_reg32 vec_regs[] = { > static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = { > { > .mode = DRM_MODE_TV_MODE_NTSC, > + .expected_htotal = 858, > .config0 = VEC_CONFIG0_NTSC_STD | VEC_CONFIG0_PDEN, > .config1 = VEC_CONFIG1_C_CVBS_CVBS, > }, > + { > + .mode = DRM_MODE_TV_MODE_NTSC_443, > + .expected_htotal = 858, > + .config0 = VEC_CONFIG0_NTSC_STD, > + .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, > + .custom_freq = 0x2a098acb, > + }, > { > .mode = DRM_MODE_TV_MODE_NTSC_J, > + .expected_htotal = 858, > .config0 = VEC_CONFIG0_NTSC_STD, > .config1 = VEC_CONFIG1_C_CVBS_CVBS, > }, > { > .mode = DRM_MODE_TV_MODE_PAL, > + .expected_htotal = 864, > .config0 = VEC_CONFIG0_PAL_BDGHI_STD, > .config1 = VEC_CONFIG1_C_CVBS_CVBS, > }, > + { > + /* PAL-60 */ > + .mode = DRM_MODE_TV_MODE_PAL, > + .expected_htotal = 858, > + .config0 = VEC_CONFIG0_PAL_M_STD, > + .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, > + .custom_freq = 0x2a098acb, > + }, > { > .mode = DRM_MODE_TV_MODE_PAL_M, > + .expected_htotal = 858, > .config0 = VEC_CONFIG0_PAL_M_STD, > .config1 = VEC_CONFIG1_C_CVBS_CVBS, > }, > + { > + .mode = DRM_MODE_TV_MODE_PAL_N, > + .expected_htotal = 864, > + .config0 = VEC_CONFIG0_PAL_N_STD, > + .config1 = VEC_CONFIG1_C_CVBS_CVBS, > + }, > + { > + .mode = DRM_MODE_TV_MODE_SECAM, > + .expected_htotal = 864, > + .config0 = VEC_CONFIG0_SECAM_STD, > + .config1 = VEC_CONFIG1_C_CVBS_CVBS, > + .custom_freq = 0x29c71c72, > + }, > }; > > static inline const struct vc4_vec_tv_mode * > -vc4_vec_tv_mode_lookup(unsigned int mode) > +vc4_vec_tv_mode_lookup(unsigned int mode, u16 htotal) > { > unsigned int i; > > for (i = 0; i < ARRAY_SIZE(vc4_vec_tv_modes); i++) { > const struct vc4_vec_tv_mode *tv_mode = &vc4_vec_tv_modes[i]; > > - if (tv_mode->mode == mode) > + if (tv_mode->mode == mode && > + tv_mode->expected_htotal == htotal) > return tv_mode; > } > > @@ -273,9 +341,13 @@ vc4_vec_tv_mode_lookup(unsigned int mode) > > static const struct drm_prop_enum_list legacy_tv_mode_names[] = { > { VC4_VEC_TV_MODE_NTSC, "NTSC", }, > + { VC4_VEC_TV_MODE_NTSC_443, "NTSC-443", }, > { VC4_VEC_TV_MODE_NTSC_J, "NTSC-J", }, > { VC4_VEC_TV_MODE_PAL, "PAL", }, > + { VC4_VEC_TV_MODE_PAL_60, "PAL-60", }, > { VC4_VEC_TV_MODE_PAL_M, "PAL-M", }, > + { VC4_VEC_TV_MODE_PAL_N, "PAL-N", }, > + { VC4_VEC_TV_MODE_SECAM, "SECAM", }, > }; > > static enum drm_connector_status > @@ -306,11 +378,16 @@ vc4_vec_connector_set_property(struct drm_connector *connector, > state->tv.mode = DRM_MODE_TV_MODE_NTSC; > break; > > + case VC4_VEC_TV_MODE_NTSC_443: > + state->tv.mode = DRM_MODE_TV_MODE_NTSC_443; > + break; > + > case VC4_VEC_TV_MODE_NTSC_J: > state->tv.mode = DRM_MODE_TV_MODE_NTSC_J; > break; > > case VC4_VEC_TV_MODE_PAL: > + case VC4_VEC_TV_MODE_PAL_60: > state->tv.mode = DRM_MODE_TV_MODE_PAL; > break; > > @@ -318,6 +395,14 @@ vc4_vec_connector_set_property(struct drm_connector *connector, > state->tv.mode = DRM_MODE_TV_MODE_PAL_M; > break; > > + case VC4_VEC_TV_MODE_PAL_N: > + state->tv.mode = DRM_MODE_TV_MODE_PAL_N; > + break; > + > + case VC4_VEC_TV_MODE_SECAM: > + state->tv.mode = DRM_MODE_TV_MODE_SECAM; > + break; > + > default: > return -EINVAL; > } > @@ -341,6 +426,10 @@ vc4_vec_connector_get_property(struct drm_connector *connector, > *val = VC4_VEC_TV_MODE_NTSC; > break; > > + case DRM_MODE_TV_MODE_NTSC_443: > + *val = VC4_VEC_TV_MODE_NTSC_443; > + break; > + > case DRM_MODE_TV_MODE_NTSC_J: > *val = VC4_VEC_TV_MODE_NTSC_J; > break; > @@ -353,6 +442,14 @@ vc4_vec_connector_get_property(struct drm_connector *connector, > *val = VC4_VEC_TV_MODE_PAL_M; > break; > > + case DRM_MODE_TV_MODE_PAL_N: > + *val = VC4_VEC_TV_MODE_PAL_N; > + break; > + > + case DRM_MODE_TV_MODE_SECAM: > + *val = VC4_VEC_TV_MODE_SECAM; > + break; > + > default: > return -EINVAL; > } > @@ -448,13 +545,16 @@ static void vc4_vec_encoder_enable(struct drm_encoder *encoder, > struct drm_connector *connector = &vec->connector; > struct drm_connector_state *conn_state = > drm_atomic_get_new_connector_state(state, connector); > + struct drm_display_mode *adjusted_mode = > + &encoder->crtc->state->adjusted_mode; > const struct vc4_vec_tv_mode *tv_mode; > int idx, ret; > > if (!drm_dev_enter(drm, &idx)) > return; > > - tv_mode = vc4_vec_tv_mode_lookup(conn_state->tv.mode); > + tv_mode = vc4_vec_tv_mode_lookup(conn_state->tv.mode, > + adjusted_mode->htotal); > if (!tv_mode) > goto err_dev_exit; > > @@ -643,9 +743,12 @@ static int vc4_vec_bind(struct device *dev, struct device *master, void *data) > > ret = drm_mode_create_tv_properties(drm, > BIT(DRM_MODE_TV_MODE_NTSC) | > + BIT(DRM_MODE_TV_MODE_NTSC_443) | > BIT(DRM_MODE_TV_MODE_NTSC_J) | > BIT(DRM_MODE_TV_MODE_PAL) | > - BIT(DRM_MODE_TV_MODE_PAL_M)); > + BIT(DRM_MODE_TV_MODE_PAL_M) | > + BIT(DRM_MODE_TV_MODE_PAL_N) | > + BIT(DRM_MODE_TV_MODE_SECAM)); > if (ret) > return ret; > >