dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Mateusz Kwiatkowski <kfyatek@gmail.com>
Cc: "Karol Herbst" <kherbst@redhat.com>,
	"David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Phil Elwell" <phil@raspberrypi.com>,
	"Emma Anholt" <emma@anholt.net>,
	"Samuel Holland" <samuel@sholland.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	linux-sunxi@lists.linux.dev, intel-gfx@lists.freedesktop.org,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	linux-arm-kernel@lists.infradead.org,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	"Dom Cobley" <dom@raspberrypi.com>,
	"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
	linux-kernel@vger.kernel.org,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>
Subject: Re: [PATCH v6 22/23] drm/vc4: vec: Add support for more analog TV standards
Date: Thu, 27 Oct 2022 13:58:22 +0200	[thread overview]
Message-ID: <20221027115822.5vd3fqlcpy4gfq5v@houat> (raw)
In-Reply-To: <e9b8ebf6-8781-0c55-5dd5-9f5077bd6b93@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3333 bytes --]

Hi,

On Thu, Oct 27, 2022 at 12:32:50AM +0200, Mateusz Kwiatkowski wrote:
> 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.

ACK, I'll add it.

> 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.

This series is already pretty massive and is difficult to merge, so I'd
rather avoid to add new stuff in at every version. The changes look easy
enough to be a follow-up patch, so I'd prefer to do it that way.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-10-27 11:58 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 15:33 [PATCH v6 00/23] drm: Analog TV Improvements maxime
2022-10-26 15:33 ` [PATCH v6 01/23] drm/tests: Add Kunit Helpers maxime
2022-10-26 15:33 ` [PATCH v6 02/23] drm/connector: Rename legacy TV property maxime
2022-10-26 15:33 ` [PATCH v6 03/23] drm/connector: Only register TV mode property if present maxime
2022-10-26 15:33 ` [PATCH v6 04/23] drm/connector: Rename drm_mode_create_tv_properties maxime
2022-10-26 15:33 ` [PATCH v6 05/23] drm/connector: Add TV standard property maxime
2022-10-26 15:33 ` [PATCH v6 06/23] drm/modes: Add a function to generate analog display modes maxime
2022-10-26 15:33 ` [PATCH v6 07/23] drm/client: Add some tests for drm_connector_pick_cmdline_mode() maxime
2022-10-26 15:33 ` [PATCH v6 08/23] drm/modes: Move named modes parsing to a separate function maxime
2022-11-05 14:02   ` Noralf Trønnes
2022-10-26 15:33 ` [PATCH v6 09/23] drm/modes: Switch to named mode descriptors maxime
2022-11-05 14:06   ` Noralf Trønnes
2022-10-26 15:33 ` [PATCH v6 10/23] drm/modes: Fill drm_cmdline mode from named modes maxime
2022-11-06 13:04   ` Noralf Trønnes
2022-11-07 10:02     ` Maxime Ripard
2022-10-26 15:33 ` [PATCH v6 11/23] drm/connector: Add pixel clock to cmdline mode maxime
2022-11-06 13:06   ` Noralf Trønnes
2022-10-26 15:33 ` [PATCH v6 12/23] drm/connector: Add a function to lookup a TV mode by its name maxime
2022-10-26 15:33 ` [PATCH v6 13/23] drm/modes: Introduce the tv_mode property as a command-line option maxime
2022-11-06 13:10   ` Noralf Trønnes
2022-10-26 15:33 ` [PATCH v6 14/23] drm/modes: Properly generate a drm_display_mode from a named mode maxime
2022-10-26 21:25   ` Mateusz Kwiatkowski
2022-11-05 17:50   ` Noralf Trønnes
2022-11-07 13:34     ` Maxime Ripard
2022-10-26 15:33 ` [PATCH v6 15/23] drm/modes: Introduce more named modes maxime
2022-10-26 15:33 ` [PATCH v6 16/23] drm/probe-helper: Provide a TV get_modes helper maxime
2022-10-26 22:02   ` Mateusz Kwiatkowski
2022-10-27  9:37     ` Maxime Ripard
2022-11-06 16:59     ` Noralf Trønnes
2022-11-07 10:07       ` Maxime Ripard
2022-11-07 11:17         ` Noralf Trønnes
2022-11-06 16:33   ` Noralf Trønnes
2022-11-07 10:21     ` Maxime Ripard
2022-11-07 11:29       ` Noralf Trønnes
2022-11-07 12:45         ` Maxime Ripard
2022-10-26 15:33 ` [PATCH v6 17/23] drm/atomic-helper: Add a TV properties reset helper maxime
2022-10-26 15:33 ` [PATCH v6 18/23] drm/atomic-helper: Add an analog TV atomic_check implementation maxime
2022-10-26 15:33 ` [PATCH v6 19/23] drm/vc4: vec: Use TV Reset implementation maxime
2022-10-26 15:33 ` [PATCH v6 20/23] drm/vc4: vec: Check for VEC output constraints maxime
2022-10-26 15:33 ` [PATCH v6 21/23] drm/vc4: vec: Convert to the new TV mode property maxime
2022-10-26 15:33 ` [PATCH v6 22/23] drm/vc4: vec: Add support for more analog TV standards maxime
2022-10-26 22:32   ` Mateusz Kwiatkowski
2022-10-27 11:58     ` Maxime Ripard [this message]
2022-10-26 15:33 ` [PATCH v6 23/23] drm/sun4i: tv: Convert to the new TV mode property maxime

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221027115822.5vd3fqlcpy4gfq5v@houat \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dom@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=geert@linux-m68k.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=kfyatek@gmail.com \
    --cc=kherbst@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=noralf@tronnes.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=phil@raspberrypi.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=samuel@sholland.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=tzimmermann@suse.de \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).