summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
diff options
context:
space:
mode:
authorDeepak Rawat <drawat@vmware.com>2018-06-21 01:24:05 +0300
committerThomas Hellstrom <thellstrom@vmware.com>2018-07-06 21:16:09 +0300
commitf9261b30d92f3835891648041ce8699b1fb9a694 (patch)
treeae0b1b14fe65440d04b472666d5812df3be3133e /drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
parent14b1c33e84295693c3b1a1d7c6ac82b3f384cd17 (diff)
downloadlinux-f9261b30d92f3835891648041ce8699b1fb9a694.tar.xz
drm/vmwgfx: Add support for multisampling
Support for SVGA3D_SURFACE_MULTISAMPLE and surface mob size according to sample count. Signed-off-by: Deepak Rawat <drawat@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_surface.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_surface.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index 1d4c010a0e48..7636bf2db17e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -1399,6 +1399,7 @@ int vmw_surface_gb_priv_define(struct drm_device *dev,
struct vmw_surface *srf;
int ret;
u32 num_layers = 1;
+ u32 sample_count = 1;
*srf_out = NULL;
@@ -1481,11 +1482,15 @@ int vmw_surface_gb_priv_define(struct drm_device *dev,
else if (svga3d_flags & SVGA3D_SURFACE_CUBEMAP)
num_layers = SVGA3D_MAX_SURFACE_FACES;
+ if (srf->flags & SVGA3D_SURFACE_MULTISAMPLE)
+ sample_count = srf->multisample_count;
+
srf->res.backup_size =
- svga3dsurface_get_serialized_size(srf->format,
- srf->base_size,
- srf->mip_levels[0],
- num_layers);
+ svga3dsurface_get_serialized_size_extended(srf->format,
+ srf->base_size,
+ srf->mip_levels[0],
+ num_layers,
+ sample_count);
if (srf->flags & SVGA3D_SURFACE_BIND_STREAM_OUTPUT)
srf->res.backup_size += sizeof(SVGA3dDXSOState);
@@ -1595,6 +1600,10 @@ vmw_gb_surface_define_internal(struct drm_device *dev,
return -EINVAL;
}
+ if ((svga3d_flags_64 & SVGA3D_SURFACE_MULTISAMPLE) &&
+ req->base.multisample_count == 0)
+ return -EINVAL;
+
if (req->base.mip_levels > DRM_VMW_MAX_MIP_LEVELS)
return -EINVAL;