aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2018-01-16 08:25:55 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2018-03-22 10:55:56 +0100
commit4e2f9fa7ffb5324adfc62fa3da6e1e36827fd5ad (patch)
tree9c1989df2bc34126e5e7aa113ff165e12cb94dc7 /drivers/gpu/drm/vmwgfx
parentdrm/vmwgfx: Avoid iterating over display unit if crtc is available (diff)
downloadlinux-dev-4e2f9fa7ffb5324adfc62fa3da6e1e36827fd5ad.tar.xz
linux-dev-4e2f9fa7ffb5324adfc62fa3da6e1e36827fd5ad.zip
drm/vmwgfx: Move surface copy cmd to atomic function
When display surface is different than the framebuffer surface, atomic path do not copy the surface data. This commit moved the code to copy surface from legacy to atomic path. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
index c22bf80d4ddd..dfbcd41303ad 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
@@ -492,8 +492,6 @@ static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc,
{
struct vmw_private *dev_priv = vmw_priv(crtc->dev);
struct vmw_screen_target_display_unit *stdu = vmw_crtc_to_stdu(crtc);
- struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(new_fb);
- struct drm_vmw_rect vclips;
int ret;
dev_priv = vmw_priv(crtc->dev);
@@ -519,26 +517,6 @@ static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc,
if (stdu->base.is_implicit)
vmw_kms_update_implicit_fb(dev_priv, crtc);
- /*
- * Now that we've bound a new surface to the screen target,
- * update the contents.
- */
- vclips.x = crtc->x;
- vclips.y = crtc->y;
- vclips.w = crtc->mode.hdisplay;
- vclips.h = crtc->mode.vdisplay;
-
- if (vfb->dmabuf)
- ret = vmw_kms_stdu_dma(dev_priv, NULL, vfb, NULL, NULL, &vclips,
- 1, 1, true, false, crtc);
- else
- ret = vmw_kms_stdu_surface_dirty(dev_priv, vfb, NULL, &vclips,
- NULL, 0, 0, 1, 1, NULL, crtc);
- if (ret) {
- DRM_ERROR("Page flip update error %d.\n", ret);
- return ret;
- }
-
if (event) {
struct vmw_fence_obj *fence = NULL;
struct drm_file *file_priv = event->base.file_priv;
@@ -1333,6 +1311,7 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane,
struct vmw_screen_target_display_unit *stdu;
struct vmw_plane_state *vps = vmw_plane_state_to_vps(plane->state);
struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
+ struct vmw_framebuffer *vfb = NULL;
int ret;
stdu = vmw_crtc_to_stdu(crtc);
@@ -1346,9 +1325,10 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane,
if (!stdu->defined)
return;
- if (plane->state->fb)
+ if (plane->state->fb) {
+ vfb = vmw_framebuffer_to_vfb(plane->state->fb);
ret = vmw_stdu_bind_st(dev_priv, stdu, &stdu->display_srf->res);
- else
+ } else
ret = vmw_stdu_bind_st(dev_priv, stdu, NULL);
/*
@@ -1360,7 +1340,24 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane,
else
crtc->primary->fb = plane->state->fb;
- ret = vmw_stdu_update_st(dev_priv, stdu);
+ if (vfb) {
+ struct drm_vmw_rect vclips;
+
+ vclips.x = crtc->x;
+ vclips.y = crtc->y;
+ vclips.w = crtc->mode.hdisplay;
+ vclips.h = crtc->mode.vdisplay;
+
+ if (vfb->dmabuf)
+ ret = vmw_kms_stdu_dma(dev_priv, NULL, vfb, NULL, NULL,
+ &vclips, 1, 1, true, false,
+ crtc);
+ else
+ ret = vmw_kms_stdu_surface_dirty(dev_priv, vfb, NULL,
+ &vclips, NULL, 0, 0,
+ 1, 1, NULL, crtc);
+ } else
+ ret = vmw_stdu_update_st(dev_priv, stdu);
if (ret)
DRM_ERROR("Failed to update STDU.\n");