[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221109154133.koqhn6upwz6jd2oe@houat>
Date: Wed, 9 Nov 2022 16:41:33 +0100
From: Maxime Ripard <maxime@...no.tech>
To: Noralf Trønnes <noralf@...nnes.org>
Cc: Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
Ben Skeggs <bskeggs@...hat.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Samuel Holland <samuel@...lland.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Emma Anholt <emma@...olt.net>,
Karol Herbst <kherbst@...hat.com>,
Daniel Vetter <daniel@...ll.ch>, Chen-Yu Tsai <wens@...e.org>,
Lyude Paul <lyude@...hat.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Phil Elwell <phil@...pberrypi.com>,
Hans de Goede <hdegoede@...hat.com>,
linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
linux-arm-kernel@...ts.infradead.org,
Dom Cobley <dom@...pberrypi.com>,
Mateusz Kwiatkowski <kfyatek+publicgit@...il.com>,
dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
nouveau@...ts.freedesktop.org
Subject: Re: [PATCH v7 16/23] drm/probe-helper: Provide a TV get_modes helper
Hi Noralf,
On Mon, Nov 07, 2022 at 07:11:27PM +0100, Noralf Trønnes wrote:
>
>
> Den 07.11.2022 15.16, skrev Maxime Ripard:
> > From: Noralf Trønnes <noralf@...nnes.org>
> >
> > Most of the TV connectors will need a similar get_modes implementation
> > that will, depending on the drivers' capabilities, register the 480i and
> > 576i modes.
> >
> > That implementation will also need to set the preferred flag and order
> > the modes based on the driver and users preferrence.
> >
> > This is especially important to guarantee that a userspace stack such as
> > Xorg can start and pick up the preferred mode while maintaining a
> > working output.
> >
> > Signed-off-by: Noralf Trønnes <noralf@...nnes.org>
> > Signed-off-by: Maxime Ripard <maxime@...no.tech>
> >
> > ---
> > Changes in v7:
> > - Used Noralf's implementation
> >
> > Changes in v6:
> > - New patch
> > ---
> > drivers/gpu/drm/drm_probe_helper.c | 97 ++++++++++++++++++++++++++++++++++++++
> > include/drm/drm_probe_helper.h | 1 +
> > 2 files changed, 98 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index 2fc21df709bc..edb2e4c4530a 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -1147,3 +1147,100 @@ int drm_connector_helper_get_modes(struct drm_connector *connector)
> > return count;
> > }
> > EXPORT_SYMBOL(drm_connector_helper_get_modes);
> > +
> > +static bool tv_mode_supported(struct drm_connector *connector,
> > + enum drm_connector_tv_mode mode)
> > +{
> > + struct drm_device *dev = connector->dev;
> > + struct drm_property *property = dev->mode_config.tv_mode_property;
> > +
> > + unsigned int i;
> > +
> > + for (i = 0; i < property->num_values; i++)
> > + if (property->values[i] == mode)
> > + return true;
> > +
> > + return false;
> > +}
>
> This function is not used in the new implementation.
>
> I hope you have tested this patch since I didn't even compile test my
> implementation (probably should have said so...)
You nailed it ;)
I had tested it (but missed the warning), and added unit tests to make
sure it was behaving properly, and it did. I'll send the unit tests in
my next version.
Thanks
Maxime
Powered by blists - more mailing lists