mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Maxime Ripard <maxime@cerno.tech>
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>,
	"Noralf Trønnes" <noralf@tronnes.org>
Subject: Re: [PATCH v4 11/30] drm/modes: Add a function to generate analog display modes
Date: Sat, 15 Oct 2022 17:04:50 +0200	[thread overview]
Message-ID: <71e53906-ae9b-55b9-7a93-7bb04a891423@tronnes.org> (raw)
In-Reply-To: <20221013083638.kloiaxervnhii7ew@houat>



Den 13.10.2022 10.36, skrev Maxime Ripard:
> 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/
> 

If that's the case I suggest you just hardcode them for now and leave
the complexity to the developer doing the actual conversion of the fbdev
driver. Who knows when that will happen, but that person will have your
well documented and discussed work to fall back on.

Noralf.

  reply	other threads:[~2022-10-15 15:05 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
2022-10-15 15:04       ` Noralf Trønnes [this message]
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=71e53906-ae9b-55b9-7a93-7bb04a891423@tronnes.org \
    --to=noralf@tronnes.org \
    --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=maxime@cerno.tech \
    --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

all inboxes | Powered by JetHome®