History

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.

Jeff McGee committed 11 years ago

Commit a1559ff1 parent cd9bfac2 files · +12 −0Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/i915/i915_dma.c +10 −0
  2. include/uapi/drm/i915_drm.h +2 −0
drivers/gpu/drm/i915/i915_dma.c+10−0
@@ -153,6 +153,16 @@ static int i915_getparam(struct drm_device *dev, void *data, · 152 unmodified lines
153 case I915_PARAM_MMAP_VERSION:153 case I915_PARAM_MMAP_VERSION:
154 value = 1;154 value = 1;
155 break;155 break;
156 case I915_PARAM_SUBSLICE_TOTAL:
157 value = INTEL_INFO(dev)->subslice_total;
158 if (!value)
159 return -ENODEV;
160 break;
161 case I915_PARAM_EU_TOTAL:
162 value = INTEL_INFO(dev)->eu_total;
163 if (!value)
164 return -ENODEV;
165 break;
156 default:166 default:
157 DRM_DEBUG("Unknown parameter %d\n", param->param);167 DRM_DEBUG("Unknown parameter %d\n", param->param);
158 return -EINVAL;168 return -EINVAL;
include/uapi/drm/i915_drm.h+2−0
@@ -348,6 +348,8 @@ typedef struct drm_i915_irq_wait { · 347 unmodified lines
348#define I915_PARAM_MMAP_VERSION 30348#define I915_PARAM_MMAP_VERSION 30
349#define I915_PARAM_HAS_BSD2 31349#define I915_PARAM_HAS_BSD2 31
350#define I915_PARAM_REVISION 32350#define I915_PARAM_REVISION 32
351#define I915_PARAM_SUBSLICE_TOTAL 33
352#define I915_PARAM_EU_TOTAL 34
351 353
352typedef struct drm_i915_getparam {354typedef struct drm_i915_getparam {
353 int param;355 int param;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t