Skip to content

Commit 1f054fd

Browse files
author
Roland Scheidegger
committed
drm/vmwgfx: fix update of display surface when resolution changes
The assignment of metadata overwrote the new display resolution values, hence we'd miss the size actually changed and wouldn't redefine the surface. This would then lead to command buffer error when trying to update the screen target (due to the size mismatch), and result in a VM with black screen. Fixes: 504901d ("drm/vmwgfx: Refactor surface_define to use vmw_surface_metadata") Reviewed-by: Charmaine Lee <[email protected]> Signed-off-by: Roland Scheidegger <[email protected]> Cc: [email protected]
1 parent 38794a5 commit 1f054fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,6 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane,
10691069
if (new_content_type != SAME_AS_DISPLAY) {
10701070
struct vmw_surface_metadata metadata = {0};
10711071

1072-
metadata.base_size.width = hdisplay;
1073-
metadata.base_size.height = vdisplay;
1074-
metadata.base_size.depth = 1;
1075-
10761072
/*
10771073
* If content buffer is a buffer object, then we have to
10781074
* construct surface info
@@ -1104,6 +1100,10 @@ vmw_stdu_primary_plane_prepare_fb(struct drm_plane *plane,
11041100
metadata = new_vfbs->surface->metadata;
11051101
}
11061102

1103+
metadata.base_size.width = hdisplay;
1104+
metadata.base_size.height = vdisplay;
1105+
metadata.base_size.depth = 1;
1106+
11071107
if (vps->surf) {
11081108
struct drm_vmw_size cur_base_size =
11091109
vps->surf->metadata.base_size;

0 commit comments

Comments
 (0)