summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2018-08-17 14:44:35 -0700
committerDeepak Rawat <drawat@vmware.com>2018-08-21 11:11:23 -0700
commit8900a0842b44da297ea1a564963f409004658b2c (patch)
tree7f93805ca572f8d603216004fe7173f5bf46f23c
parented20e6f3d3c0b084d11f88b73d684053e884f78c (diff)
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>
-rw-r--r--vmwgfx_kms.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/vmwgfx_kms.c b/vmwgfx_kms.c
index b1a39b3..b2b652a 100644
--- a/vmwgfx_kms.c
+++ b/vmwgfx_kms.c
@@ -2271,12 +2271,16 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
if (dev_priv->assume_16bpp)
assumed_bpp = 2;
+ max_width = min(max_width, dev_priv->texture_max_width);
+ max_height = min(max_height, dev_priv->texture_max_height);
+
+ /*
+ * For STDU extra limit for a mode on SVGA_REG_SCREENTARGET_MAX_WIDTH/
+ * HEIGHT registers.
+ */
if (dev_priv->active_display_unit == vmw_du_screen_target) {
max_width = min(max_width, dev_priv->stdu_max_width);
- max_width = min(max_width, dev_priv->texture_max_width);
-
max_height = min(max_height, dev_priv->stdu_max_height);
- max_height = min(max_height, dev_priv->texture_max_height);
}
/* Add preferred mode */