forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
....@@ -114,10 +114,13 @@
114114 (dev_priv->active_display_unit == vmw_du_screen_target);
115115 break;
116116 case DRM_VMW_PARAM_DX:
117
- param->value = dev_priv->has_dx;
117
+ param->value = has_sm4_context(dev_priv);
118118 break;
119119 case DRM_VMW_PARAM_SM4_1:
120
- param->value = dev_priv->has_sm4_1;
120
+ param->value = has_sm4_1_context(dev_priv);
121
+ break;
122
+ case DRM_VMW_PARAM_SM5:
123
+ param->value = has_sm5_context(dev_priv);
121124 break;
122125 default:
123126 return -EINVAL;
....@@ -126,14 +129,17 @@
126129 return 0;
127130 }
128131
129
-static u32 vmw_mask_multisample(unsigned int cap, u32 fmt_value)
132
+static u32 vmw_mask_legacy_multisample(unsigned int cap, u32 fmt_value)
130133 {
131134 /*
132135 * A version of user-space exists which use MULTISAMPLE_MASKABLESAMPLES
133136 * to check the sample count supported by virtual device. Since there
134137 * never was support for multisample count for backing MOB return 0.
138
+ *
139
+ * MULTISAMPLE_MASKABLESAMPLES devcap is marked as deprecated by virtual
140
+ * device.
135141 */
136
- if (cap == SVGA3D_DEVCAP_MULTISAMPLE_MASKABLESAMPLES)
142
+ if (cap == SVGA3D_DEVCAP_DEAD5)
137143 return 0;
138144
139145 return fmt_value;
....@@ -164,7 +170,7 @@
164170 for (i = 0; i < max_size; ++i) {
165171 vmw_write(dev_priv, SVGA_REG_DEV_CAP, i);
166172 compat_cap->pairs[i][0] = i;
167
- compat_cap->pairs[i][1] = vmw_mask_multisample
173
+ compat_cap->pairs[i][1] = vmw_mask_legacy_multisample
168174 (i, vmw_read(dev_priv, SVGA_REG_DEV_CAP));
169175 }
170176 spin_unlock(&dev_priv->cap_lock);
....@@ -188,7 +194,7 @@
188194 struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv);
189195
190196 if (unlikely(arg->pad64 != 0 || arg->max_size == 0)) {
191
- DRM_ERROR("Illegal GET_3D_CAP argument.\n");
197
+ VMW_DEBUG_USER("Illegal GET_3D_CAP argument.\n");
192198 return -EINVAL;
193199 }
194200
....@@ -220,7 +226,7 @@
220226 spin_lock(&dev_priv->cap_lock);
221227 for (i = 0; i < num; ++i) {
222228 vmw_write(dev_priv, SVGA_REG_DEV_CAP, i);
223
- *bounce32++ = vmw_mask_multisample
229
+ *bounce32++ = vmw_mask_legacy_multisample
224230 (i, vmw_read(dev_priv, SVGA_REG_DEV_CAP));
225231 }
226232 spin_unlock(&dev_priv->cap_lock);
....@@ -268,7 +274,7 @@
268274 return 0;
269275
270276 if (clips_ptr == NULL) {
271
- DRM_ERROR("Variable clips_ptr must be specified.\n");
277
+ VMW_DEBUG_USER("Variable clips_ptr must be specified.\n");
272278 ret = -EINVAL;
273279 goto out_clips;
274280 }
....@@ -291,7 +297,7 @@
291297
292298 fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id);
293299 if (!fb) {
294
- DRM_ERROR("Invalid framebuffer id.\n");
300
+ VMW_DEBUG_USER("Invalid framebuffer id.\n");
295301 ret = -ENOENT;
296302 goto out_no_fb;
297303 }
....@@ -351,7 +357,7 @@
351357 return 0;
352358
353359 if (clips_ptr == NULL) {
354
- DRM_ERROR("Argument clips_ptr must be specified.\n");
360
+ VMW_DEBUG_USER("Argument clips_ptr must be specified.\n");
355361 ret = -EINVAL;
356362 goto out_clips;
357363 }
....@@ -374,14 +380,14 @@
374380
375381 fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id);
376382 if (!fb) {
377
- DRM_ERROR("Invalid framebuffer id.\n");
383
+ VMW_DEBUG_USER("Invalid framebuffer id.\n");
378384 ret = -ENOENT;
379385 goto out_no_fb;
380386 }
381387
382388 vfb = vmw_framebuffer_to_vfb(fb);
383389 if (!vfb->bo) {
384
- DRM_ERROR("Framebuffer not buffer backed.\n");
390
+ VMW_DEBUG_USER("Framebuffer not buffer backed.\n");
385391 ret = -EINVAL;
386392 goto out_no_ttm_lock;
387393 }