diff options
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_surface.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index 05fa092..7681341 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -817,7 +817,6 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, } else { srf->snooper.image = NULL; } - srf->snooper.crtc = NULL; user_srf->prime.base.shareable = false; user_srf->prime.base.tfile = NULL; @@ -1479,10 +1478,24 @@ 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) { + DRM_ERROR("%ux%u\n, exeeds max surface size %ux%u", + size.width, size.height, + max_width, max_height); + return -EINVAL; + } } else { const struct svga3d_surface_desc *desc; |