diff options
author | Deepak Rawat <[email protected]> | 2017-09-19 15:56:26 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-09-10 13:07:30 -0600 |
commit | 569f838987689b6e8fa94500243f01d4ab92b736 (patch) | |
tree | fa94942f07296cbed5e93d564b360e2e1b27c713 /src/gallium/drivers/svga | |
parent | 3f55425ee69dafb5d5dd10bea4cf2010d87d5eee (diff) |
winsys/svga: Add support for new surface ioctl, multisample pattern
Kernel driver version 2.15 added new surface ioctl named:
DRM_VMW_GB_SURFACE_CREATE_EXT
DRM_VMW_GB_SURFACE_REF_EXT
The new ioctl has support for 64-bit svga3d_flags if
DRM_VMW_PARAM_SM4_1 is available.
Multisampling surface mob size calculation is added. Also synced the
relevant header update.
svga device modified the surface define command V3 with new parameter
multisampling pattern. Adding support for that in winsys.
Signed-off-by: Deepak Rawat <[email protected]>
Reviewed-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Sinclair Yeh <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/include/svga3d_surfacedefs.h | 24 | ||||
-rw-r--r-- | src/gallium/drivers/svga/include/svga3d_types.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/include/svga3d_surfacedefs.h b/src/gallium/drivers/svga/include/svga3d_surfacedefs.h index 89baff3d2bc..9054e72207d 100644 --- a/src/gallium/drivers/svga/include/svga3d_surfacedefs.h +++ b/src/gallium/drivers/svga/include/svga3d_surfacedefs.h @@ -1102,6 +1102,30 @@ svga3dsurface_get_serialized_size(SVGA3dSurfaceFormat format, /** + * svga3dsurface_get_serialized_size_extended - Returns the number of bytes + * required for a surface with given parameters. Support for sample count. + * + */ +static inline uint32 +svga3dsurface_get_serialized_size_extended(SVGA3dSurfaceFormat format, + SVGA3dSize base_level_size, + uint32 num_mip_levels, + uint32 num_layers, + uint32 num_samples) +{ + uint64_t total_size = svga3dsurface_get_serialized_size(format, + base_level_size, + num_mip_levels, + num_layers); + + total_size *= (num_samples > 1 ? num_samples : 1); + + return (total_size > (uint64_t) MAX_UINT32) ? MAX_UINT32 : + (uint32) total_size; +} + + +/** * Compute the offset (in bytes) to a pixel in an image (or volume). * 'width' is the image width in pixels * 'height' is the image height in pixels diff --git a/src/gallium/drivers/svga/include/svga3d_types.h b/src/gallium/drivers/svga/include/svga3d_types.h index 997f4e30fd4..aa363c68927 100644 --- a/src/gallium/drivers/svga/include/svga3d_types.h +++ b/src/gallium/drivers/svga/include/svga3d_types.h @@ -70,6 +70,8 @@ #endif #endif +#define MIN_UINT64 (CONST64U(0)) +#define MAX_UINT64 (CONST64U(0xffffffffffffffff)) /* * Generic Types |