mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Maxime Ripard <mripard@kernel.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>
Subject: Re: [PATCH/RFC 3/3] drm: Split drm_modeset_helper_vtables.h
Date: Fri, 29 Sep 2023 09:46:31 +0200	[thread overview]
Message-ID: <709a1b3d-a9fe-4b7e-a199-c5d9e27eefbe@suse.de> (raw)
In-Reply-To: <CAMuHMdXWRgL0uxLXt7geDCuHdQ=CDPhOzE7WCa4f4wRFvD50sw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3877 bytes --]

Hi

Am 29.09.23 um 09:33 schrieb Geert Uytterhoeven:
> Hi Thomas,
> 
> On Fri, Sep 29, 2023 at 9:11 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Am 28.09.23 um 17:32 schrieb Geert Uytterhoeven:
>>> On Thu, Sep 28, 2023 at 3:59 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>>> Am 28.09.23 um 14:16 schrieb Geert Uytterhoeven:
>>>>> <drm/drm_modeset_helper_vtables.h> is the second largest header file in
>>>>> the DRM subsystem, and declares helpers vtables for various DRM
>>>>> components.  Several vtables contain methods with the same name, and all
>>>>> but one vtable do not fit on the screen, making it hard to navigate to
>>>>> the actual method one is interested in.
>>>>>
>>>>> Make it easier for the casual reviewer to keep track by splitting
>>>>> <drm/drm_modeset_helper_vtables.h> in multiple header files, one per DRM
>>>>> component.
>>>>
>>>> I never liked this header either, but do we need new header files? Each
>>>> struct could be appended to the end of the regular header: struct
>>>> drm_plane_helper_funcs to drm_plane.h, drm_connector_helper_func to
>>>> drm_connector.h and so on.
>>>
>>> That would work for me, too.  But perhaps we want to maintain a clear
>>> separation between core and helpers?
>>>
>>> Note that moving the contents to *_helper.h would be another option,
>>> drm_crtc_helper.h and drm_plane_helper.h already exist.
>>
>> I've taken a closer look at the users of the _vtables header. There's
>> code in drm_atomic_helper.c or drm_probe_helper.c that invokes the
>> callback functions.
>>
>> The drivers fill the pointers with code that often comes from other
>> helper modules. That code is in files like drm_plane_helper.c or
>> drm_crtc_helper.c. There header files are drm_plane_helper.h, etc.
>>
>> In that context, the _vtables header makes sense, as it separates the
>> callers from the callees. Putting the structs into headers like
>> drm_plane_helper.h would move it to the callee side.
>>
>> I suggest to leave the header as it is. The fallout to the code base
>> from refactoring seems worse than the current state.
> 
> To clarify: do you mean keeping the single big drm_modeset_helper_vtables.h,
> or the split drm_*_helper_vtable.h set?

I meant to keep the single big drm_modeset_helper_vtables.h. It's not 
nice to look at, but I think we might easily mess up the header 
dependencies with any changes.

Best regards
Thomas

> 
> Thanks!
> 
>>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>>>> ---
>>>>> RFC, a future patch could replace inclusion of
>>>>> <drm/drm_modeset_helper_vtables.h> by inclusion of one or more of the
>>>>> new files, and reduce compilation time.
>>>>> ---
>>>>>     include/drm/drm_connector_helper_vtable.h   |  364 +++++
>>>>>     include/drm/drm_crtc_helper_vtable.h        |  483 ++++++
>>>>>     include/drm/drm_encoder_helper_vtable.h     |  381 +++++
>>>>>     include/drm/drm_mode_config_helper_vtable.h |   97 ++
>>>>>     include/drm/drm_modeset_helper_vtables.h    | 1466 +------------------
>>>>>     include/drm/drm_plane_helper_vtable.h       |  297 ++++
>>>>>     6 files changed, 1627 insertions(+), 1461 deletions(-)
>>>>>     create mode 100644 include/drm/drm_connector_helper_vtable.h
>>>>>     create mode 100644 include/drm/drm_crtc_helper_vtable.h
>>>>>     create mode 100644 include/drm/drm_encoder_helper_vtable.h
>>>>>     create mode 100644 include/drm/drm_mode_config_helper_vtable.h
>>>>>     create mode 100644 include/drm/drm_plane_helper_vtable.h
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      reply	other threads:[~2023-09-29  7:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 12:16 [PATCH 0/3] " Geert Uytterhoeven
2023-09-28 12:16 ` [PATCH 1/3] drm: Spelling s/hardward/hardware/g Geert Uytterhoeven
2023-09-29  4:09   ` Neil Armstrong
2023-09-29  7:12   ` Thomas Zimmermann
2023-09-28 12:16 ` [PATCH 2/3] drm: Spelling s/preceeding/preceding/g Geert Uytterhoeven
2023-09-29  7:13   ` Thomas Zimmermann
2023-09-28 12:16 ` [PATCH/RFC 3/3] drm: Split drm_modeset_helper_vtables.h Geert Uytterhoeven
2023-09-28 13:59   ` Thomas Zimmermann
2023-09-28 15:32     ` Geert Uytterhoeven
2023-09-29  7:11       ` Thomas Zimmermann
2023-09-29  7:33         ` Geert Uytterhoeven
2023-09-29  7:46           ` Thomas Zimmermann [this message]

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=709a1b3d-a9fe-4b7e-a199-c5d9e27eefbe@suse.de \
    --to=tzimmermann@suse.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.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®