Skip to contentSkip to conversation

intel: Export pooled EU and min no. of eus in a pool.

PATCH In review Yang Rong 2 participants 4 messages Aug 2, 2016 – Sep 7, 2016 DRM drivers

lore
Share & tools
lore

Yang Rong

author
#0 lore raw

PATCH v3 1/1 intel: Export pooled EU and min no. of eus in a pool.

Update kernel interface with new I915_GETPARAM ioctl entries for pooled EU and min no. of eus in a pool. Add a wrapping function for each parameter. Userspace drivers need these values when decide the thread count. This kernel enabled pooled eu by default for BXT and for fused down 2x6 parts it is advised to turn it off.

But there is another HW issue in these parts (fused
down 2x6 parts) before C0 that requires Pooled EU to be enabled as a workaround. In this case the pool configuration changes depending upon which subslice is disabled and the no. of eus in a pool is different, So userspace need to know min no. of eus in a pool.

V2: use return value as the query results.
ret < 0 when error, ret = 0 when not support, and ret > 0 indicate query results.(Chris)
V3: Correct V2 errors.

---
 include/drm/i915_drm.h   |  2 ++
 intel/intel_bufmgr.h     |  3 +++
 intel/intel_bufmgr_gem.c | 30 ++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
include/drm/i915_drm.h +2 -0
index c4ce6b2..eb611a7 100644
@@ -357,6 +357,8 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_GPU_RESET	 35
 #define I915_PARAM_HAS_RESOURCE_STREAMER 36
 #define I915_PARAM_HAS_EXEC_SOFTPIN	 37
