winsys/drm: Add support for quality level in surface ioctl
authorDeepak Rawat <drawat@vmware.com>
Thu, 2 Nov 2017 00:40:50 +0000 (17:40 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 10 Sep 2018 19:07:30 +0000 (13:07 -0600)
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 <drawat@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/winsys/svga/drm/vmw_screen.h
src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
src/gallium/winsys/svga/drm/vmw_screen_svga.c
src/gallium/winsys/svga/drm/vmwgfx_drm.h

index 489c6d5ad324d2ac0bcc6bbd212e8a9e86d3a466..a87c087d9c53d510270ca71f155d2b1a984c4281 100644 (file)
@@ -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,
index 67d3df29c43ffc497b43e908e97f0b9032e8d5b0..94414e753423730bab021a433bf2a2ece0a75000 100644 (file)
@@ -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);
index 7edd13032796f5c11c2425e28be4782ca2700268..a6990414e20f2936c4f5f3aa493a67d34d1ec876 100644 (file)
@@ -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;
index 646cf6ef38f29f19e673faa42c9e15f723b3c2f3..20fbcd727c1a42294818ddb72caf88a9b6cc8347 100644 (file)
@@ -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;
 };