From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Thomas Zimmermann <tzimmermann@suse.de>,
mripard@kernel.org, maarten.lankhorst@linux.intel.com,
daniel@ffwll.ch, airlied@gmail.com
Cc: amd-gfx@lists.freedesktop.org, javierm@redhat.com,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org,
laurent.pinchart@ideasonboard.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [1/8] drm/plane-helper: Move drm_plane_helper_atomic_check() into udl
Date: Fri, 1 Dec 2023 21:57:26 +0800 [thread overview]
Message-ID: <af7717b2-cd10-491f-99c1-285016fabf84@linux.dev> (raw)
In-Reply-To: <038bc33b-1bc9-4dbc-bea3-d17a3d37abf0@suse.de>
Hi,
On 2023/12/1 16:22, Thomas Zimmermann wrote:
> Hi
>
> Am 01.12.23 um 03:36 schrieb Sui Jingfeng:
>> Hi,
>>
>>
>> On 2023/11/28 18:45, Thomas Zimmermann wrote:
>>> The udl driver is the only caller of drm_plane_helper_atomic_check().
>>> Move the function into the driver. No functional changes.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> ---
>>> drivers/gpu/drm/drm_plane_helper.c | 32
>>> ------------------------------
>>> drivers/gpu/drm/udl/udl_modeset.c | 19 ++++++++++++++++--
>>> include/drm/drm_plane_helper.h | 2 --
>>> 3 files changed, 17 insertions(+), 36 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_plane_helper.c
>>> b/drivers/gpu/drm/drm_plane_helper.c
>>> index 5e95089676ff8..7982be4b0306d 100644
>>> --- a/drivers/gpu/drm/drm_plane_helper.c
>>> +++ b/drivers/gpu/drm/drm_plane_helper.c
>>> @@ -279,35 +279,3 @@ void drm_plane_helper_destroy(struct drm_plane
>>> *plane)
>>> kfree(plane);
>>> }
>>> EXPORT_SYMBOL(drm_plane_helper_destroy);
>>> -
>>> -/**
>>> - * drm_plane_helper_atomic_check() - Helper to check plane
>>> atomic-state
>>> - * @plane: plane to check
>>> - * @state: atomic state object
>>> - *
>>> - * Provides a default plane-state check handler for planes whose
>>> atomic-state
>>> - * scale and positioning are not expected to change since the plane
>>> is always
>>> - * a fullscreen scanout buffer.
>>> - *
>>> - * This is often the case for the primary plane of simple
>>> framebuffers. See
>>> - * also drm_crtc_helper_atomic_check() for the respective
>>> CRTC-state check
>>> - * helper function.
>>> - *
>>> - * RETURNS:
>>> - * Zero on success, or an errno code otherwise.
>>> - */
>>> -int drm_plane_helper_atomic_check(struct drm_plane *plane, struct
>>> drm_atomic_state *state)
>>> -{
>>> - struct drm_plane_state *new_plane_state =
>>> drm_atomic_get_new_plane_state(state, plane);
>>> - struct drm_crtc *new_crtc = new_plane_state->crtc;
>>> - struct drm_crtc_state *new_crtc_state = NULL;
>>> -
>>> - if (new_crtc)
>>> - new_crtc_state = drm_atomic_get_new_crtc_state(state,
>>> new_crtc);
>>> -
>>> - return drm_atomic_helper_check_plane_state(new_plane_state,
>>> new_crtc_state,
>>> - DRM_PLANE_NO_SCALING,
>>> - DRM_PLANE_NO_SCALING,
>>> - false, false);
>>> -}
>>> -EXPORT_SYMBOL(drm_plane_helper_atomic_check);
>>
>>
>> Since this function is removed, does the comments of the
>> drm_crtc_helper_atomic_check()
>> function (in the drm_crtc_helper.c) need to update as well? I'm ask
>> because I see the
>> comments of the drm_crtc_helper_atomic_check() still referencing this
>> function.
>
> Good point. I'll update that comment. Thanks for reviewing.
>
OK, with this trivial problem solved:
Acked-by: Sui Jingfeng <suijingfeng@loongson.cn>
> Best regards
> Thomas
>
>>
>>
>>> diff --git a/drivers/gpu/drm/udl/udl_modeset.c
>>> b/drivers/gpu/drm/udl/udl_modeset.c
>>> index 40876bcdd79a4..7702359c90c22 100644
>>> --- a/drivers/gpu/drm/udl/udl_modeset.c
>>> +++ b/drivers/gpu/drm/udl/udl_modeset.c
>>> @@ -21,7 +21,6 @@
>>> #include <drm/drm_gem_framebuffer_helper.h>
>>> #include <drm/drm_gem_shmem_helper.h>
>>> #include <drm/drm_modeset_helper_vtables.h>
>>> -#include <drm/drm_plane_helper.h>
>>> #include <drm/drm_probe_helper.h>
>>> #include <drm/drm_vblank.h>
>>> @@ -261,6 +260,22 @@ static const uint64_t
>>> udl_primary_plane_fmtmods[] = {
>>> DRM_FORMAT_MOD_INVALID
>>> };
>>> +static int udl_primary_plane_helper_atomic_check(struct drm_plane
>>> *plane,
>>> + struct drm_atomic_state *state)
>>> +{
>>> + struct drm_plane_state *new_plane_state =
>>> drm_atomic_get_new_plane_state(state, plane);
>>> + struct drm_crtc *new_crtc = new_plane_state->crtc;
>>> + struct drm_crtc_state *new_crtc_state = NULL;
>>> +
>>> + if (new_crtc)
>>> + new_crtc_state = drm_atomic_get_new_crtc_state(state,
>>> new_crtc);
>>> +
>>> + return drm_atomic_helper_check_plane_state(new_plane_state,
>>> new_crtc_state,
>>> + DRM_PLANE_NO_SCALING,
>>> + DRM_PLANE_NO_SCALING,
>>> + false, false);
>>> +}
>>> +
>>> static void udl_primary_plane_helper_atomic_update(struct
>>> drm_plane *plane,
>>> struct drm_atomic_state *state)
>>> {
>>> @@ -296,7 +311,7 @@ static void
>>> udl_primary_plane_helper_atomic_update(struct drm_plane *plane,
>>> static const struct drm_plane_helper_funcs
>>> udl_primary_plane_helper_funcs = {
>>> DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
>>> - .atomic_check = drm_plane_helper_atomic_check,
>>> + .atomic_check = udl_primary_plane_helper_atomic_check,
>>> .atomic_update = udl_primary_plane_helper_atomic_update,
>>> };
>>> diff --git a/include/drm/drm_plane_helper.h
>>> b/include/drm/drm_plane_helper.h
>>> index 3a574e8cd22f4..75f9c4830564a 100644
>>> --- a/include/drm/drm_plane_helper.h
>>> +++ b/include/drm/drm_plane_helper.h
>>> @@ -26,7 +26,6 @@
>>> #include <linux/types.h>
>>> -struct drm_atomic_state;
>>> struct drm_crtc;
>>> struct drm_framebuffer;
>>> struct drm_modeset_acquire_ctx;
>>> @@ -42,7 +41,6 @@ int drm_plane_helper_update_primary(struct
>>> drm_plane *plane, struct drm_crtc *cr
>>> int drm_plane_helper_disable_primary(struct drm_plane *plane,
>>> struct drm_modeset_acquire_ctx *ctx);
>>> void drm_plane_helper_destroy(struct drm_plane *plane);
>>> -int drm_plane_helper_atomic_check(struct drm_plane *plane, struct
>>> drm_atomic_state *state);
>>> /**
>>> * DRM_PLANE_NON_ATOMIC_FUNCS - Default plane functions for
>>> non-atomic drivers
>
next prev parent reply other threads:[~2023-12-01 13:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 10:45 [PATCH 0/8] drm/plane-helpers: Minor clean ups Thomas Zimmermann
2023-11-28 10:45 ` [PATCH 1/8] drm/plane-helper: Move drm_plane_helper_atomic_check() into udl Thomas Zimmermann
2023-12-01 2:36 ` [1/8] " Sui Jingfeng
2023-12-01 8:22 ` Thomas Zimmermann
2023-12-01 13:57 ` Sui Jingfeng [this message]
2023-11-28 10:45 ` [PATCH 2/8] drm/amdgpu: Do not include <drm/drm_plane_helper.h> Thomas Zimmermann
2023-11-28 10:45 ` [PATCH 3/8] drm/loongson: " Thomas Zimmermann
2023-11-28 11:37 ` [3/8] " Sui Jingfeng
2023-11-28 10:45 ` [PATCH 4/8] drm/shmobile: " Thomas Zimmermann
2023-11-28 13:16 ` Geert Uytterhoeven
2023-11-28 10:45 ` [PATCH 5/8] drm/solomon: " Thomas Zimmermann
2023-11-28 13:16 ` Geert Uytterhoeven
2023-12-01 8:42 ` Javier Martinez Canillas
2023-11-28 10:45 ` [PATCH 6/8] drm/ofdrm: " Thomas Zimmermann
2023-11-28 12:01 ` [6/8] " Sui Jingfeng
2023-11-28 10:45 ` [PATCH 7/8] drm/simpledrm: " Thomas Zimmermann
2023-11-28 11:47 ` [7/8] " Sui Jingfeng
2023-11-28 10:45 ` [PATCH 8/8] drm/xlnx: " Thomas Zimmermann
2023-11-28 11:02 ` Laurent Pinchart
2023-11-28 14:13 ` Thomas Zimmermann
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=af7717b2-cd10-491f-99c1-285016fabf84@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=airlied@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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