summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2018-08-17 14:25:42 -0700
committerDeepak Rawat <drawat@vmware.com>2018-08-21 11:10:43 -0700
commited20e6f3d3c0b084d11f88b73d684053e884f78c (patch)
tree810980bac5ca604499bbf4c9b33faa4b2ec591fe
parent65c381c13da1475458412195ba9c442376fea0a4 (diff)
vmwgfx: limit screen size to stdu_max during check_modeset
For STDU individual screen target size is limited by SVGA_REG_SCREENTARGET_MAX_WIDTH/HEIGHT registers so add that limit during atomic check_modeset. Also modified the comments to reflect current limitation on topology. 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.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/vmwgfx_kms.c b/vmwgfx_kms.c
index a16da3b..b1a39b3 100644
--- a/vmwgfx_kms.c
+++ b/vmwgfx_kms.c
@@ -1555,9 +1555,12 @@ static int vmw_kms_check_display_memory(struct drm_device *dev,
for (i = 0; i < num_rects; i++) {
/*
- * Currently this check is limiting the topology within max
- * texture/screentarget size. This should change in future when
- * user-space support multiple fb with topology.
+ * Currently this check is limiting the topology within
+ * mode_config->max (which actually is max texture size
+ * supported by virtual device). This limit is here to address
+ * Window managers that create a big framebuffer for whole
+ * topology. May be this should change in future when no such
+ * user-space exists.
*/
if (rects[i].x1 < 0 || rects[i].y1 < 0 ||
rects[i].x2 > mode_config->max_width ||
@@ -1566,6 +1569,17 @@ static int vmw_kms_check_display_memory(struct drm_device *dev,
return -EINVAL;
}
+ /*
+ * For STDU only individual screen (screen target) is limited by
+ * SCREENTARGET_MAX_WIDTH/HEIGHT registers.
+ */
+ if (dev_priv->active_display_unit == vmw_du_screen_target &&
+ (drm_rect_width(&rects[i]) > dev_priv->stdu_max_width ||
+ drm_rect_height(&rects[i]) > dev_priv->stdu_max_height)) {
+ DRM_ERROR("Screen size not supported.\n");
+ return -EINVAL;
+ }
+
/* Bounding box upper left is at (0,0). */
if (rects[i].x2 > bounding_box.x2)
bounding_box.x2 = rects[i].x2;