drm/vmwgfx: Use the standard atomic helpers for page-flip
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 14 Nov 2018 07:11:05 +0000 (08:11 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Dec 2018 09:09:55 +0000 (10:09 +0100)
Our wrappers don't do anything useful anymore except calling the
atomic helpers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c

index 8e5eecdf148aed36cda87dbb845002ef7b67e76b..cd586c52af7e19c621965e1e620de41a684c33a8 100644 (file)
@@ -315,23 +315,6 @@ static void vmw_sou_crtc_atomic_disable(struct drm_crtc *crtc,
        }
 }
 
-static int vmw_sou_crtc_page_flip(struct drm_crtc *crtc,
-                                 struct drm_framebuffer *new_fb,
-                                 struct drm_pending_vblank_event *event,
-                                 uint32_t flags,
-                                 struct drm_modeset_acquire_ctx *ctx)
-{
-       int ret;
-
-       ret = drm_atomic_helper_page_flip(crtc, new_fb, event, flags, ctx);
-       if (ret) {
-               DRM_ERROR("Page flip error %d.\n", ret);
-               return ret;
-       }
-
-       return ret;
-}
-
 static const struct drm_crtc_funcs vmw_screen_object_crtc_funcs = {
        .gamma_set = vmw_du_crtc_gamma_set,
        .destroy = vmw_sou_crtc_destroy,
@@ -339,7 +322,7 @@ static const struct drm_crtc_funcs vmw_screen_object_crtc_funcs = {
        .atomic_duplicate_state = vmw_du_crtc_duplicate_state,
        .atomic_destroy_state = vmw_du_crtc_destroy_state,
        .set_config = drm_atomic_helper_set_config,
-       .page_flip = vmw_sou_crtc_page_flip,
+       .page_flip = drm_atomic_helper_page_flip,
 };
 
 /*
index 26a3515ae71851e9e839fa90c3522eb2bd61bef4..096c2941a8e41ac528c30219f9743f4b0241582a 100644 (file)
@@ -452,48 +452,6 @@ static void vmw_stdu_crtc_atomic_disable(struct drm_crtc *crtc,
        }
 }
 
-/**
- * vmw_stdu_crtc_page_flip - Binds a buffer to a screen target
- *
- * @crtc: CRTC to attach FB to
- * @fb: FB to attach
- * @event: Event to be posted. This event should've been alloced
- *         using k[mz]alloc, and should've been completely initialized.
- * @page_flip_flags: Input flags.
- *
- * If the STDU uses the same display and content buffers, i.e. a true flip,
- * this function will replace the existing display buffer with the new content
- * buffer.
- *
- * If the STDU uses different display and content buffers, i.e. a blit, then
- * only the content buffer will be updated.
- *
- * RETURNS:
- * 0 on success, error code on failure
- */
-static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc,
-                                  struct drm_framebuffer *new_fb,
-                                  struct drm_pending_vblank_event *event,
-                                  uint32_t flags,
-                                  struct drm_modeset_acquire_ctx *ctx)
-
-{
-       struct vmw_screen_target_display_unit *stdu = vmw_crtc_to_stdu(crtc);
-       int ret;
-
-       if (!stdu->defined)
-               return -EINVAL;
-
-       ret = drm_atomic_helper_page_flip(crtc, new_fb, event, flags, ctx);
-       if (ret) {
-               DRM_ERROR("Page flip error %d.\n", ret);
-               return ret;
-       }
-
-       return 0;
-}
-
-
 /**
  * vmw_stdu_bo_clip - Callback to encode a suface DMA command cliprect
  *
@@ -967,7 +925,7 @@ static const struct drm_crtc_funcs vmw_stdu_crtc_funcs = {
        .atomic_duplicate_state = vmw_du_crtc_duplicate_state,
        .atomic_destroy_state = vmw_du_crtc_destroy_state,
        .set_config = drm_atomic_helper_set_config,
-       .page_flip = vmw_stdu_crtc_page_flip,
+       .page_flip = drm_atomic_helper_page_flip,
 };