Commit a1559ffe authored by Jeff McGee's avatar Jeff McGee Committed by Daniel Vetter

drm/i915: Export total subslice and EU counts

Setup new I915_GETPARAM ioctl entries for subslice total and
EU total. Userspace drivers need these values when constructing
GPGPU commands. This kernel query method is intended to replace
the PCI ID-based tables that userspace drivers currently maintain.
The kernel driver can employ fuse register reads as needed to
ensure the most accurate determination of GT config attributes.
This first became important with Cherryview in which the config
could differ between devices with the same PCI ID.

The kernel detection of these values is device-specific and not
included in this patch. Because zero is not a valid value for any of
these parameters, a value of zero is interpreted as unknown for the
device. Userspace drivers should continue to maintain ID-based tables
for older devices not supported by the new query method.

v2: Increment our I915_GETPARAM indices to fit after REVISION
    which was merged ahead of us.

For: VIZ-4636
Signed-off-by: default avatarJeff McGee <jeff.mcgee@intel.com>
Tested-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
Acked-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent cd9bfacb
...@@ -153,6 +153,16 @@ static int i915_getparam(struct drm_device *dev, void *data, ...@@ -153,6 +153,16 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_MMAP_VERSION: case I915_PARAM_MMAP_VERSION:
value = 1; value = 1;
break; break;
case I915_PARAM_SUBSLICE_TOTAL:
value = INTEL_INFO(dev)->subslice_total;
if (!value)
return -ENODEV;
break;
case I915_PARAM_EU_TOTAL:
value = INTEL_INFO(dev)->eu_total;
if (!value)
return -ENODEV;
break;
default: default:
DRM_DEBUG("Unknown parameter %d\n", param->param); DRM_DEBUG("Unknown parameter %d\n", param->param);
return -EINVAL; return -EINVAL;
......
...@@ -348,6 +348,8 @@ typedef struct drm_i915_irq_wait { ...@@ -348,6 +348,8 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_MMAP_VERSION 30 #define I915_PARAM_MMAP_VERSION 30
#define I915_PARAM_HAS_BSD2 31 #define I915_PARAM_HAS_BSD2 31
#define I915_PARAM_REVISION 32 #define I915_PARAM_REVISION 32
#define I915_PARAM_SUBSLICE_TOTAL 33
#define I915_PARAM_EU_TOTAL 34
typedef struct drm_i915_getparam { typedef struct drm_i915_getparam {
int param; int param;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment