* [PATCH v7 1/9] drm/atomic: Allow userspace to use explicit sync with atomic async flips
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
@ 2024-06-18 3:00 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 2/9] drm: Support per-plane async flip configuration André Almeida
` (7 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
Allow userspace to use explicit synchronization with atomic async flips.
That means that the flip will wait for some hardware fence, and then
will flip as soon as possible (async) in regard of the vblank.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/drm_atomic_uapi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 22bbb2d83e30..2e1d9391febe 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1070,7 +1070,9 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
break;
}
- if (async_flip && prop != config->prop_fb_id) {
+ if (async_flip &&
+ prop != config->prop_fb_id &&
+ prop != config->prop_in_fence_fd) {
ret = drm_atomic_plane_get_property(plane, plane_state,
prop, &old_val);
ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 2/9] drm: Support per-plane async flip configuration
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration 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 ` André Almeida
2024-06-18 9:38 ` Jani Nikula
2024-06-18 3:00 ` [PATCH v7 3/9] drm/amdgpu: Enable async flips on the primary plane André Almeida
` (6 subsequent siblings)
8 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
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
+ */
+ bool async_flip;
};
#define obj_to_plane(x) container_of(x, struct drm_plane, base)
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
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
0 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2024-06-18 9:38 UTC (permalink / raw)
To: André Almeida, dri-devel, amd-gfx, linux-kernel,
linux-arm-kernel, nouveau, intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Rodrigo Vivi,
Boris Brezillon, Simon Ser, Xaver Hugl, daniel, alexander.deucher,
christian.koenig, Joshua Ashton
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.
BR,
Jani.
> + bool async_flip;
> };
>
> #define obj_to_plane(x) container_of(x, struct drm_plane, base)
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
2024-06-18 9:38 ` Jani Nikula
@ 2024-06-18 10:07 ` Dmitry Baryshkov
2024-06-18 16:18 ` André Almeida
0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-06-18 10:07 UTC (permalink / raw)
To: Jani Nikula
Cc: Alexandre Belloni, Marek Olšák, nouveau, dri-devel,
Xaver Hugl, Daniel Stone, Claudiu Beznea, Lyude Paul,
Sam Ravnborg, ville.syrjala, Karol Herbst, Michel Dänzer,
Dave Airlie, amd-gfx, André Almeida, kernel-dev, intel-gfx,
Maarten Lankhorst, Maxime Ripard, Melissa Wen, Pekka Paalanen,
Rodrigo Vivi, linux-arm-kernel, Thomas Zimmermann,
Boris Brezillon, Simon Ser, linux-kernel, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
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().
> > + bool async_flip;
> > };
> >
> > #define obj_to_plane(x) container_of(x, struct drm_plane, base)
>
> --
> Jani Nikula, Intel
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
2024-06-18 10:07 ` Dmitry Baryshkov
@ 2024-06-18 16:18 ` André Almeida
2024-06-18 17:43 ` Dmitry Baryshkov
0 siblings, 1 reply; 15+ messages in thread
From: André Almeida @ 2024-06-18 16:18 UTC (permalink / raw)
To: Dmitry Baryshkov, Jani Nikula
Cc: Alexandre Belloni, Marek Olšák, nouveau, dri-devel,
Xaver Hugl, Daniel Stone, Claudiu Beznea, Sam Ravnborg,
ville.syrjala, Karol Herbst, Michel Dänzer, Dave Airlie,
amd-gfx, Lyude Paul, kernel-dev, intel-gfx, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Rodrigo Vivi,
linux-arm-kernel, Thomas Zimmermann, Boris Brezillon, Simon Ser,
linux-kernel, daniel, alexander.deucher, christian.koenig,
Joshua Ashton
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.
*/
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
2024-06-18 16:18 ` André Almeida
@ 2024-06-18 17:43 ` Dmitry Baryshkov
2024-06-18 20:45 ` André Almeida
0 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2024-06-18 17:43 UTC (permalink / raw)
To: André Almeida
Cc: Alexandre Belloni, Marek Olšák, nouveau, dri-devel,
Xaver Hugl, Daniel Stone, Claudiu Beznea, Sam Ravnborg,
ville.syrjala, Karol Herbst, Michel Dänzer, Dave Airlie,
amd-gfx, Lyude Paul, kernel-dev, intel-gfx, Maarten Lankhorst,
Jani Nikula, Melissa Wen, Pekka Paalanen, Maxime Ripard,
Rodrigo Vivi, linux-arm-kernel, Thomas Zimmermann,
Boris Brezillon, Simon Ser, linux-kernel, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
On Tue, Jun 18, 2024 at 01:18:10PM GMT, André Almeida wrote:
> 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:
It looks like I keep on mixing async_flips as handled via the
DRM_MODE_PAGE_FLIP_ASYNC and the plane flips that are governed by
.atomic_async_check / .atomic_async_update / drm_atomic_helper_check()
and which end up being used just for legacy cursor updates.
So, yes, those are two different code paths, but with your changes I
think it becomes even easier to get confused between
atomic_async_check() and .async_flip member.
> /**
> * @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.
> */
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v7 2/9] drm: Support per-plane async flip configuration
2024-06-18 17:43 ` Dmitry Baryshkov
@ 2024-06-18 20:45 ` André Almeida
0 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 20:45 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Alexandre Belloni, Marek Olšák, nouveau, dri-devel,
Xaver Hugl, Daniel Stone, Claudiu Beznea, Sam Ravnborg,
ville.syrjala, Karol Herbst, Michel Dänzer, Dave Airlie,
amd-gfx, Lyude Paul, kernel-dev, intel-gfx, Maarten Lankhorst,
Jani Nikula, Melissa Wen, Pekka Paalanen, Maxime Ripard,
Rodrigo Vivi, linux-arm-kernel, Thomas Zimmermann,
Boris Brezillon, Simon Ser, linux-kernel, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
Em 18/06/2024 14:43, Dmitry Baryshkov escreveu:
> On Tue, Jun 18, 2024 at 01:18:10PM GMT, André Almeida wrote:
>> 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:
>
> It looks like I keep on mixing async_flips as handled via the
> DRM_MODE_PAGE_FLIP_ASYNC and the plane flips that are governed by
> .atomic_async_check / .atomic_async_update / drm_atomic_helper_check()
> and which end up being used just for legacy cursor updates.
>
> So, yes, those are two different code paths, but with your changes I
> think it becomes even easier to get confused between
> atomic_async_check() and .async_flip member.
>
I see, now that I read about atomic_async_check(), it got me confused as
well :)
I see that drivers define atomic_async_check() to tell DRM whether or
not such plane is able to do async flips... just like I'm trying to do
here. amdgpu implementation for that function is almost the opposite of
the restrictions that I've implemented in this patchset:
int amdgpu_dm_plane_atomic_async_check(...) {
/* Only support async updates on cursor planes. */
if (plane->type != DRM_PLANE_TYPE_CURSOR)
return -EINVAL;
return 0;
}
Anyway, I'll try to see if the legacy cursor path might be incorporated
somehow in the DRM_MODE_PAGE_FLIP_ASYNC path, or to come up with
something that makes them more distinguishable.
Thanks!
>
>> /**
>> * @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.
>> */
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v7 3/9] drm/amdgpu: Enable async flips on the primary plane
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration 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 3:00 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 4/9] drm: atmel-hlcdc: " André Almeida
` (5 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
This driver can perfom async flips on primary planes, so enable it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 8a4c40b4c27e..0c126c5609d3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1705,6 +1705,7 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
drm_plane_create_zpos_immutable_property(plane, 0);
+ plane->async_flip = true;
} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
unsigned int zpos = 1 + drm_plane_index(plane);
drm_plane_create_zpos_property(plane, zpos, 1, 254);
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 4/9] drm: atmel-hlcdc: Enable async flips on the primary plane
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (2 preceding siblings ...)
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 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 5/9] drm/i915: " André Almeida
` (4 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
This driver can perfom async flips on primary planes, so enable it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 4a7ba0918eca..22b8a5c888ef 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -1227,6 +1227,9 @@ static int atmel_hlcdc_plane_create(struct drm_device *dev,
if (ret)
return ret;
+ if (type == DRM_PLANE_TYPE_PRIMARY)
+ plane->base.async_flip = true;
+
drm_plane_helper_add(&plane->base,
&atmel_hlcdc_layer_plane_helper_funcs);
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 5/9] drm/i915: Enable async flips on the primary plane
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (3 preceding siblings ...)
2024-06-18 3:00 ` [PATCH v7 4/9] drm: atmel-hlcdc: " André Almeida
@ 2024-06-18 3:00 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 6/9] drm/nouveau: " André Almeida
` (3 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
This driver can perfom async flips on primary planes, so enable it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/i915/display/i9xx_plane.c | 3 +++
drivers/gpu/drm/i915/display/skl_universal_plane.c | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c
index 0279c8aabdd1..0142beef20dc 100644
--- a/drivers/gpu/drm/i915/display/i9xx_plane.c
+++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
@@ -931,6 +931,9 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
intel_plane_helper_add(plane);
+ if (plane->async_flip)
+ plane->base.async_flip = true;
+
return plane;
fail:
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 860574d04f88..8d0a9f69709a 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -2371,6 +2371,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
plane->async_flip = skl_plane_async_flip;
plane->enable_flip_done = skl_plane_enable_flip_done;
plane->disable_flip_done = skl_plane_disable_flip_done;
+ plane->base.async_flip = true;
}
if (DISPLAY_VER(dev_priv) >= 11)
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 6/9] drm/nouveau: Enable async flips on the primary plane
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (4 preceding siblings ...)
2024-06-18 3:00 ` [PATCH v7 5/9] drm/i915: " André Almeida
@ 2024-06-18 3:00 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 7/9] drm/vc4: " André Almeida
` (2 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
This driver can perfom async flips on primary planes, so enable it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++++
drivers/gpu/drm/nouveau/dispnv50/wndw.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
index 4310ad71870b..fd06d46d49ec 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c
@@ -1285,6 +1285,7 @@ int
nv04_crtc_create(struct drm_device *dev, int crtc_num)
{
struct nouveau_display *disp = nouveau_display(dev);
+ struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_crtc *nv_crtc;
struct drm_plane *primary;
int ret;
@@ -1338,6 +1339,9 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num)
if (ret)
return ret;
+ if (drm->client.device.info.chipset >= 0x11)
+ primary->async_flip = true;
+
return nvif_head_vblank_event_ctor(&nv_crtc->head, "kmsVbl", nv04_crtc_vblank_handler,
false, &nv_crtc->vblank);
}
diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
index 7a2cceaee6e9..55db0fdf61e7 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c
@@ -763,6 +763,10 @@ nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev,
return ret;
}
+ if (type == DRM_PLANE_TYPE_PRIMARY &&
+ drm->client.device.info.chipset >= 0x11)
+ wndw->plane.async_flip = true;
+
return 0;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 7/9] drm/vc4: Enable async flips on the primary plane
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (5 preceding siblings ...)
2024-06-18 3:00 ` [PATCH v7 6/9] drm/nouveau: " André Almeida
@ 2024-06-18 3:00 ` 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
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
This driver can perfom async flips on primary planes, so enable it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/vc4/vc4_plane.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 07caf2a47c6c..e3d41da14e6f 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1672,8 +1672,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
DRM_COLOR_YCBCR_BT709,
DRM_COLOR_YCBCR_LIMITED_RANGE);
- if (type == DRM_PLANE_TYPE_PRIMARY)
+ if (type == DRM_PLANE_TYPE_PRIMARY) {
drm_plane_create_zpos_immutable_property(plane, 0);
+ plane->async_flip = true;
+ }
return plane;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 8/9] drm: Enable per-plane async flip check
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (6 preceding siblings ...)
2024-06-18 3:00 ` [PATCH v7 7/9] drm/vc4: " André Almeida
@ 2024-06-18 3:00 ` André Almeida
2024-06-18 3:00 ` [PATCH v7 9/9] drm/amdgpu: Make it possible to async flip overlay planes André Almeida
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
Replace the generic "is this plane primary" for a plane::async_flip
check, so DRM follows the plane restrictions set by the driver.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/drm_atomic_uapi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 2e1d9391febe..ed1af3455477 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1079,9 +1079,9 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
break;
}
- if (async_flip && plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY) {
+ if (async_flip && !plane->async_flip) {
drm_dbg_atomic(prop->dev,
- "[OBJECT:%d] Only primary planes can be changed during async flip\n",
+ "[PLANE:%d] does not support async flips\n",
obj->id);
ret = -EINVAL;
break;
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v7 9/9] drm/amdgpu: Make it possible to async flip overlay planes
2024-06-18 3:00 [PATCH v7 0/9] drm: Support per-plane async flip configuration André Almeida
` (7 preceding siblings ...)
2024-06-18 3:00 ` [PATCH v7 8/9] drm: Enable per-plane async flip check André Almeida
@ 2024-06-18 3:00 ` André Almeida
8 siblings, 0 replies; 15+ messages in thread
From: André Almeida @ 2024-06-18 3:00 UTC (permalink / raw)
To: dri-devel, amd-gfx, linux-kernel, linux-arm-kernel, nouveau,
intel-gfx, Dmitry Baryshkov
Cc: Alexandre Belloni, 'Marek Olšák',
Claudiu Beznea, André Almeida, Sam Ravnborg, ville.syrjala,
Karol Herbst, Michel Dänzer, Dave Airlie, Daniel Stone,
kernel-dev, Lyude Paul, Thomas Zimmermann, Maarten Lankhorst,
Maxime Ripard, Melissa Wen, Pekka Paalanen, Jani Nikula,
Rodrigo Vivi, Boris Brezillon, Simon Ser, Xaver Hugl, daniel,
alexander.deucher, christian.koenig, Joshua Ashton
amdgpu can handle async flips on overlay planes, so mark it as true
during the plane initialization.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 0c126c5609d3..7d508d816f0d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1709,6 +1709,7 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
unsigned int zpos = 1 + drm_plane_index(plane);
drm_plane_create_zpos_property(plane, zpos, 1, 254);
+ plane->async_flip = true;
} else if (plane->type == DRM_PLANE_TYPE_CURSOR) {
drm_plane_create_zpos_immutable_property(plane, 255);
}
--
2.45.2
^ permalink raw reply related [flat|nested] 15+ messages in thread