From: Thomas Zimmermann <tzimmermann@suse.de>
To: Javier Martinez Canillas <javierm@redhat.com>,
linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH] drm/ssd130x: Drop _helper prefix from struct drm_*_helper_funcs callbacks
Date: Mon, 18 Sep 2023 08:51:50 +0200 [thread overview]
Message-ID: <f5620d32-2705-498b-a65c-7dc663340a6d@suse.de> (raw)
In-Reply-To: <20230914195138.1518065-1-javierm@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 7536 bytes --]
Hi
Am 14.09.23 um 21:51 schrieb Javier Martinez Canillas:
> The driver uses a naming convention where functions for struct drm_*_funcs
> callbacks are named ssd130x_$object_$operation, while the callbacks for
> struct drm_*_helper_funcs are named ssd130x_$object_helper_$operation.
>
> The idea is that this helper_ prefix in the function names denote that are
> for struct drm_*_helper_funcs callbacks. This convention was copied from
> other drivers, when ssd130x was written but Maxime pointed out that is the
> exception rather than the norm.
I guess you found this in my code. I want to point out that I use the
_helper infix to signal that these are callback for
drm_primary_plane_helper_funcs and *not* drm_primary_plane_funcs. The
naming is intentional.
Best regards
Thomas
>
> So let's get rid of the _helper prefixes from the function handlers names.
>
> Suggested-by: Maxime Ripard <mripard@kernel.org>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
>
> drivers/gpu/drm/solomon/ssd130x.c | 46 +++++++++++++++----------------
> 1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
> index 8ab02724f65f..245e4ba1c041 100644
> --- a/drivers/gpu/drm/solomon/ssd130x.c
> +++ b/drivers/gpu/drm/solomon/ssd130x.c
> @@ -630,8 +630,8 @@ static int ssd130x_fb_blit_rect(struct drm_framebuffer *fb,
> return ret;
> }
>
> -static int ssd130x_primary_plane_helper_atomic_check(struct drm_plane *plane,
> - struct drm_atomic_state *state)
> +static int ssd130x_primary_plane_atomic_check(struct drm_plane *plane,
> + struct drm_atomic_state *state)
> {
> struct drm_device *drm = plane->dev;
> struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> @@ -667,8 +667,8 @@ static int ssd130x_primary_plane_helper_atomic_check(struct drm_plane *plane,
> return 0;
> }
>
> -static void ssd130x_primary_plane_helper_atomic_update(struct drm_plane *plane,
> - struct drm_atomic_state *state)
> +static void ssd130x_primary_plane_atomic_update(struct drm_plane *plane,
> + struct drm_atomic_state *state)
> {
> struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
> @@ -701,8 +701,8 @@ static void ssd130x_primary_plane_helper_atomic_update(struct drm_plane *plane,
> drm_dev_exit(idx);
> }
>
> -static void ssd130x_primary_plane_helper_atomic_disable(struct drm_plane *plane,
> - struct drm_atomic_state *state)
> +static void ssd130x_primary_plane_atomic_disable(struct drm_plane *plane,
> + struct drm_atomic_state *state)
> {
> struct drm_device *drm = plane->dev;
> struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> @@ -777,9 +777,9 @@ static void ssd130x_primary_plane_destroy_state(struct drm_plane *plane,
>
> static const struct drm_plane_helper_funcs ssd130x_primary_plane_helper_funcs = {
> DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
> - .atomic_check = ssd130x_primary_plane_helper_atomic_check,
> - .atomic_update = ssd130x_primary_plane_helper_atomic_update,
> - .atomic_disable = ssd130x_primary_plane_helper_atomic_disable,
> + .atomic_check = ssd130x_primary_plane_atomic_check,
> + .atomic_update = ssd130x_primary_plane_atomic_update,
> + .atomic_disable = ssd130x_primary_plane_atomic_disable,
> };
>
> static const struct drm_plane_funcs ssd130x_primary_plane_funcs = {
> @@ -791,8 +791,8 @@ static const struct drm_plane_funcs ssd130x_primary_plane_funcs = {
> .destroy = drm_plane_cleanup,
> };
>
> -static enum drm_mode_status ssd130x_crtc_helper_mode_valid(struct drm_crtc *crtc,
> - const struct drm_display_mode *mode)
> +static enum drm_mode_status ssd130x_crtc_mode_valid(struct drm_crtc *crtc,
> + const struct drm_display_mode *mode)
> {
> struct ssd130x_device *ssd130x = drm_to_ssd130x(crtc->dev);
>
> @@ -807,8 +807,8 @@ static enum drm_mode_status ssd130x_crtc_helper_mode_valid(struct drm_crtc *crtc
> return MODE_OK;
> }
>
> -static int ssd130x_crtc_helper_atomic_check(struct drm_crtc *crtc,
> - struct drm_atomic_state *state)
> +static int ssd130x_crtc_atomic_check(struct drm_crtc *crtc,
> + struct drm_atomic_state *state)
> {
> struct drm_device *drm = crtc->dev;
> struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> @@ -882,8 +882,8 @@ static void ssd130x_crtc_destroy_state(struct drm_crtc *crtc,
> * the screen in the primary plane's atomic_disable function.
> */
> static const struct drm_crtc_helper_funcs ssd130x_crtc_helper_funcs = {
> - .mode_valid = ssd130x_crtc_helper_mode_valid,
> - .atomic_check = ssd130x_crtc_helper_atomic_check,
> + .mode_valid = ssd130x_crtc_mode_valid,
> + .atomic_check = ssd130x_crtc_atomic_check,
> };
>
> static const struct drm_crtc_funcs ssd130x_crtc_funcs = {
> @@ -895,8 +895,8 @@ static const struct drm_crtc_funcs ssd130x_crtc_funcs = {
> .atomic_destroy_state = ssd130x_crtc_destroy_state,
> };
>
> -static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder,
> - struct drm_atomic_state *state)
> +static void ssd130x_encoder_atomic_enable(struct drm_encoder *encoder,
> + struct drm_atomic_state *state)
> {
> struct drm_device *drm = encoder->dev;
> struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> @@ -921,8 +921,8 @@ static void ssd130x_encoder_helper_atomic_enable(struct drm_encoder *encoder,
> return;
> }
>
> -static void ssd130x_encoder_helper_atomic_disable(struct drm_encoder *encoder,
> - struct drm_atomic_state *state)
> +static void ssd130x_encoder_atomic_disable(struct drm_encoder *encoder,
> + struct drm_atomic_state *state)
> {
> struct drm_device *drm = encoder->dev;
> struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> @@ -935,15 +935,15 @@ static void ssd130x_encoder_helper_atomic_disable(struct drm_encoder *encoder,
> }
>
> static const struct drm_encoder_helper_funcs ssd130x_encoder_helper_funcs = {
> - .atomic_enable = ssd130x_encoder_helper_atomic_enable,
> - .atomic_disable = ssd130x_encoder_helper_atomic_disable,
> + .atomic_enable = ssd130x_encoder_atomic_enable,
> + .atomic_disable = ssd130x_encoder_atomic_disable,
> };
>
> static const struct drm_encoder_funcs ssd130x_encoder_funcs = {
> .destroy = drm_encoder_cleanup,
> };
>
> -static int ssd130x_connector_helper_get_modes(struct drm_connector *connector)
> +static int ssd130x_connector_get_modes(struct drm_connector *connector)
> {
> struct ssd130x_device *ssd130x = drm_to_ssd130x(connector->dev);
> struct drm_display_mode *mode;
> @@ -963,7 +963,7 @@ static int ssd130x_connector_helper_get_modes(struct drm_connector *connector)
> }
>
> static const struct drm_connector_helper_funcs ssd130x_connector_helper_funcs = {
> - .get_modes = ssd130x_connector_helper_get_modes,
> + .get_modes = ssd130x_connector_get_modes,
> };
>
> static const struct drm_connector_funcs ssd130x_connector_funcs = {
--
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 --]
next prev parent reply other threads:[~2023-09-18 6:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 19:51 Javier Martinez Canillas
2023-09-18 6:51 ` Thomas Zimmermann [this message]
2023-09-18 7:19 ` Javier Martinez Canillas
2023-09-21 7:44 ` Maxime Ripard
2023-09-21 7:57 ` Geert Uytterhoeven
2023-09-21 8:12 ` Maxime Ripard
2023-09-21 8:25 ` Javier Martinez Canillas
2023-09-21 8:46 ` Geert Uytterhoeven
2023-09-21 8:51 ` Maxime Ripard
2023-09-21 9:07 ` Geert Uytterhoeven
2023-09-21 8:55 ` Thomas Zimmermann
2023-09-21 8:23 ` Javier Martinez Canillas
2023-09-21 8:44 ` Thomas Zimmermann
2023-09-21 8:52 ` Thomas Zimmermann
2023-09-21 13:22 ` Maxime Ripard
2023-09-21 14:19 ` Maxime Ripard
2023-09-22 9:50 ` Javier Martinez Canillas
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=f5620d32-2705-498b-a65c-7dc663340a6d@suse.de \
--to=tzimmermann@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@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®