summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorDeepak Rawat <[email protected]>2017-11-01 17:40:50 -0700
committerBrian Paul <[email protected]>2018-09-10 13:07:30 -0600
commit159e706c4c4090b36ea118b3fea5c576ee3a7350 (patch)
tree17884ce7343e15121c1ade911a91d25be4fbe565 /src/gallium/winsys
parentb343c6915ca3e1a60f609807a0c259078a68a182 (diff)
winsys/drm: Add support for quality level in surface ioctl
A new argument "quality level" is added in surface define v3 which represets precision settings for surface. This commit add support for quality level in DRM_VMW_GB_SURFACE_CREATE_EXT and DRM_VMW_GB_SURFACE_REF_EXT. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen.h13
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_ioctl.c2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_svga.c6
-rw-r--r--src/gallium/winsys/svga/drm/vmwgfx_drm.h3
4 files changed, 16 insertions, 8 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
index 489c6d5ad32..a87c087d9c5 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.h
+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
@@ -138,16 +138,17 @@ vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
unsigned sampleCount);
uint32
vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
- SVGA3dSurfaceAllFlags flags,
- SVGA3dSurfaceFormat format,
+ SVGA3dSurfaceAllFlags flags,
+ SVGA3dSurfaceFormat format,
unsigned usage,
- SVGA3dSize size,
- uint32 numFaces,
- uint32 numMipLevels,
+ SVGA3dSize size,
+ uint32 numFaces,
+ uint32 numMipLevels,
unsigned sampleCount,
uint32 buffer_handle,
SVGA3dMSPattern multisamplePattern,
- struct vmw_region **p_region);
+ SVGA3dMSQualityLevel qualityLevel,
+ struct vmw_region **p_region);
int
vmw_ioctl_gb_surface_ref(struct vmw_winsys_screen *vws,
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 67d3df29c43..94414e75342 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -207,6 +207,7 @@ vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
unsigned sampleCount,
uint32_t buffer_handle,
SVGA3dMSPattern multisamplePattern,
+ SVGA3dMSQualityLevel qualityLevel,
struct vmw_region **p_region)
{
struct drm_vmw_gb_surface_create_rep *rep;
@@ -230,6 +231,7 @@ vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
req->version = drm_vmw_gb_surface_v1;
req->multisample_pattern = multisamplePattern;
+ req->quality_level = qualityLevel;
req->must_be_zero = 0;
req->base.svga3d_flags = SVGA3D_FLAGS_LOWER_32(flags);
req->svga3d_flags_upper_32_bits = SVGA3D_FLAGS_UPPER_32(flags);
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
index 7edd1303279..a6990414e20 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
@@ -185,6 +185,7 @@ vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
uint32_t buffer_size;
uint32_t num_samples = 1;
SVGA3dMSPattern multisample_pattern = SVGA3D_MS_PATTERN_NONE;
+ SVGA3dMSQualityLevel quality_level = SVGA3D_MS_QUALITY_NONE;
memset(&desc, 0, sizeof(desc));
surface = CALLOC_STRUCT(vmw_svga_winsys_surface);
@@ -207,6 +208,7 @@ vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
goto no_sid;
num_samples = sampleCount;
multisample_pattern = SVGA3D_MS_PATTERN_STANDARD;
+ quality_level = SVGA3D_MS_QUALITY_FULL;
}
/*
@@ -249,8 +251,9 @@ vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
numMipLevels, sampleCount,
ptr.gmrId,
multisample_pattern,
+ quality_level,
surface->buf ? NULL :
- &desc.region);
+ &desc.region);
if (surface->sid == SVGA3D_INVALID_ID) {
if (surface->buf == NULL) {
@@ -268,6 +271,7 @@ vmw_svga_winsys_surface_create(struct svga_winsys_screen *sws,
size, numLayers,
numMipLevels, sampleCount,
0, multisample_pattern,
+ quality_level,
&desc.region);
if (surface->sid == SVGA3D_INVALID_ID)
goto no_sid;
diff --git a/src/gallium/winsys/svga/drm/vmwgfx_drm.h b/src/gallium/winsys/svga/drm/vmwgfx_drm.h
index 646cf6ef38f..20fbcd727c1 100644
--- a/src/gallium/winsys/svga/drm/vmwgfx_drm.h
+++ b/src/gallium/winsys/svga/drm/vmwgfx_drm.h
@@ -1132,6 +1132,7 @@ enum drm_vmw_surface_version {
* @version: Version of surface create ioctl.
* @svga3d_flags_upper_32_bits: Upper 32 bits of svga3d flags.
* @multisample_pattern: Multisampling pattern when msaa is supported.
+ * @quality_level: Precision settings for each sample.
* @must_be_zero: Reserved for future usage.
*
* Input argument to the DRM_VMW_GB_SURFACE_CREATE_EXT Ioctl.
@@ -1142,7 +1143,7 @@ struct drm_vmw_gb_surface_create_ext_req {
enum drm_vmw_surface_version version;
uint32_t svga3d_flags_upper_32_bits;
SVGA3dMSPattern multisample_pattern;
- uint32_t pad64;
+ SVGA3dMSQualityLevel quality_level;
uint64_t must_be_zero;
};