+#define I915_PARAM_HAS_POOLED_EU         38
+#define I915_PARAM_MIN_EU_IN_POOL        39
 
 typedef struct drm_i915_getparam {
 	__s32 param;
intel/intel_bufmgr.h +3 -0
index a1abbcd..96a4d9d 100644
@@ -273,6 +273,9 @@ int drm_intel_get_reset_stats(drm_intel_context *ctx,
 int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
 int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
 
+int drm_intel_get_pooled_eu(int fd);
+int drm_intel_get_min_eu_in_pool(int fd);
+
 /** @{ Compatibility defines to keep old code building despite the symbol rename
  * from dri_* to drm_intel_*
  */
intel/intel_bufmgr_gem.c +30 -0
index 0a4012b..b0a0eb9 100644
@@ -3237,6 +3237,36 @@ drm_intel_get_eu_total(int fd, unsigned int *eu_total)
 	return 0;
 }
 
+int
+drm_intel_get_pooled_eu(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_HAS_POOLED_EU;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
+int
+drm_intel_get_min_eu_in_pool(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_MIN_EU_IN_POOL;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
 /**
  * Annotate the given bo for use in aub dumping.
  *
Signature · 6 lines
2.1.4

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet
#1 lore raw

I sent a new version, could you check this and give comments/ACK?

Thanks,
Yang Rong

Quoted 106 lines

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of Yang Rong
Sent: Tuesday, August 2, 2016 15:51
To: [email protected]; [email protected]
Cc: Yang, Rong R <[email protected]>
Subject: [Beignet] [Patch V3] intel: Export pooled EU and min no. of eus in a pool.

Update kernel interface with new I915_GETPARAM ioctl entries for pooled EU and min no. of eus in a pool. Add a wrapping function for each parameter. Userspace drivers need these values when decide the thread count. This kernel enabled pooled eu by default for BXT and for fused down 2x6 parts it is advised to turn it off.

But there is another HW issue in these parts (fused down 2x6 parts) before C0 that requires Pooled EU to be enabled as a workaround. In this case the pool configuration changes depending upon which subslice is disabled and the no. of eus in a pool is different, So userspace need to know min no. of eus in a pool.

V2: use return value as the query results.
ret < 0 when error, ret = 0 when not support, and ret > 0 indicate query results.(Chris)
V3: Correct V2 errors.

---
 include/drm/i915_drm.h   |  2 ++
 intel/intel_bufmgr.h     |  3 +++
 intel/intel_bufmgr_gem.c | 30 ++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
include/drm/i915_drm.h index renamed from include/drm/i915_drm.h +0 -0

c4ce6b2..eb611a7 100644

include/drm/i915_drm.h +2 -0
@@ -357,6 +357,8 @@ typedef struct drm_i915_irq_wait {
 #define I915_PARAM_HAS_GPU_RESET	 35
 #define I915_PARAM_HAS_RESOURCE_STREAMER 36
 #define I915_PARAM_HAS_EXEC_SOFTPIN	 37
+#define I915_PARAM_HAS_POOLED_EU         38
+#define I915_PARAM_MIN_EU_IN_POOL        39
 
 typedef struct drm_i915_getparam {
 	__s32 param;
intel/intel_bufmgr.h index renamed from intel/intel_bufmgr.h +0 -0

a1abbcd..96a4d9d 100644

intel/intel_bufmgr.h +3 -0
@@ -273,6 +273,9 @@ int drm_intel_get_reset_stats(drm_intel_context
 *ctx,  int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
 int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
 
+int drm_intel_get_pooled_eu(int fd);
+int drm_intel_get_min_eu_in_pool(int fd);
+
 /** @{ Compatibility defines to keep old code building despite the symbol

rename
* from dri_* to drm_intel_*
*/

intel/intel_bufmgr_gem.c index renamed from intel/intel_bufmgr_gem.c +0 -0

0a4012b..b0a0eb9 100644

intel/intel_bufmgr_gem.c +30 -0
@@ -3237,6 +3237,36 @@ drm_intel_get_eu_total(int fd, unsigned int
 *eu_total)
 	return 0;
 }
 
+int
+drm_intel_get_pooled_eu(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_HAS_POOLED_EU;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
+int
+drm_intel_get_min_eu_in_pool(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_MIN_EU_IN_POOL;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
 /**
  * Annotate the given bo for use in aub dumping.

*
--
2.1.4

Quoted 4 lines

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

#2 lore raw
Quoted 2 lines · Rong R

I sent a new version, could you check this and give comments/ACK?

Cc Daniel, intel-gfx mailing list.

regards
Arun

Quoted 109 lines

Thanks,
Yang Rong

Quoted 106 lines

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of Yang Rong
Sent: Tuesday, August 2, 2016 15:51
To: [email protected]; [email protected]
Cc: Yang, Rong R <[email protected]>
Subject: [Beignet] [Patch V3] intel: Export pooled EU and min no. of eus in a pool.

Update kernel interface with new I915_GETPARAM ioctl entries for pooled EU and min no. of eus in a pool. Add a wrapping function for each parameter. Userspace drivers need these values when decide the thread count. This kernel enabled pooled eu by default for BXT and for fused down 2x6 parts it is advised to turn it off.

But there is another HW issue in these parts (fused down 2x6 parts) before C0 that requires Pooled EU to be enabled as a workaround. In this case the pool configuration changes depending upon which subslice is disabled and the no. of eus in a pool is different, So userspace need to know min no. of eus in a pool.

V2: use return value as the query results.
ret < 0 when error, ret = 0 when not support, and ret > 0 indicate query results.(Chris)
V3: Correct V2 errors.

---
  include/drm/i915_drm.h   |  2 ++
  intel/intel_bufmgr.h     |  3 +++
  intel/intel_bufmgr_gem.c | 30 ++++++++++++++++++++++++++++++
  3 files changed, 35 insertions(+)
include/drm/i915_drm.h index renamed from include/drm/i915_drm.h +0 -0

c4ce6b2..eb611a7 100644

include/drm/i915_drm.h +2 -0
@@ -357,6 +357,8 @@ typedef struct drm_i915_irq_wait {
  #define I915_PARAM_HAS_GPU_RESET	 35
  #define I915_PARAM_HAS_RESOURCE_STREAMER 36
  #define I915_PARAM_HAS_EXEC_SOFTPIN	 37
+#define I915_PARAM_HAS_POOLED_EU         38
+#define I915_PARAM_MIN_EU_IN_POOL        39
 
  typedef struct drm_i915_getparam {
  	__s32 param;
intel/intel_bufmgr.h index renamed from intel/intel_bufmgr.h +0 -0

a1abbcd..96a4d9d 100644

intel/intel_bufmgr.h +3 -0
@@ -273,6 +273,9 @@ int drm_intel_get_reset_stats(drm_intel_context
 *ctx,  int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
 int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
 
+int drm_intel_get_pooled_eu(int fd);
+int drm_intel_get_min_eu_in_pool(int fd);
+
  /** @{ Compatibility defines to keep old code building despite the symbol

rename
* from dri_* to drm_intel_*
*/

intel/intel_bufmgr_gem.c index renamed from intel/intel_bufmgr_gem.c +0 -0

0a4012b..b0a0eb9 100644

intel/intel_bufmgr_gem.c +30 -0
@@ -3237,6 +3237,36 @@ drm_intel_get_eu_total(int fd, unsigned int
 *eu_total)
  	return 0;
  }
 
+int
+drm_intel_get_pooled_eu(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_HAS_POOLED_EU;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
+int
+drm_intel_get_min_eu_in_pool(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_MIN_EU_IN_POOL;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
  /**
   * Annotate the given bo for use in aub dumping.
   *

--
2.1.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

#3 lore raw
In reply to Yang, Rong R
Quoted 75 lines · Rong R

I sent a new version, could you check this and give comments/ACK?

Thanks,
Yang Rong

Quoted 70 lines

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of Yang Rong
Sent: Tuesday, August 2, 2016 15:51
To: [email protected]; [email protected]
Cc: Yang, Rong R <[email protected]>
Subject: [Beignet] [Patch V3] intel: Export pooled EU and min no. of eus in a pool.

Update kernel interface with new I915_GETPARAM ioctl entries for pooled EU and min no. of eus in a pool. Add a wrapping function for each parameter. Userspace drivers need these values when decide the thread count. This kernel enabled pooled eu by default for BXT and for fused down 2x6 parts it is advised to turn it off.

But there is another HW issue in these parts (fused down 2x6 parts) before C0 that requires Pooled EU to be enabled as a workaround. In this case the pool configuration changes depending upon which subslice is disabled and the no. of eus in a pool is different, So userspace need to know min no. of eus in a pool.

V2: use return value as the query results.
ret < 0 when error, ret = 0 when not support, and ret > 0 indicate query results.(Chris)
V3: Correct V2 errors.

---
  include/drm/i915_drm.h   |  2 ++
  intel/intel_bufmgr.h     |  3 +++
  intel/intel_bufmgr_gem.c | 30 ++++++++++++++++++++++++++++++
  3 files changed, 35 insertions(+)
include/drm/i915_drm.h index renamed from include/drm/i915_drm.h +0 -0

c4ce6b2..eb611a7 100644

include/drm/i915_drm.h +2 -0
@@ -357,6 +357,8 @@ typedef struct drm_i915_irq_wait {
  #define I915_PARAM_HAS_GPU_RESET	 35
  #define I915_PARAM_HAS_RESOURCE_STREAMER 36
  #define I915_PARAM_HAS_EXEC_SOFTPIN	 37
+#define I915_PARAM_HAS_POOLED_EU         38
+#define I915_PARAM_MIN_EU_IN_POOL        39
 
  typedef struct drm_i915_getparam {
  	__s32 param;
intel/intel_bufmgr.h index renamed from intel/intel_bufmgr.h +0 -0

a1abbcd..96a4d9d 100644

intel/intel_bufmgr.h +3 -0
@@ -273,6 +273,9 @@ int drm_intel_get_reset_stats(drm_intel_context
 *ctx,  int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total);
 int drm_intel_get_eu_total(int fd, unsigned int *eu_total);
 
+int drm_intel_get_pooled_eu(int fd);
+int drm_intel_get_min_eu_in_pool(int fd);
+
  /** @{ Compatibility defines to keep old code building despite the symbol

rename
* from dri_* to drm_intel_*
*/

intel/intel_bufmgr_gem.c index renamed from intel/intel_bufmgr_gem.c +0 -0

0a4012b..b0a0eb9 100644

intel/intel_bufmgr_gem.c +0 -0
@@ -3237,6 +3237,36 @@ drm_intel_get_eu_total(int fd, unsigned int
 *eu_total)
  	return 0;
  }
 
Quoted 5 lines

intel/intel_bufmgr_gem.c drm_intel_get_eu_total(int fd, unsigned int *eu_total) · line 3244

Quoted 5 lines
intel/intel_bufmgr_gem.c +5 -0
+int
+drm_intel_get_pooled_eu(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;

with 'ret' initialized to -1 in both functions, this patch is now merged to libdrm.

Thanks Chris for the review and pushing it.

regards
Arun

Quoted 31 lines
Quoted 31 lines
intel/intel_bufmgr_gem.c +25 -0
+
+	memclear(gp);
+	gp.param = I915_PARAM_HAS_POOLED_EU;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
+int
+drm_intel_get_min_eu_in_pool(int fd)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memclear(gp);
+	gp.param = I915_PARAM_MIN_EU_IN_POOL;
+	gp.value = &ret;
+	if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp))
+		return -errno;
+
+	return ret;
+}
+
  /**
   * Annotate the given bo for use in aub dumping.
   *

--
2.1.4

Quoted 9 lines
Quoted 4 lines

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet