Message ID | 20230914195138.1518065-1-javierm@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp702153vqi; Thu, 14 Sep 2023 17:03:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAvvpr8dsEuYpin2dcvvortmabMQDK9hkpWDeyu4lWKEF/F6T76ax1r2P1GsIMID/QD2Aw X-Received: by 2002:a05:6e02:1061:b0:34d:f1be:c3ea with SMTP id q1-20020a056e02106100b0034df1bec3eamr254706ilj.32.1694736215199; Thu, 14 Sep 2023 17:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694736215; cv=none; d=google.com; s=arc-20160816; b=niyDqj3FcsPcLMANKgWfJ8ShwlZb89+zEYXqN9Q/f+MV3xyhSggQC/cJAOLHz8djNc 4XIQTjSq3iQn4nNQPUbWKa9vbqubIO+yA3nortk/7jpgtFJrlB59H/uiyCEi+pxnjpBE Fj5MIN4pN/SZbN1TcbIfQM5wbRdfC2UCi5mj6QhfGNC0A+T9iF6F+TIYVg9PfCLaEHag TJ2NfXIxn78nLM2mjyIhFaLb99HAv4aBGZ8pUD6qF001oCh07Ak0yiIqzT4sywUn5KBw /Mm7n0ESJRcBmXqRuJrR/r50cU5I5ccpVCikbp0e2agDotvV2/MTfJcskacCx3dqskT1 0qQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=q/dj/LCR0O5gsD/qpCJOxuH/Z8gNXnmeWxnQEV1TNGA=; fh=1JWOhMF0PAMRNxU9JfchQ8oYxAUMwqW84XiG0MXZbDc=; b=la//F/s78CuqizwEBZe6sM4gVDN5/musCBKmzIcH+DqVpG5zim0g8mt2Co8V2ygKWz KK5RZ1Q0K8wNGIKQ9VkzgYBlmQoNyarEXky7AHPGDLLRduUPI4UtXl2qxBwZq+URnfjI G7nOcdnHKmCoCWbETeyA6IlT/+6VvWScfr9fJt0zmaee+AmF6ce6IHuL3yw0ooRiYU+l w8dxGdJnbEV0c3BTdkBl5lTPTh9kzjw34ycU48ExDUSAAcYDdf64g3QbsnJyqzbG3UH7 dn+QUx8hhMa09Rv8GJbUAF8c7aZD8RNh4cVHJshND1fpyI+6+6UBYOapWsnvXADb8Opp szDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzWrrJdj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m124-20020a632682000000b00565f8b22ca3si2158737pgm.38.2023.09.14.17.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 17:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzWrrJdj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4D05A8083AAE; Thu, 14 Sep 2023 12:53:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234631AbjINTxE (ORCPT <rfc822;pwkd43@gmail.com> + 33 others); Thu, 14 Sep 2023 15:53:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbjINTxB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 15:53:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8425026B8 for <linux-kernel@vger.kernel.org>; Thu, 14 Sep 2023 12:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694721124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=q/dj/LCR0O5gsD/qpCJOxuH/Z8gNXnmeWxnQEV1TNGA=; b=bzWrrJdjf+2Cq3L+1YMc4b4ZSmw6WTLvrmpbhOFEET/GL73xjVcxF9dhL8UP/OhfR73+FA t4Paw8+yK0p3ngPCWLDgtpUIllfiK9+Fvw0NQhwUdyQdanYWM0r3W4iaSGZxi4I8/UboyB H+TGXLdWvsJD/PplXp/j8WN6ljzU0NA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-58-k2ubRpcONDOW3GRtwcoqMA-1; Thu, 14 Sep 2023 15:52:03 -0400 X-MC-Unique: k2ubRpcONDOW3GRtwcoqMA-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-3f5df65fa35so10305245e9.3 for <linux-kernel@vger.kernel.org>; Thu, 14 Sep 2023 12:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694721122; x=1695325922; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q/dj/LCR0O5gsD/qpCJOxuH/Z8gNXnmeWxnQEV1TNGA=; b=PCSX77zp9cmFYfJeD11TFHrWK6XOI9eRnk9do4004AmpnQ2593Yp6U/QazUCCcFLVO ULpQO5bIWinYOJD0prUcGWofGeGNJjHlw9VEXPCpaAvOW5V3lUqffbTvlAzE6mP4ULQH +CnrPAZqzQpI8agmYydKgHHAXmfwLaI77Tk0VXyfQHc8mi1IeXCkoldF5reRjISXDJmS vjCf3+bM6svtx92fW2dMhjR1/+hoiDHFh0PPvB5PYlVbRaJp7cTviug6HjU301jUzPoM B6OhLXdUK6gn8jKX85AI08VswpO4L/BW1Hg4coHWJK5m+6Me/MlF0fxpQt7/YPTfJltY SZbg== X-Gm-Message-State: AOJu0Yw7dBkkgOoXfvW3CTMSe5ZkEbEElymtSSjyGYC7XGoz+pd3KTg+ G2zPDJJJ7E1Nf60i6cYQCo9aeFQsUSi1mKoDs9D7gBCOVsdjXT1p2Irdk3Qp2n1jg6HuLExu/m+ NzsyFzxNYtXsVXRxdcK7/SpjO7Tq0fpZGclx7M9jxOXXFgLablPsPD8TChVHGQtENXjv2f7pcLw vE/47v0Hw= X-Received: by 2002:a05:600c:2210:b0:401:bf56:8ba0 with SMTP id z16-20020a05600c221000b00401bf568ba0mr5485527wml.28.1694721121839; Thu, 14 Sep 2023 12:52:01 -0700 (PDT) X-Received: by 2002:a05:600c:2210:b0:401:bf56:8ba0 with SMTP id z16-20020a05600c221000b00401bf568ba0mr5485511wml.28.1694721121444; Thu, 14 Sep 2023 12:52:01 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id s23-20020a7bc397000000b00403bbe69629sm2773069wmj.31.2023.09.14.12.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 12:52:01 -0700 (PDT) From: Javier Martinez Canillas <javierm@redhat.com> To: linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Maxime Ripard <mripard@kernel.org>, Javier Martinez Canillas <javierm@redhat.com>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ssd130x: Drop _helper prefix from struct drm_*_helper_funcs callbacks Date: Thu, 14 Sep 2023 21:51:24 +0200 Message-ID: <20230914195138.1518065-1-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 12:53:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777059721657360015 X-GMAIL-MSGID: 1777059721657360015 |
Series |
drm/ssd130x: Drop _helper prefix from struct drm_*_helper_funcs callbacks
|
|
Commit Message
Javier Martinez Canillas
Sept. 14, 2023, 7:51 p.m. UTC
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.
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(-)
Comments
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)
Thomas Zimmermann <tzimmermann@suse.de> writes: > 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. > Yes, that's what tried to say in the commit message and indeed I got the convention from drivers in drivers/gpu/drm/tiny. In fact I believe these function names are since first iteration of the driver, when was meant to be a tiny driver. According to Maxime it's the exception rather than the rule and suggested to change it, I don't really have a strong opinion on either naming TBH. > Best regards > Thomas >
Hi, On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > 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. > > > > Yes, that's what tried to say in the commit message and indeed I got the > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > function names are since first iteration of the driver, when was meant to > be a tiny driver. > > According to Maxime it's the exception rather than the rule and suggested > to change it, I don't really have a strong opinion on either naming TBH. Maybe that's just me, but the helper in the name indeed throws me off. In my mind, it's supposed to be used only for helpers, not functions implementing the helpers hooks. Maxime
Hi Maxime, On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > 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. > > > > Yes, that's what tried to say in the commit message and indeed I got the > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > function names are since first iteration of the driver, when was meant to > > be a tiny driver. > > > > According to Maxime it's the exception rather than the rule and suggested > > to change it, I don't really have a strong opinion on either naming TBH. > > Maybe that's just me, but the helper in the name indeed throws me off. In my > mind, it's supposed to be used only for helpers, not functions implementing the > helpers hooks. With several callbacks using the same (field) name, it is very helpful to name the actual implementation by combining the struct type name and the field name. Anything else confuses the casual reader. Perhaps the real question is whether the structures should have "helper" in their name in the first place? Just my 2€c as a DRM novice... Gr{oetje,eeting}s, Geert
On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: > Hi Maxime, > > On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > > 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. > > > > > > Yes, that's what tried to say in the commit message and indeed I got the > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > > function names are since first iteration of the driver, when was meant to > > > be a tiny driver. > > > > > > According to Maxime it's the exception rather than the rule and suggested > > > to change it, I don't really have a strong opinion on either naming TBH. > > > > Maybe that's just me, but the helper in the name indeed throws me off. In my > > mind, it's supposed to be used only for helpers, not functions implementing the > > helpers hooks. > > With several callbacks using the same (field) name, it is very helpful > to name the actual implementation by combining the struct type name > and the field name. I can't think of any (at least for a given object). Which one do you have in mind? > Anything else confuses the casual reader. Perhaps the real question is whether > the structures should have "helper" in their name in the first place? Those structures are meant for functions used by the helpers, they are not helper functions. Maxime
Geert Uytterhoeven <geert@linux-m68k.org> writes: Hello Geert and Maxime, > Hi Maxime, > > On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: >> On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: >> > Thomas Zimmermann <tzimmermann@suse.de> writes: >> > > 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. >> > >> > Yes, that's what tried to say in the commit message and indeed I got the >> > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these >> > function names are since first iteration of the driver, when was meant to >> > be a tiny driver. >> > >> > According to Maxime it's the exception rather than the rule and suggested >> > to change it, I don't really have a strong opinion on either naming TBH. >> >> Maybe that's just me, but the helper in the name indeed throws me off. In my >> mind, it's supposed to be used only for helpers, not functions implementing the >> helpers hooks. I agree with your definition of helpers. But more importantly for me is what you mentioned, that most DRM drivers aren't using this convention of concatenating the driver name + struct type name + callback name. > > With several callbacks using the same (field) name, it is very helpful > to name the actual implementation by combining the struct type name > and the field name. Anything else confuses the casual reader. Both options have cons and pros (e.g: quickly figuring out to what struct callback is associated as you said), but the reason I posted this patch is to attempt making the driver more consistent with the rest of the drivers. > Perhaps the real question is whether the structures should have "helper" > in their name in the first place? > Indeed. I never fully understood why the DRM/KMS objects callbacks are split in drm_$object_funcs and drm_$object_helper_funcs structs. AFAIU is because the former is the minimum required and the latter is to add additional custom behavior ? I read this section of the documentation but still isn't clear to me: https://dri.freedesktop.org/docs/drm/gpu/drm-kms-helpers.html > Just my 2€c as a DRM novice... >
Maxime Ripard <mripard@kernel.org> writes: > On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: [...] >> Anything else confuses the casual reader. Perhaps the real question is whether >> the structures should have "helper" in their name in the first place? > > Those structures are meant for functions used by the helpers, they are not > helper functions. > Ah, that makes more sense. I wasn't aware of that. If that's the case, then the split makes more sense to me now. > Maxime
Hi Am 21.09.23 um 10:23 schrieb Javier Martinez Canillas: [...] > > Both options have cons and pros (e.g: quickly figuring out to what struct > callback is associated as you said), but the reason I posted this patch is > to attempt making the driver more consistent with the rest of the drivers. > >> Perhaps the real question is whether the structures should have "helper" >> in their name in the first place? >> > > Indeed. I never fully understood why the DRM/KMS objects callbacks are > split in drm_$object_funcs and drm_$object_helper_funcs structs. AFAIU > is because the former is the minimum required and the latter is to add > additional custom behavior ? The drm_<object>_funcs is an interface that is being called from DRM userspace/clients/ioctls. It's the interface that we present to the outside world. Implement them in each hardware's driver. But most graphics hardware is similar to each other. The differences are in the way how things are done, but not so much what is being done. Hence, a good number of drm_$object_funcs can be provided in hardware-independent helpers. drm_object_helper_funcs are callback for these helpers. In the places where the helpers need the driver to do something with the hardware, they refer to _helper_funcs. IIRC, there are a few outliers, but that's the overall idea. Best regards Thomas > > I read this section of the documentation but still isn't clear to me: > > https://dri.freedesktop.org/docs/drm/gpu/drm-kms-helpers.html > >> Just my 2€c as a DRM novice... >> > -- 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)
Hi Maxime, On Thu, Sep 21, 2023 at 10:12 AM Maxime Ripard <mripard@kernel.org> wrote: > On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: > > On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: > > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > > > 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. > > > > > > > > Yes, that's what tried to say in the commit message and indeed I got the > > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > > > function names are since first iteration of the driver, when was meant to > > > > be a tiny driver. > > > > > > > > According to Maxime it's the exception rather than the rule and suggested > > > > to change it, I don't really have a strong opinion on either naming TBH. > > > > > > Maybe that's just me, but the helper in the name indeed throws me off. In my > > > mind, it's supposed to be used only for helpers, not functions implementing the > > > helpers hooks. > > > > With several callbacks using the same (field) name, it is very helpful > > to name the actual implementation by combining the struct type name > > and the field name. > > I can't think of any (at least for a given object). Which one do you have in > mind? E.g. atomic_check(): drm_crtc_helper_funcs.atomic_check() drm_encoder_helper_funcs.atomic_check() drm_connector_helper_funcs.atomic_check() drm_plane_helper_funcs.atomic_check() Interestingly, drm_mode_config_helper_funcs does not have an atomic_check() callback, but drm_mode_config_funcs has. > > Anything else confuses the casual reader. Perhaps the real question is whether > > the structures should have "helper" in their name in the first place? > > Those structures are meant for functions used by the helpers, they are not > helper functions. That might be how they started, but to me it looks like all these helpers are no longer helpers, but part of the core... Gr{oetje,eeting}s, Geert
On Thu, Sep 21, 2023 at 10:46:05AM +0200, Geert Uytterhoeven wrote: > On Thu, Sep 21, 2023 at 10:12 AM Maxime Ripard <mripard@kernel.org> wrote: > > On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: > > > On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: > > > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > > > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > > > > 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. > > > > > > > > > > Yes, that's what tried to say in the commit message and indeed I got the > > > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > > > > function names are since first iteration of the driver, when was meant to > > > > > be a tiny driver. > > > > > > > > > > According to Maxime it's the exception rather than the rule and suggested > > > > > to change it, I don't really have a strong opinion on either naming TBH. > > > > > > > > Maybe that's just me, but the helper in the name indeed throws me off. In my > > > > mind, it's supposed to be used only for helpers, not functions implementing the > > > > helpers hooks. > > > > > > With several callbacks using the same (field) name, it is very helpful > > > to name the actual implementation by combining the struct type name > > > and the field name. > > > > I can't think of any (at least for a given object). Which one do you have in > > mind? > > E.g. atomic_check(): > > drm_crtc_helper_funcs.atomic_check() > drm_encoder_helper_funcs.atomic_check() > drm_connector_helper_funcs.atomic_check() > drm_plane_helper_funcs.atomic_check() Right, but that's between objects, not between drm_$OBJECT_funcs and drm_$OBJECT_helper_funcs. So conflicts for a single given driver is unlikely, and can be solved by using, say, $DRIVER_crtc_atomic_check and $DRIVER_plane_atomic_check. > Interestingly, drm_mode_config_helper_funcs does not have an > atomic_check() callback, but drm_mode_config_funcs has. > > > > Anything else confuses the casual reader. Perhaps the real question is whether > > > the structures should have "helper" in their name in the first place? > > > > Those structures are meant for functions used by the helpers, they are not > > helper functions. > > That might be how they started, but to me it looks like all these helpers > are no longer helpers, but part of the core... They are part of the core, but very much optional still. i915 doesn't use a lot of helpers, vc4 (used to?) rolls its own atomic_commit implementation, etc. It's really not uncommon. Maxime
Hi Am 21.09.23 um 09:44 schrieb Maxime Ripard: > Hi, > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: >> Thomas Zimmermann <tzimmermann@suse.de> writes: >> >>> 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. >>> >> >> Yes, that's what tried to say in the commit message and indeed I got the >> convention from drivers in drivers/gpu/drm/tiny. In fact I believe these >> function names are since first iteration of the driver, when was meant to >> be a tiny driver. >> >> According to Maxime it's the exception rather than the rule and suggested >> to change it, I don't really have a strong opinion on either naming TBH. > > Maybe that's just me, but the helper in the name indeed throws me off. In my > mind, it's supposed to be used only for helpers, not functions implementing the > helpers hooks. Tying the function name to its _funcs structure makes perfect sense to me, as it helps to structure the driver code. So I always use the _helper_ infix. In contrast, the DRM helpers that implement certain functionality does not seem to follow any naming scheme. For example drm_atomic_helper_check() implements struct drm_mode_config_funcs.atomic_check. To me, it's not obvious that these two belong together. And in the same structure, there's fb_create, which is provided by drm_gem_fb_create_with_dirty(). This one doesn't even mention that it's a helper. Best regards Thomas > > Maxime -- 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)
Hi Am 21.09.23 um 10:46 schrieb Geert Uytterhoeven: [...] > >>> Anything else confuses the casual reader. Perhaps the real question is whether >>> the structures should have "helper" in their name in the first place? >> >> Those structures are meant for functions used by the helpers, they are not >> helper functions. > > That might be how they started, but to me it looks like all these helpers > are no longer helpers, but part of the core... They are in library modules. You can write a DRM driver without _helper_funcs, see i915. It's just a really hard sell to upstream nowadays. Best regards Thomas > > 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)
Hi Maxime, On Thu, Sep 21, 2023 at 10:51 AM Maxime Ripard <mripard@kernel.org> wrote: > On Thu, Sep 21, 2023 at 10:46:05AM +0200, Geert Uytterhoeven wrote: > > On Thu, Sep 21, 2023 at 10:12 AM Maxime Ripard <mripard@kernel.org> wrote: > > > On Thu, Sep 21, 2023 at 09:57:22AM +0200, Geert Uytterhoeven wrote: > > > > On Thu, Sep 21, 2023 at 9:44 AM Maxime Ripard <mripard@kernel.org> wrote: > > > > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > > > > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > > > > > 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. > > > > > > > > > > > > Yes, that's what tried to say in the commit message and indeed I got the > > > > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > > > > > function names are since first iteration of the driver, when was meant to > > > > > > be a tiny driver. > > > > > > > > > > > > According to Maxime it's the exception rather than the rule and suggested > > > > > > to change it, I don't really have a strong opinion on either naming TBH. > > > > > > > > > > Maybe that's just me, but the helper in the name indeed throws me off. In my > > > > > mind, it's supposed to be used only for helpers, not functions implementing the > > > > > helpers hooks. > > > > > > > > With several callbacks using the same (field) name, it is very helpful > > > > to name the actual implementation by combining the struct type name > > > > and the field name. > > > > > > I can't think of any (at least for a given object). Which one do you have in > > > mind? > > > > E.g. atomic_check(): > > > > drm_crtc_helper_funcs.atomic_check() > > drm_encoder_helper_funcs.atomic_check() > > drm_connector_helper_funcs.atomic_check() > > drm_plane_helper_funcs.atomic_check() > > Right, but that's between objects, not between drm_$OBJECT_funcs and > drm_$OBJECT_helper_funcs. So conflicts for a single given driver is unlikely, > and can be solved by using, say, $DRIVER_crtc_atomic_check and > $DRIVER_plane_atomic_check. IC. There are indeed no such conflicts (except between drm_encoder_slave_funcs and drm_encoder_helper_funcs, which I guess doesn't count). Thanks, this helps a lot to explain why there is no need to have "helper" in the name of the callbacks. Gr{oetje,eeting}s, Geert
Hi, On Thu, Sep 21, 2023 at 10:52:14AM +0200, Thomas Zimmermann wrote: > Am 21.09.23 um 09:44 schrieb Maxime Ripard: > > On Mon, Sep 18, 2023 at 09:19:07AM +0200, Javier Martinez Canillas wrote: > > > Thomas Zimmermann <tzimmermann@suse.de> writes: > > > > > > > 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. > > > > > > > > > > Yes, that's what tried to say in the commit message and indeed I got the > > > convention from drivers in drivers/gpu/drm/tiny. In fact I believe these > > > function names are since first iteration of the driver, when was meant to > > > be a tiny driver. > > > > > > According to Maxime it's the exception rather than the rule and suggested > > > to change it, I don't really have a strong opinion on either naming TBH. > > > > Maybe that's just me, but the helper in the name indeed throws me off. In my > > mind, it's supposed to be used only for helpers, not functions implementing the > > helpers hooks. > > Tying the function name to its _funcs structure makes perfect sense to me, > as it helps to structure the driver code. So I always use the _helper_ > infix. > > In contrast, the DRM helpers that implement certain functionality does not > seem to follow any naming scheme. For example drm_atomic_helper_check() > implements struct drm_mode_config_funcs.atomic_check. To me, it's not > obvious that these two belong together. Right, but then we end up with functions that have helpers in their name and are indeed helpers, and then we have functions that have helpers in their name but are not meant to help anyone or be reused anywhere else. > And in the same structure, there's fb_create, which is provided by > drm_gem_fb_create_with_dirty(). This one doesn't even mention that > it's a helper. We should fix that then I guess? Anyway, we're way past bikeshedding there :) Maxime
On Thu, 14 Sep 2023 21:51:24 +0200, Javier Martinez Canillas wrote: > 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 > > [ ... ] Reviewed-by: Maxime Ripard <mripard@kernel.org> Thanks! Maxime
"Maxime Ripard" <mripard@kernel.org> writes: > On Thu, 14 Sep 2023 21:51:24 +0200, Javier Martinez Canillas wrote: >> 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 >> >> [ ... ] > > Reviewed-by: Maxime Ripard <mripard@kernel.org> > Pushed to drm-misc (drm-misc-next). Thanks!
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 = {