diff mbox series

[1/1] drm/atomic: Allow userspace to use explicit sync with atomic async flips

Message ID 20240622170951.738735-1-andrealmeid@igalia.com (mailing list archive)
State New, archived
Headers show
Series [1/1] drm/atomic: Allow userspace to use explicit sync with atomic async flips | expand

Commit Message

André Almeida June 22, 2024, 5:09 p.m. UTC
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>
---

This patch is originally from a patchset, but it doesn't really depends on the
rest of the work, so I'm sending it standalone now.

Original thread: https://lore.kernel.org/dri-devel/20240618030024.500532-1-andrealmeid@igalia.com/

 drivers/gpu/drm/drm_atomic_uapi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Ser June 29, 2024, 3:32 p.m. UTC | #1
On Saturday, June 22nd, 2024 at 19:09, André Almeida <andrealmeid@igalia.com> wrote:

> 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.

LGTM.

Would you mind sending a patch for FB_DAMAGE_CLIPS as well?

Reviewed-by: Simon Ser <contact@emersion.fr>
Simon Ser June 29, 2024, 3:34 p.m. UTC | #2
BTW, should we allow OUT_FENCE_PTR as well? Would that work as expected
with async flips?
André Almeida July 2, 2024, 9:21 p.m. UTC | #3
Em 29/06/2024 12:32, Simon Ser escreveu:
> On Saturday, June 22nd, 2024 at 19:09, André Almeida <andrealmeid@igalia.com> wrote:
> 
>> 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.
> 
> LGTM.

thanks!

> 
> Would you mind sending a patch for FB_DAMAGE_CLIPS as well?

sure :)

> 
> Reviewed-by: Simon Ser <contact@emersion.fr>
>
diff mbox series

Patch

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);