mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "André Almeida" <andrealmeid@igalia.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Jani Nikula <jani.nikula@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	kernel-dev@igalia.com, "Melissa Wen" <mwen@igalia.com>,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	"Simon Ser" <contact@emersion.fr>,
	"Pekka Paalanen" <ppaalanen@gmail.com>,
	daniel@ffwll.ch, "Daniel Stone" <daniel@fooishbar.org>,
	"Marek Olšák" <maraeo@gmail.com>,
	"Dave Airlie" <airlied@gmail.com>,
	ville.syrjala@linux.intel.com,
	"Xaver Hugl" <xaver.hugl@gmail.com>,
	"Joshua Ashton" <joshua@froggi.es>,
	"Michel Dänzer" <michel.daenzer@mailbox.org>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Boris Brezillon" <bbrezillon@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Karol Herbst" <kherbst@redhat.com>,
	"Lyude Paul" <lyude@redhat.com>
Subject: Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
Date: Tue, 18 Jun 2024 13:18:10 -0300	[thread overview]
Message-ID: <fc67b552-6f61-4f30-9e34-dd6b2364d155@igalia.com> (raw)
In-Reply-To: <CAA8EJpqM4iaG3PKM5c0Op7Y7c1SRDrOCk_oOnwG8YfdCxC8w6g@mail.gmail.com>

Em 18/06/2024 07:07, Dmitry Baryshkov escreveu:
> On Tue, 18 Jun 2024 at 12:38, Jani Nikula <jani.nikula@linux.intel.com> wrote:
>>
>> On Tue, 18 Jun 2024, André Almeida <andrealmeid@igalia.com> wrote:
>>> Drivers have different capabilities on what plane types they can or
>>> cannot perform async flips. Create a plane::async_flip field so each
>>> driver can choose which planes they allow doing async flips.
>>>
>>> Signed-off-by: André Almeida <andrealmeid@igalia.com>
>>> ---
>>>   include/drm/drm_plane.h | 5 +++++
>>>   1 file changed, 5 insertions(+)
>>>
>>> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
>>> index 9507542121fa..0bebc72af5c3 100644
>>> --- a/include/drm/drm_plane.h
>>> +++ b/include/drm/drm_plane.h
>>> @@ -786,6 +786,11 @@ struct drm_plane {
>>>         * @kmsg_panic: Used to register a panic notifier for this plane
>>>         */
>>>        struct kmsg_dumper kmsg_panic;
>>> +
>>> +     /**
>>> +      * @async_flip: indicates if a plane can do async flips
>>> +      */
>>
>> When is it okay to set or change the value of this member?
>>
>> If you don't document it, people will find creative uses for this.
> 
> Maybe it's better to have a callback instead of a static field? This
> way it becomes clear that it's only relevant at the time of the
> atomic_check().
> 

So we would have something like bool (*async_flip) for struct 
drm_plane_funcs I suppose. Then each driver will implement this function 
and check on runtime if it should flip or not, right?

I agree that it makes more clear, but as far as I can see this is not 
something that is subject to being changed at runtime at all, so it 
seems a bit overkill to me to encapsulate a static information like 
that. I prefer to improve the documentation on the struct member to see 
if this solves the problem. What do you think of the following comment:

/**
  * @async_flip: indicates if a plane can perform async flips. The
  * driver should set this true only for planes that the hardware
  * supports flipping asynchronously. It may not be changed during
  * runtime. This field is checked inside drm_mode_atomic_ioctl() to
  * allow only the correct planes to go with DRM_MODE_PAGE_FLIP_ASYNC.
  */

  reply	other threads:[~2024-06-18 16:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  3:00 [PATCH v7 0/9] " André Almeida
2024-06-18  3:00 ` [PATCH v7 1/9] drm/atomic: Allow userspace to use explicit sync with atomic async flips André Almeida
2024-06-18  3:00 ` [PATCH v7 2/9] drm: Support per-plane async flip configuration André Almeida
2024-06-18  9:38   ` Jani Nikula
2024-06-18 10:07     ` Dmitry Baryshkov
2024-06-18 16:18       ` André Almeida [this message]
2024-06-18 17:43         ` Dmitry Baryshkov
2024-06-18 20:45           ` André Almeida
2024-06-18  3:00 ` [PATCH v7 3/9] drm/amdgpu: Enable async flips on the primary plane André Almeida
2024-06-18  3:00 ` [PATCH v7 4/9] drm: atmel-hlcdc: " André Almeida
2024-06-18  3:00 ` [PATCH v7 5/9] drm/i915: " André Almeida
2024-06-18  3:00 ` [PATCH v7 6/9] drm/nouveau: " André Almeida
2024-06-18  3:00 ` [PATCH v7 7/9] drm/vc4: " André Almeida
2024-06-18  3:00 ` [PATCH v7 8/9] drm: Enable per-plane async flip check André Almeida
2024-06-18  3:00 ` [PATCH v7 9/9] drm/amdgpu: Make it possible to async flip overlay planes André Almeida

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=fc67b552-6f61-4f30-9e34-dd6b2364d155@igalia.com \
    --to=andrealmeid@igalia.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bbrezillon@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joshua@froggi.es \
    --cc=kernel-dev@igalia.com \
    --cc=kherbst@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maraeo@gmail.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ppaalanen@gmail.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    --cc=xaver.hugl@gmail.com \
    /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®