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>
This commit is contained in:
Deepak Rawat
2018-06-20 15:24:05 -07:00
committed by Thomas Hellstrom
parent 14b1c33e84
commit f9261b30d9
3 changed files with 34 additions and 5 deletions

View File

@ -1235,6 +1235,26 @@ svga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format,
return total_size * num_layers;
}
/**
* svga3dsurface_get_serialized_size_extended - Returns the number of bytes
* required for a surface with given parameters. Support for sample count.
*/
static inline u32
svga3dsurface_get_serialized_size_extended(SVGA3dSurfaceFormat format,
surf_size_struct base_level_size,
u32 num_mip_levels,
u32 num_layers,
u32 num_samples)
{
uint64_t total_size =
svga3dsurface_get_serialized_size(format,
base_level_size,
num_mip_levels,
num_layers);
total_size *= max_t(u32, 1, num_samples);
return min_t(uint64_t, total_size, (uint64_t)U32_MAX);
}
/**
* svga3dsurface_get_pixel_offset - Compute the offset (in bytes) to a pixel