* [PATCH v12 0/2] drm/atomic: Ease async flip restrictions
@ 2025-01-27 19:59 André Almeida
2025-01-27 19:59 ` [PATCH v12 1/2] drm/atomic: Let drivers decide which planes to async flip André Almeida
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: André Almeida @ 2025-01-27 19:59 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Xaver Hugl, Daniel Stone,
ville.syrjala
Cc: kernel-dev, dri-devel, linux-kernel, amd-gfx, André Almeida,
Christopher Snowhill
Hi,
The goal of this work is to find a nice way to allow amdgpu to perform
async page flips in the overlay plane as well, not only on the primary
one. Currently, when using the atomic uAPI, this is the only type of
plane allowed to do async flips, and every driver accepts it.
This patchset re-uses the per-plane function atomic_async_check() to
this purpose, so drivers can allow different plane types. There's a
`bool flip` parameter so the atomic_async_check() can do different
decisions if it's a complete page flip or a plane update.
igt test: https://lore.kernel.org/igt-dev/20241216202427.76168-1-andrealmeid@igalia.com/
Changelog
v12:
- Rebased on top of drm-next (for 6.14)
v11: https://lore.kernel.org/r/20241212-tonyk-async_flip-v11-0-14379434be70@igalia.com
- Fix changelog
- Add R-b and T-b tags
v10: https://lore.kernel.org/all/20241211-tonyk-async_flip-v10-0-6b1ff04847c2@igalia.com/
- Add a 'flip' flag to indicate where the atomic_async_check() is being called from.
v9: https://lore.kernel.org/all/20241101-tonyk-async_flip-v9-0-681814efbfbe@igalia.com/
- Rebased on top of 6.12-rc1 (drm/drm-next)
v8: https://lore.kernel.org/lkml/20240806135300.114469-1-andrealmeid@igalia.com/
- Complete rewrite
---
André Almeida (2):
drm/atomic: Let drivers decide which planes to async flip
drm/amdgpu: Enable async flip on overlay planes
.../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 +++---
drivers/gpu/drm/drm_atomic_helper.c | 2 +-
drivers/gpu/drm/drm_atomic_uapi.c | 37 ++++++++++++++++------
drivers/gpu/drm/loongson/lsdc_plane.c | 3 +-
drivers/gpu/drm/mediatek/mtk_plane.c | 2 +-
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +-
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
drivers/gpu/drm/tegra/dc.c | 3 +-
drivers/gpu/drm/vc4/vc4_plane.c | 2 +-
include/drm/drm_modeset_helper_vtables.h | 7 +++-
10 files changed, 48 insertions(+), 22 deletions(-)
---
base-commit: 64179a1416e1420a34226ab3beb5f84710953d16
change-id: 20241002-tonyk-async_flip-828cfe9cf3ca
Best regards,
--
André Almeida <andrealmeid@igalia.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v12 1/2] drm/atomic: Let drivers decide which planes to async flip
2025-01-27 19:59 [PATCH v12 0/2] drm/atomic: Ease async flip restrictions André Almeida
@ 2025-01-27 19:59 ` André Almeida
2025-01-27 19:59 ` [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
2025-02-13 22:55 ` [PATCH v12 0/2] drm/atomic: Ease async flip restrictions Dmitry Baryshkov
2 siblings, 0 replies; 9+ messages in thread
From: André Almeida @ 2025-01-27 19:59 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Xaver Hugl, Daniel Stone,
ville.syrjala
Cc: kernel-dev, dri-devel, linux-kernel, amd-gfx, André Almeida,
Christopher Snowhill
Currently, DRM atomic uAPI allows only primary planes to be flipped
asynchronously. However, each driver might be able to perform async
flips in other different plane types. To enable drivers to set their own
restrictions on which type of plane they can or cannot flip, use the
existing atomic_async_check() from struct drm_plane_helper_funcs to
enhance this flexibility, thus allowing different plane types to be able
to do async flips as well.
Create a new parameter for the atomic_async_check(), `bool flip`. This
parameter is used to distinguish when this function is being called from
a plane update from a full page flip.
In order to prevent regressions and such, we keep the current policy: we
skip the driver check for the primary plane, because it is always
allowed to do async flips on it.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Christopher Snowhill <chris@kode54.net>
Tested-by: Christopher Snowhill <chris@kode54.net> (Radeon RX 7700 XT)
---
drivers/gpu/drm/drm_atomic_helper.c | 2 +-
drivers/gpu/drm/drm_atomic_uapi.c | 37 +++++++++++++++++++++--------
drivers/gpu/drm/loongson/lsdc_plane.c | 3 ++-
drivers/gpu/drm/mediatek/mtk_plane.c | 2 +-
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 2 +-
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
drivers/gpu/drm/tegra/dc.c | 3 ++-
drivers/gpu/drm/vc4/vc4_plane.c | 2 +-
include/drm/drm_modeset_helper_vtables.h | 7 +++++-
9 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5186d2114a503701e228e382cc45180b0c578d0c..8a5d62c3faecfd764fd485434858fa3933104918 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1928,7 +1928,7 @@ int drm_atomic_helper_async_check(struct drm_device *dev,
return -EBUSY;
}
- ret = funcs->atomic_async_check(plane, state);
+ ret = funcs->atomic_async_check(plane, state, false);
if (ret != 0)
drm_dbg_atomic(dev,
"[PLANE:%d:%s] driver async check failed\n",
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index 370dc676e3aa543c9827b50df20df78f02b738c9..2765ba90ad8faec6f1c1db112ef667e794d465c2 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -27,8 +27,9 @@
* Daniel Vetter <daniel.vetter@ffwll.ch>
*/
-#include <drm/drm_atomic_uapi.h>
#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_atomic_uapi.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_print.h>
#include <drm/drm_drv.h>
@@ -1063,6 +1064,7 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
struct drm_plane *plane = obj_to_plane(obj);
struct drm_plane_state *plane_state;
struct drm_mode_config *config = &plane->dev->mode_config;
+ const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
plane_state = drm_atomic_get_plane_state(state, plane);
if (IS_ERR(plane_state)) {
@@ -1070,15 +1072,30 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
break;
}
- if (async_flip &&
- (plane_state->plane->type != DRM_PLANE_TYPE_PRIMARY ||
- (prop != config->prop_fb_id &&
- prop != config->prop_in_fence_fd &&
- prop != config->prop_fb_damage_clips))) {
- ret = drm_atomic_plane_get_property(plane, plane_state,
- prop, &old_val);
- ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
- break;
+ if (async_flip) {
+ /* check if the prop does a nop change */
+ if ((prop != config->prop_fb_id &&
+ prop != config->prop_in_fence_fd &&
+ prop != config->prop_fb_damage_clips)) {
+ ret = drm_atomic_plane_get_property(plane, plane_state,
+ prop, &old_val);
+ ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
+ }
+
+ /* ask the driver if this non-primary plane is supported */
+ if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
+ ret = -EINVAL;
+
+ if (plane_funcs && plane_funcs->atomic_async_check)
+ ret = plane_funcs->atomic_async_check(plane, state, true);
+
+ if (ret) {
+ drm_dbg_atomic(prop->dev,
+ "[PLANE:%d:%s] does not support async flips\n",
+ obj->id, plane->name);
+ break;
+ }
+ }
}
ret = drm_atomic_plane_set_property(plane,
diff --git a/drivers/gpu/drm/loongson/lsdc_plane.c b/drivers/gpu/drm/loongson/lsdc_plane.c
index d227a2c1dcf16a3d5190de3893a55228ec70b254..aa9a97f9c4dc28eea3098507ce52e6aa6caa46eb 100644
--- a/drivers/gpu/drm/loongson/lsdc_plane.c
+++ b/drivers/gpu/drm/loongson/lsdc_plane.c
@@ -171,7 +171,8 @@ static const struct drm_plane_helper_funcs lsdc_primary_helper_funcs = {
};
static int lsdc_cursor_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state,
+ bool flip)
{
struct drm_plane_state *new_state;
struct drm_crtc_state *crtc_state;
diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c b/drivers/gpu/drm/mediatek/mtk_plane.c
index 8a48b3b0a95676c9823daa2052aefb7f86f629ff..655106bbb76d3300edb71fa027591b2f943bbe68 100644
--- a/drivers/gpu/drm/mediatek/mtk_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_plane.c
@@ -101,7 +101,7 @@ static void mtk_plane_destroy_state(struct drm_plane *plane,
}
static int mtk_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state, bool flip)
{
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
plane);
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index 62de248ed1b09ae479327691eea4866391977b85..bb16019219387e7c5e714106b2fb8054d0db85c1 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -368,7 +368,7 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane,
}
static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state, bool flip)
{
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
plane);
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 57747f1cff26e444ef3569983d6a7f7922f03ff7..e3596e2b557d042dcc660adbed14a468f2b1d484 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1072,7 +1072,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
}
static int vop_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state, bool flip)
{
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
plane);
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 430b2eededb2b5a3aa0c71022240076c027f5d90..798507a8ae56d6789feb95dccdd23b2e63d9c148 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1025,7 +1025,8 @@ static void tegra_cursor_atomic_disable(struct drm_plane *plane,
tegra_dc_writel(dc, value, DC_DISP_DISP_WIN_OPTIONS);
}
-static int tegra_cursor_atomic_async_check(struct drm_plane *plane, struct drm_atomic_state *state)
+static int tegra_cursor_atomic_async_check(struct drm_plane *plane, struct drm_atomic_state *state,
+ bool flip)
{
struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
struct drm_crtc_state *crtc_state;
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index d608860d525f6a813c7e4c46c8f8aaed16dc735c..c5e84d3494d273d969a041e9200c06de2c10105a 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -2338,7 +2338,7 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane,
}
static int vc4_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state, bool flip)
{
struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index ec59015aec3cf3ba01510031c55df8c0b3e0b382..0939ace53e7eb51db54dc133d2a8f898d31fc950 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -1400,13 +1400,18 @@ struct drm_plane_helper_funcs {
* given update can be committed asynchronously, that is, if it can
* jump ahead of the state currently queued for update.
*
+ * This function is also used by drm_atomic_set_property() to determine
+ * if the plane can be flipped in async. The flip flag is used to
+ * distinguish if the function is used for just the plane state or for a
+ * flip.
+ *
* RETURNS:
*
* Return 0 on success and any error returned indicates that the update
* can not be applied in asynchronous manner.
*/
int (*atomic_async_check)(struct drm_plane *plane,
- struct drm_atomic_state *state);
+ struct drm_atomic_state *state, bool flip);
/**
* @atomic_async_update:
--
2.48.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-01-27 19:59 [PATCH v12 0/2] drm/atomic: Ease async flip restrictions André Almeida
2025-01-27 19:59 ` [PATCH v12 1/2] drm/atomic: Let drivers decide which planes to async flip André Almeida
@ 2025-01-27 19:59 ` André Almeida
2025-01-29 14:36 ` Xaver Hugl
2025-02-06 22:22 ` Harry Wentland
2025-02-13 22:55 ` [PATCH v12 0/2] drm/atomic: Ease async flip restrictions Dmitry Baryshkov
2 siblings, 2 replies; 9+ messages in thread
From: André Almeida @ 2025-01-27 19:59 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Xaver Hugl, Daniel Stone,
ville.syrjala
Cc: kernel-dev, dri-devel, linux-kernel, amd-gfx, André Almeida
amdgpu can handle async flips on overlay planes, so allow it for atomic
async checks.
Signed-off-by: André Almeida <andrealmeid@igalia.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
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 774cc3f4f3fd9a964fe48c66eb596d2f6dfee602..6bfed3d1530e6610eea025b477f409ee505870da 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
@@ -1258,21 +1258,23 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
}
static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
- struct drm_atomic_state *state)
+ struct drm_atomic_state *state, bool flip)
{
struct drm_crtc_state *new_crtc_state;
struct drm_plane_state *new_plane_state;
struct dm_crtc_state *dm_new_crtc_state;
- /* Only support async updates on cursor planes. */
- if (plane->type != DRM_PLANE_TYPE_CURSOR)
+ if (flip) {
+ if (plane->type != DRM_PLANE_TYPE_OVERLAY)
+ return -EINVAL;
+ } else if (plane->type != DRM_PLANE_TYPE_CURSOR)
return -EINVAL;
new_plane_state = drm_atomic_get_new_plane_state(state, plane);
new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
/* Reject overlay cursors for now*/
- if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
+ if (!flip && dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
return -EINVAL;
return 0;
--
2.48.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-01-27 19:59 ` [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
@ 2025-01-29 14:36 ` Xaver Hugl
2025-01-29 15:53 ` André Almeida
2025-02-06 22:22 ` Harry Wentland
1 sibling, 1 reply; 9+ messages in thread
From: Xaver Hugl @ 2025-01-29 14:36 UTC (permalink / raw)
To: André Almeida
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Daniel Stone, ville.syrjala,
kernel-dev, dri-devel, linux-kernel, amd-gfx
Am Mo., 27. Jan. 2025 um 21:00 Uhr schrieb André Almeida
<andrealmeid@igalia.com>:
>
> amdgpu can handle async flips on overlay planes, so allow it for atomic
> async checks.
>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> 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 774cc3f4f3fd9a964fe48c66eb596d2f6dfee602..6bfed3d1530e6610eea025b477f409ee505870da 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
> @@ -1258,21 +1258,23 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
> }
>
> static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
> - struct drm_atomic_state *state)
> + struct drm_atomic_state *state, bool flip)
> {
> struct drm_crtc_state *new_crtc_state;
> struct drm_plane_state *new_plane_state;
> struct dm_crtc_state *dm_new_crtc_state;
>
> - /* Only support async updates on cursor planes. */
> - if (plane->type != DRM_PLANE_TYPE_CURSOR)
> + if (flip) {
> + if (plane->type != DRM_PLANE_TYPE_OVERLAY)
> + return -EINVAL;
> + } else if (plane->type != DRM_PLANE_TYPE_CURSOR)
> return -EINVAL;
This changes the logic for cursor updates, flipping on the cursor
plane allowed async updates before. Is that intentional?
> new_plane_state = drm_atomic_get_new_plane_state(state, plane);
> new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
> dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
> /* Reject overlay cursors for now*/
> - if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> + if (!flip && dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> return -EINVAL;
>
> return 0;
>
> --
> 2.48.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-01-29 14:36 ` Xaver Hugl
@ 2025-01-29 15:53 ` André Almeida
2025-01-29 17:23 ` Xaver Hugl
0 siblings, 1 reply; 9+ messages in thread
From: André Almeida @ 2025-01-29 15:53 UTC (permalink / raw)
To: Xaver Hugl
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Daniel Stone, ville.syrjala,
kernel-dev, dri-devel, linux-kernel, amd-gfx
Em 29/01/2025 11:36, Xaver Hugl escreveu:
> Am Mo., 27. Jan. 2025 um 21:00 Uhr schrieb André Almeida
> <andrealmeid@igalia.com>:
>>
>> amdgpu can handle async flips on overlay planes, so allow it for atomic
>> async checks.
>>
>> Signed-off-by: André Almeida <andrealmeid@igalia.com>
>> ---
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++++++----
>> 1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> 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 774cc3f4f3fd9a964fe48c66eb596d2f6dfee602..6bfed3d1530e6610eea025b477f409ee505870da 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
>> @@ -1258,21 +1258,23 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
>> }
>>
>> static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
>> - struct drm_atomic_state *state)
>> + struct drm_atomic_state *state, bool flip)
>> {
>> struct drm_crtc_state *new_crtc_state;
>> struct drm_plane_state *new_plane_state;
>> struct dm_crtc_state *dm_new_crtc_state;
>>
>> - /* Only support async updates on cursor planes. */
>> - if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> + if (flip) {
>> + if (plane->type != DRM_PLANE_TYPE_OVERLAY)
>> + return -EINVAL;
>> + } else if (plane->type != DRM_PLANE_TYPE_CURSOR)
>> return -EINVAL;
>
> This changes the logic for cursor updates, flipping on the cursor
> plane allowed async updates before. Is that intentional?
>
It's not the intention of this patch to disable async updates on cursor
planes... but I don't think it's happening here? Async plane updates and
async page flips are different things.
Any function that used to call amdgpu_dm_plane_atomic_async_check() for
an async update on a cursor plane will continue to being able to do that.
For callers of _atomic_async_check() from a page flip path (like
drm_atomic_set_property()), those couldn't flip a cursor plane, and will
continue to be like that for now.
At least this is my analysis, please let me know if I got something wrong.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-01-29 15:53 ` André Almeida
@ 2025-01-29 17:23 ` Xaver Hugl
0 siblings, 0 replies; 9+ messages in thread
From: Xaver Hugl @ 2025-01-29 17:23 UTC (permalink / raw)
To: André Almeida
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Daniel Stone, ville.syrjala,
kernel-dev, dri-devel, linux-kernel, amd-gfx
> It's not the intention of this patch to disable async updates on cursor
> planes... but I don't think it's happening here? Async plane updates and
> async page flips are different things.
Right, these are different code paths. Nevermind then, it's just a bit
confusing.
> Any function that used to call amdgpu_dm_plane_atomic_async_check() for
> an async update on a cursor plane will continue to being able to do that.
>
> For callers of _atomic_async_check() from a page flip path (like
> drm_atomic_set_property()), those couldn't flip a cursor plane, and will
> continue to be like that for now.
>
> At least this is my analysis, please let me know if I got something wrong.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-01-27 19:59 ` [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
2025-01-29 14:36 ` Xaver Hugl
@ 2025-02-06 22:22 ` Harry Wentland
2025-02-12 14:54 ` Alex Deucher
1 sibling, 1 reply; 9+ messages in thread
From: Harry Wentland @ 2025-02-06 22:22 UTC (permalink / raw)
To: André Almeida, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Xaver Hugl, Daniel Stone,
ville.syrjala
Cc: kernel-dev, dri-devel, linux-kernel, amd-gfx
On 2025-01-27 14:59, André Almeida wrote:
> amdgpu can handle async flips on overlay planes, so allow it for atomic
> async checks.
>
> Signed-off-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> 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 774cc3f4f3fd9a964fe48c66eb596d2f6dfee602..6bfed3d1530e6610eea025b477f409ee505870da 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
> @@ -1258,21 +1258,23 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
> }
>
> static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
> - struct drm_atomic_state *state)
> + struct drm_atomic_state *state, bool flip)
> {
> struct drm_crtc_state *new_crtc_state;
> struct drm_plane_state *new_plane_state;
> struct dm_crtc_state *dm_new_crtc_state;
>
> - /* Only support async updates on cursor planes. */
> - if (plane->type != DRM_PLANE_TYPE_CURSOR)
> + if (flip) {
> + if (plane->type != DRM_PLANE_TYPE_OVERLAY)
> + return -EINVAL;
> + } else if (plane->type != DRM_PLANE_TYPE_CURSOR)
> return -EINVAL;
>
> new_plane_state = drm_atomic_get_new_plane_state(state, plane);
> new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
> dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
> /* Reject overlay cursors for now*/
> - if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> + if (!flip && dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> return -EINVAL;
>
> return 0;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes
2025-02-06 22:22 ` Harry Wentland
@ 2025-02-12 14:54 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-02-12 14:54 UTC (permalink / raw)
To: Harry Wentland
Cc: André Almeida, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
dmitry.baryshkov, Simon Ser, joshua, Xaver Hugl, Daniel Stone,
ville.syrjala, kernel-dev, dri-devel, linux-kernel, amd-gfx
Acked-by: Alex Deucher <alexander.deucher@amd.com> for the series.
On Thu, Feb 6, 2025 at 5:37 PM Harry Wentland <harry.wentland@amd.com> wrote:
>
>
>
> On 2025-01-27 14:59, André Almeida wrote:
> > amdgpu can handle async flips on overlay planes, so allow it for atomic
> > async checks.
> >
> > Signed-off-by: André Almeida <andrealmeid@igalia.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 10 ++++++----
> > 1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > 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 774cc3f4f3fd9a964fe48c66eb596d2f6dfee602..6bfed3d1530e6610eea025b477f409ee505870da 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
> > @@ -1258,21 +1258,23 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
> > }
> >
> > static int amdgpu_dm_plane_atomic_async_check(struct drm_plane *plane,
> > - struct drm_atomic_state *state)
> > + struct drm_atomic_state *state, bool flip)
> > {
> > struct drm_crtc_state *new_crtc_state;
> > struct drm_plane_state *new_plane_state;
> > struct dm_crtc_state *dm_new_crtc_state;
> >
> > - /* Only support async updates on cursor planes. */
> > - if (plane->type != DRM_PLANE_TYPE_CURSOR)
> > + if (flip) {
> > + if (plane->type != DRM_PLANE_TYPE_OVERLAY)
> > + return -EINVAL;
> > + } else if (plane->type != DRM_PLANE_TYPE_CURSOR)
> > return -EINVAL;
> >
> > new_plane_state = drm_atomic_get_new_plane_state(state, plane);
> > new_crtc_state = drm_atomic_get_new_crtc_state(state, new_plane_state->crtc);
> > dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
> > /* Reject overlay cursors for now*/
> > - if (dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> > + if (!flip && dm_new_crtc_state->cursor_mode == DM_CURSOR_OVERLAY_MODE)
> > return -EINVAL;
> >
> > return 0;
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v12 0/2] drm/atomic: Ease async flip restrictions
2025-01-27 19:59 [PATCH v12 0/2] drm/atomic: Ease async flip restrictions André Almeida
2025-01-27 19:59 ` [PATCH v12 1/2] drm/atomic: Let drivers decide which planes to async flip André Almeida
2025-01-27 19:59 ` [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
@ 2025-02-13 22:55 ` Dmitry Baryshkov
2 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2025-02-13 22:55 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Harry Wentland, Leo Li,
Rodrigo Siqueira, Alex Deucher, Christian König, Xinhui Pan,
Simon Ser, joshua, Xaver Hugl, Daniel Stone, ville.syrjala,
André Almeida
Cc: kernel-dev, dri-devel, linux-kernel, amd-gfx, Christopher Snowhill
On Mon, 27 Jan 2025 16:59:38 -0300, André Almeida wrote:
> The goal of this work is to find a nice way to allow amdgpu to perform
> async page flips in the overlay plane as well, not only on the primary
> one. Currently, when using the atomic uAPI, this is the only type of
> plane allowed to do async flips, and every driver accepts it.
>
> This patchset re-uses the per-plane function atomic_async_check() to
> this purpose, so drivers can allow different plane types. There's a
> `bool flip` parameter so the atomic_async_check() can do different
> decisions if it's a complete page flip or a plane update.
>
> [...]
Applied to drm-misc-next, thanks!
[1/2] drm/atomic: Let drivers decide which planes to async flip
commit: fd40a63c63a182aeea1089a343e2f729de7e514d
[2/2] drm/amdgpu: Enable async flip on overlay planes
commit: 41129e236f14c6c54145c722da06f6793e9fd13d
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-02-13 22:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-27 19:59 [PATCH v12 0/2] drm/atomic: Ease async flip restrictions André Almeida
2025-01-27 19:59 ` [PATCH v12 1/2] drm/atomic: Let drivers decide which planes to async flip André Almeida
2025-01-27 19:59 ` [PATCH v12 2/2] drm/amdgpu: Enable async flip on overlay planes André Almeida
2025-01-29 14:36 ` Xaver Hugl
2025-01-29 15:53 ` André Almeida
2025-01-29 17:23 ` Xaver Hugl
2025-02-06 22:22 ` Harry Wentland
2025-02-12 14:54 ` Alex Deucher
2025-02-13 22:55 ` [PATCH v12 0/2] drm/atomic: Ease async flip restrictions Dmitry Baryshkov
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®