linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>,
	Chen-Yu Tsai <wens@csie.org>, Karol Herbst <kherbst@redhat.com>,
	Samuel Holland <samuel@sholland.org>,
	Lyude Paul <lyude@redhat.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Emma Anholt <emma@anholt.net>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Ben Skeggs <bskeggs@redhat.com>, David Airlie <airlied@linux.ie>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org,
	dri-devel@lists.freedesktop.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	intel-gfx@lists.freedesktop.org, linux-sunxi@lists.linux.dev,
	Hans de Goede <hdegoede@redhat.com>,
	nouveau@lists.freedesktop.org,
	Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	linux-kernel@vger.kernel.org, Dom Cobley <dom@raspberrypi.com>,
	Phil Elwell <phil@raspberrypi.com>
Subject: Re: [PATCH v4 11/30] drm/modes: Add a function to generate analog display modes
Date: Thu, 13 Oct 2022 10:36:38 +0200	[thread overview]
Message-ID: <20221013083638.kloiaxervnhii7ew@houat> (raw)
In-Reply-To: <0aa690b8-988a-878f-4d4f-d391295bc591@tronnes.org>

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

Hi Noralf,

On Sat, Oct 01, 2022 at 02:52:06PM +0200, Noralf Trønnes wrote:
> Den 29.09.2022 18.31, skrev Maxime Ripard:
> > Multiple drivers (meson, vc4, sun4i) define analog TV 525-lines and
> > 625-lines modes in their drivers.
> > 
> > Since those modes are fairly standard, and that we'll need to use them
> > in more places in the future, it makes sense to move their definition
> > into the core framework.
> > 
> > However, analog display usually have fairly loose timings requirements,
> > the only discrete parameters being the total number of lines and pixel
> > clock frequency. Thus, we created a function that will create a display
> > mode from the standard, the pixel frequency and the active area.
> > 
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > 
> > ---
> > 
> > Changes in v4:
> > - Reworded the line length check comment
> > - Switch to HZ_PER_KHZ in tests
> > - Use previous timing to fill our mode
> > - Move the number of lines check earlier
> > ---
> >  drivers/gpu/drm/drm_modes.c            | 474 +++++++++++++++++++++++++++++++++
> >  drivers/gpu/drm/tests/Makefile         |   1 +
> >  drivers/gpu/drm/tests/drm_modes_test.c | 144 ++++++++++
> >  include/drm/drm_modes.h                |  17 ++
> >  4 files changed, 636 insertions(+)
> > 
> 
> I haven't followed the discussion on this patch, but it seems rather
> excessive to add over 600 lines of code (including tests) to add 2 fixed
> modes. And it's very difficult to see from the code what the actual
> display mode timings really are, which would be useful for other
> developers down the road wanting to use them.
> 
> Why not just hardcode the modes?

Yeah, I have kind of the same feeling tbh, but it was asked back on the
v1 to ease the transition of old fbdev drivers, since they will need
such a function:
https://lore.kernel.org/dri-devel/CAMuHMdUrwzPYjA0wdR7ADj5Ov6+m03JbnY8fBYzRYyWDuNm5=g@mail.gmail.com/

Maxime

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

  reply	other threads:[~2022-10-13  8:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220728-rpi-analog-tv-properties-v4-0-60d38873f782@cerno.tech>
     [not found] ` <20220728-rpi-analog-tv-properties-v4-1-60d38873f782@cerno.tech>
2022-09-30 11:34   ` [PATCH v4 01/30] drm/docs: Remove unused TV Standard property Noralf Trønnes
     [not found] ` <20220728-rpi-analog-tv-properties-v4-10-60d38873f782@cerno.tech>
2022-09-30 11:46   ` [PATCH v4 10/30] drm/connector: Add TV standard property Noralf Trønnes
     [not found] ` <20220728-rpi-analog-tv-properties-v4-3-60d38873f782@cerno.tech>
2022-09-30 14:47   ` [PATCH v4 03/30] drm/tests: Add Kunit Helpers Noralf Trønnes
     [not found] ` <20220728-rpi-analog-tv-properties-v4-30-60d38873f782@cerno.tech>
2022-10-01 12:37   ` [PATCH v4 30/30] drm/sun4i: tv: Convert to the new TV mode property Noralf Trønnes
     [not found] ` <20220728-rpi-analog-tv-properties-v4-11-60d38873f782@cerno.tech>
2022-10-01 12:52   ` [PATCH v4 11/30] drm/modes: Add a function to generate analog display modes Noralf Trønnes
2022-10-13  8:36     ` Maxime Ripard [this message]
2022-10-15 15:04       ` Noralf Trønnes
2022-10-18  7:34         ` Maxime Ripard
2022-10-01 13:12 ` [PATCH v4 00/30] drm: Analog TV Improvements Noralf Trønnes
2022-10-10 12:11   ` Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-14-60d38873f782@cerno.tech>
2022-10-01 17:42   ` [PATCH v4 14/30] drm/client: Add some tests for drm_connector_pick_cmdline_mode() Maíra Canal
     [not found] ` <20220728-rpi-analog-tv-properties-v4-2-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 02/30] drm/tests: Order Kunit tests in Makefile Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-4-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 04/30] drm/atomic-helper: Rename drm_atomic_helper_connector_tv_reset to avoid ambiguity Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-5-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 05/30] drm/connector: Rename subconnector state variable Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-6-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 06/30] drm/atomic: Add TV subconnector property to get/set_property Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-12-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 12/30] drm/modes: Only consider bpp and refresh before options Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-13-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 13/30] drm/modes: parse_cmdline: Add support for named modes containing dashes Maxime Ripard
     [not found] ` <20220728-rpi-analog-tv-properties-v4-25-60d38873f782@cerno.tech>
2022-10-10 12:10   ` (subset) [PATCH v4 25/30] drm/vc4: vec: Fix definition of PAL-M mode Maxime Ripard

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=20221013083638.kloiaxervnhii7ew@houat \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --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=jani.nikula@linux.intel.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kfyatek+publicgit@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=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --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).