drm/i915/userptr: Probe existence of backing struct pages upon creation
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_getparam.c
index 24e1821..77490cb 100644 (file)
@@ -15,7 +15,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
        struct pci_dev *pdev = to_pci_dev(dev->dev);
        const struct sseu_dev_info *sseu = &i915->gt.info.sseu;
        drm_i915_getparam_t *param = data;
-       int value;
+       int value = 0;
 
        switch (param->param) {
        case I915_PARAM_IRQ_ACTIVE:
@@ -134,6 +134,7 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
        case I915_PARAM_HAS_EXEC_FENCE_ARRAY:
        case I915_PARAM_HAS_EXEC_SUBMIT_FENCE:
        case I915_PARAM_HAS_EXEC_TIMELINE_FENCES:
+       case I915_PARAM_HAS_USERPTR_PROBE:
                /* For the time being all of these are always true;
                 * if some supported hardware does not have one of these
                 * features this value needs to be provided from
@@ -150,7 +151,9 @@ int i915_getparam_ioctl(struct drm_device *dev, void *data,
                        return -ENODEV;
                break;
        case I915_PARAM_SUBSLICE_MASK:
-               value = sseu->subslice_mask[0];
+               /* Only copy bits from the first slice */
+               memcpy(&value, sseu->subslice_mask,
+                      min(sseu->ss_stride, (u8)sizeof(value)));
                if (!value)
                        return -ENODEV;
                break;