Skip to content

Commit 65c8b1f

Browse files
committed
drm/i915: expose _SLICE_MASK GETPARM
Enables userspace to determine the number of slices enabled and also know what specific slices are enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW slice configuration. Signed-off-by: Robert Bragg <[email protected]>
1 parent d111e12 commit 65c8b1f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/gpu/drm/i915/i915_dma.c

+5
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ static int i915_getparam(struct drm_device *dev, void *data,
170170
case I915_PARAM_HAS_RESOURCE_STREAMER:
171171
value = HAS_RESOURCE_STREAMER(dev);
172172
break;
173+
case I915_PARAM_SLICE_MASK:
174+
value = INTEL_INFO(dev_priv)->slice_mask;
175+
if (!value)
176+
return -ENODEV;
177+
break;
173178
default:
174179
DRM_DEBUG("Unknown parameter %d\n", param->param);
175180
return -EINVAL;

include/uapi/drm/i915_drm.h

+1
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ typedef struct drm_i915_irq_wait {
358358
#define I915_PARAM_EU_TOTAL 34
359359
#define I915_PARAM_HAS_GPU_RESET 35
360360
#define I915_PARAM_HAS_RESOURCE_STREAMER 36
361+
#define I915_PARAM_SLICE_MASK 45 /* XXX: rebase before landing */
361362

362363
typedef struct drm_i915_getparam {
363364
__s32 param;

0 commit comments

Comments
 (0)