Skip to content

Commit 140b4e6

Browse files
deepak-rawatthomashvmw
authored andcommitted
drm/vmwgfx: limit mode size for all display unit to texture_max
For all display units, limit mode size exposed to texture_max_width/ height as this is the maximum framebuffer size that virtual device can create. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
1 parent 0c1b174 commit 140b4e6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,12 +2214,16 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
22142214
if (dev_priv->assume_16bpp)
22152215
assumed_bpp = 2;
22162216

2217+
max_width = min(max_width, dev_priv->texture_max_width);
2218+
max_height = min(max_height, dev_priv->texture_max_height);
2219+
2220+
/*
2221+
* For STDU extra limit for a mode on SVGA_REG_SCREENTARGET_MAX_WIDTH/
2222+
* HEIGHT registers.
2223+
*/
22172224
if (dev_priv->active_display_unit == vmw_du_screen_target) {
22182225
max_width = min(max_width, dev_priv->stdu_max_width);
2219-
max_width = min(max_width, dev_priv->texture_max_width);
2220-
22212226
max_height = min(max_height, dev_priv->stdu_max_height);
2222-
max_height = min(max_height, dev_priv->texture_max_height);
22232227
}
22242228

22252229
/* Add preferred mode */

0 commit comments

Comments
 (0)