summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2018-08-17 15:02:23 -0700
committerDeepak Rawat <drawat@vmware.com>2018-08-21 11:22:49 -0700
commitf24f5f6621ed368f1986b72c3aa9211552082e96 (patch)
tree286363f2d28136d936a73239281bbb60f823b027
parentd8b0ce80fcf10c4c4308ae82393d17994e15cab2 (diff)
vmwgfx: for STDU limit surface size to max texture size
For STDU, remove max_stdu limit on surface size and don't set SVGA3D_SURFACE_SCREENTARGET flag for a scanout surface with size greater than STDU max width/height. This is because max_stdu size is a limit on max screen target and not on the surface size. A surface greater than stdu_max, will never be used for scanout because driver don't allow a screen bigger than stdu_max. Also, during prepare_fb separate surface for binding with screen target will be created, should user-space send bigger framebuufer for plane update. 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_surface.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/vmwgfx_surface.c b/vmwgfx_surface.c
index 646a375..9eeb4f6 100644
--- a/vmwgfx_surface.c
+++ b/vmwgfx_surface.c
@@ -1401,22 +1401,17 @@ int vmw_surface_gb_priv_define(struct drm_device *dev,
*srf_out = NULL;
if (for_scanout) {
- uint32_t max_width, max_height;
-
if (!svga3dsurface_is_screen_target_format(format)) {
DRM_ERROR("Invalid Screen Target surface format.");
return -EINVAL;
}
- max_width = min(dev_priv->texture_max_width,
- dev_priv->stdu_max_width);
- max_height = min(dev_priv->texture_max_height,
- dev_priv->stdu_max_height);
-
- if (size.width > max_width || size.height > max_height) {
+ if (size.width > dev_priv->texture_max_width ||
+ size.height > dev_priv->texture_max_height) {
DRM_ERROR("%ux%u\n, exceeds max surface size %ux%u",
size.width, size.height,
- max_width, max_height);
+ dev_priv->texture_max_width,
+ dev_priv->texture_max_height);
return -EINVAL;
}
} else {
@@ -1492,8 +1487,17 @@ int vmw_surface_gb_priv_define(struct drm_device *dev,
if (srf->flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT)
srf->res.backup_size += sizeof(SVGA3dDXSOState);
+ /*
+ * Don't set SVGA3D_SURFACE_SCREENTARGET flag for a scanout surface with
+ * size greater than STDU max width/height. This is really a workaround
+ * to support creation of big framebuffer requested by some user-space
+ * for whole topology. That big framebuffer won't really be used for
+ * binding with screen target as during prepare_fb a seperate surface is
+ * created so it's safe to ignore SVGA3D_SURFACE_SCREENTARGET flag.
+ */
if (dev_priv->active_display_unit == vmw_du_screen_target &&
- for_scanout)
+ for_scanout && size.width <= dev_priv->stdu_max_width &&
+ size.height <= dev_priv->stdu_max_height)
srf->flags |= SVGA3D_SURFACE_SCREENTARGET;
/*