At present the async flip is being done by the flag
DRM_MODE_PAGE_FLIP_ASYNC. New plane property is being added for async
flip on per plane basis. Allow existing users using the flag
DRM_MODE_PAGE_FLIP_ASYNC to do async flip and internally set the
plane_state flags for async flip.

Signed-off-by: Arun R Murthy <[email protected]>
---
 drivers/gpu/drm/drm_atomic_uapi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c 
b/drivers/gpu/drm/drm_atomic_uapi.c
index 
4a2da81abd713127d5157e84f2cae2f8b34a4dd6..eb4d7146f1f92eec58aba99ce6f5b678c0959b66
 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -1190,6 +1190,7 @@ int drm_atomic_set_property(struct drm_atomic_state 
*state,
                ret = drm_atomic_connector_set_property(connector,
                                connector_state, file_priv,
                                prop, prop_value);
+
                break;
        }
        case DRM_MODE_OBJECT_CRTC: {
@@ -1256,6 +1257,10 @@ int drm_atomic_set_property(struct drm_atomic_state 
*state,
                                plane_state, file_priv,
                                prop, prop_value);
 
+               /* Hack to make the legacy DRM_MODE_PAGE_FLIP_ASYNC work with 
atomic_ioctl() */
+               if (async_flip && prop == config->prop_fb_id)
+                       plane_state->async_flip = true;
+
                break;
        }
        case DRM_MODE_OBJECT_COLOROP: {
@@ -1591,6 +1596,12 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
                        return -EINVAL;
                }
 
+               /*
+                * Legacy way of handling async flip using the flag
+                * DRM_MODE_PAGE_FLIP_ASYNC is still supported using the local
+                * flag async_flip. Once the UMD moves to the plane property
+                * for async flip this should be removed.
+                */
                async_flip = true;
        }
 

-- 
2.25.1

Reply via email to