public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Export total subslice and EU counts
@ 2015-03-02 23:37 jeff.mcgee
  2015-03-03  1:26 ` Jeff McGee
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: jeff.mcgee @ 2015-03-02 23:37 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

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.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 drivers/gpu/drm/i915/i915_dma.c | 10 ++++++++++
 include/uapi/drm/i915_drm.h     |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 053e178..9350ea2 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -150,6 +150,16 @@ static int i915_getparam(struct drm_device *dev, void *data,
 	case I915_PARAM_MMAP_VERSION:
 		value = 1;
 		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:
 		DRM_DEBUG("Unknown parameter %d\n", param->param);
 		return -EINVAL;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 6eed16b..8672efc 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -347,6 +347,8 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
 #define I915_PARAM_MMAP_VERSION          30
 #define I915_PARAM_HAS_BSD2		 31
+#define I915_PARAM_SUBSLICE_TOTAL	 32
+#define I915_PARAM_EU_TOTAL		 33
 
 typedef struct drm_i915_getparam {
 	int param;
-- 
2.3.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-13 17:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-02 23:37 [PATCH] drm/i915: Export total subslice and EU counts jeff.mcgee
2015-03-03  1:26 ` Jeff McGee
2015-03-03  8:54 ` Daniel Vetter
2015-03-03  8:56   ` Daniel Vetter
2015-03-04  0:32 ` shuang.he
2015-03-05  4:35 ` Zhigang Gong
2015-03-06 18:44   ` [Beignet] " Jeff McGee
2015-03-09  0:10     ` Zhigang Gong
2015-03-13 17:03       ` [Beignet] " Daniel Vetter
2015-03-06 19:23   ` Jeff McGee
2015-03-09 23:06 ` [PATCH v2] " jeff.mcgee
2015-03-10  7:34   ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox