diff mbox

Runtime: set the sub slice according to kernel pooled EU configure.

Message ID 1465978794-30792-1-git-send-email-rong.r.yang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang, Rong R June 15, 2016, 8:19 a.m. UTC
If BXT pooled EU enable, the 3*6 EUs is split into 2 pooled, so change
the sub slice to 2.
For min no. of eu in pool, only affact fused down 2*6 BXT devices,
because beignet don't support these devices now, add assert only.
assert.

This patch is based on kernel patch: https://patchwork.freedesktop.org/series/8200/
Thanks Arun.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
---
 CMakeLists.txt           | 12 ++++++++++++
 src/CMakeLists.txt       | 10 ++++++++++
 src/intel/intel_driver.c | 15 +++++++++++++++
 3 files changed, 37 insertions(+)

Comments

Song, Ruiling June 30, 2016, 8:43 a.m. UTC | #1
LGTM

Ruiling

> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Yang Rong
> Sent: Wednesday, June 15, 2016 4:20 PM
> To: beignet@lists.freedesktop.org; intel-gfx@lists.freedesktop.org;
> arun.siluvery@linux.intel.com
> Subject: [Intel-gfx] [PATCH] Runtime: set the sub slice according to kernel
> pooled EU configure.
> 
> If BXT pooled EU enable, the 3*6 EUs is split into 2 pooled, so change
> the sub slice to 2.
> For min no. of eu in pool, only affact fused down 2*6 BXT devices,
> because beignet don't support these devices now, add assert only.
> assert.
> 
> This patch is based on kernel patch:
> https://patchwork.freedesktop.org/series/8200/
> Thanks Arun.
> 
> Signed-off-by: Yang Rong <rong.r.yang@intel.com>
> ---
>  CMakeLists.txt           | 12 ++++++++++++
>  src/CMakeLists.txt       | 10 ++++++++++
>  src/intel/intel_driver.c | 15 +++++++++++++++
>  3 files changed, 37 insertions(+)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index fae3e88..af684ed 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -153,6 +153,18 @@ IF(DRM_INTEL_FOUND)
>    ELSE(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>      MESSAGE(STATUS "Disable subslice total query support")
>    ENDIF(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
> +  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_pooled_eu" ""
> HAVE_DRM_INTEL_POOLED_EU)
> +  IF(HAVE_DRM_INTEL_POOLED_EU)
> +    MESSAGE(STATUS "Enable pooled eu query support")
> +  ELSE(HAVE_DRM_INTEL_POOLED_EU)
> +    MESSAGE(STATUS "Disable pooled eu query support")
> +  ENDIF(HAVE_DRM_INTEL_POOLED_EU)
> +  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_min_eu_in_pool" ""
> HAVE_DRM_INTEL_MIN_EU_IN_POOL)
> +  IF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
> +    MESSAGE(STATUS "Enable min eu in pool query support")
> +  ELSE(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
> +    MESSAGE(STATUS "Disable min eu in pool query support")
> +  ENDIF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>  ELSE(DRM_INTEL_FOUND)
>    MESSAGE(FATAL_ERROR "Looking for DRM Intel (>= 2.4.52) - not found")
>  ENDIF(DRM_INTEL_FOUND)
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 98f8423..a002865 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -138,6 +138,16 @@ if (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>    SET(CMAKE_C_FLAGS "-DHAS_SUBSLICE_TOTAL ${CMAKE_C_FLAGS}")
>  endif (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
> 
> +if (HAVE_DRM_INTEL_POOLED_EU)
> +  SET(CMAKE_CXX_FLAGS "-DHAS_POOLED_EU ${CMAKE_CXX_FLAGS}")
> +  SET(CMAKE_C_FLAGS "-DHAS_POOLED_EU ${CMAKE_C_FLAGS}")
> +endif (HAVE_DRM_INTEL_POOLED_EU)
> +
> +if (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
> +  SET(CMAKE_CXX_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_CXX_FLAGS}")
> +  SET(CMAKE_C_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_C_FLAGS}")
> +endif (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
> +
>  set(GIT_SHA1 "git_sha1.h")
>  add_custom_target(${GIT_SHA1} ALL
>    COMMAND chmod +x ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.sh
> diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
> index 03d9d34..8f2373b 100644
> --- a/src/intel/intel_driver.c
> +++ b/src/intel/intel_driver.c
> @@ -882,6 +882,21 @@ intel_update_device_info(cl_device_id device)
>  #endif
>    }
>  #endif
> +
> +#ifdef HAS_POOLED_EU
> +  /* BXT pooled eu, 3*6 to 2*9, like sub slice count is 2 */
> +  unsigned int has_pooled_eu = 0;
> +  if(!drm_intel_get_pooled_eu(driver->fd, &has_pooled_eu) && has_pooled_eu)
> +    device->sub_slice_count = 2;
> +
> +#ifdef HAS_MIN_EU_IN_POOL
> +  unsigned int min_eu;
> +  /* for fused down 2x6 devices, beignet don't support. */
> +  if (has_pooled_eu && !drm_intel_get_min_eu_in_pool(driver->fd, &min_eu)) {
> +    assert(min_eu == 9); //don't support fuse down device.
> +  }
> +#endif //HAS_MIN_EU_IN_POOL
> +#endif //HAS_POOLED_EU
>    //We should get the device memory dynamically, but the
>    //mapablce mem size usage is unknown. Just ignore it.
>    size_t total_mem,map_mem;
> --
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
arun.siluvery@linux.intel.com July 1, 2016, 1:44 p.m. UTC | #2
On 30/06/2016 09:43, Song, Ruiling wrote:
> LGTM
>
> Ruiling

Could you please let me know whether these patches are merged/yet to be 
merged?

I have submitted kernel patch which is ready to be merged but we would 
like to know if userspace bits are merged or not?

https://lists.freedesktop.org/archives/intel-gfx/2016-July/099822.html

regards
Arun

>
>> -----Original Message-----
>> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
>> Yang Rong
>> Sent: Wednesday, June 15, 2016 4:20 PM
>> To: beignet@lists.freedesktop.org; intel-gfx@lists.freedesktop.org;
>> arun.siluvery@linux.intel.com
>> Subject: [Intel-gfx] [PATCH] Runtime: set the sub slice according to kernel
>> pooled EU configure.
>>
>> If BXT pooled EU enable, the 3*6 EUs is split into 2 pooled, so change
>> the sub slice to 2.
>> For min no. of eu in pool, only affact fused down 2*6 BXT devices,
>> because beignet don't support these devices now, add assert only.
>> assert.
>>
>> This patch is based on kernel patch:
>> https://patchwork.freedesktop.org/series/8200/
>> Thanks Arun.
>>
>> Signed-off-by: Yang Rong <rong.r.yang@intel.com>
>> ---
>>   CMakeLists.txt           | 12 ++++++++++++
>>   src/CMakeLists.txt       | 10 ++++++++++
>>   src/intel/intel_driver.c | 15 +++++++++++++++
>>   3 files changed, 37 insertions(+)
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index fae3e88..af684ed 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -153,6 +153,18 @@ IF(DRM_INTEL_FOUND)
>>     ELSE(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>>       MESSAGE(STATUS "Disable subslice total query support")
>>     ENDIF(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>> +  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_pooled_eu" ""
>> HAVE_DRM_INTEL_POOLED_EU)
>> +  IF(HAVE_DRM_INTEL_POOLED_EU)
>> +    MESSAGE(STATUS "Enable pooled eu query support")
>> +  ELSE(HAVE_DRM_INTEL_POOLED_EU)
>> +    MESSAGE(STATUS "Disable pooled eu query support")
>> +  ENDIF(HAVE_DRM_INTEL_POOLED_EU)
>> +  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_min_eu_in_pool" ""
>> HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>> +  IF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>> +    MESSAGE(STATUS "Enable min eu in pool query support")
>> +  ELSE(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>> +    MESSAGE(STATUS "Disable min eu in pool query support")
>> +  ENDIF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>>   ELSE(DRM_INTEL_FOUND)
>>     MESSAGE(FATAL_ERROR "Looking for DRM Intel (>= 2.4.52) - not found")
>>   ENDIF(DRM_INTEL_FOUND)
>> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
>> index 98f8423..a002865 100644
>> --- a/src/CMakeLists.txt
>> +++ b/src/CMakeLists.txt
>> @@ -138,6 +138,16 @@ if (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>>     SET(CMAKE_C_FLAGS "-DHAS_SUBSLICE_TOTAL ${CMAKE_C_FLAGS}")
>>   endif (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
>>
>> +if (HAVE_DRM_INTEL_POOLED_EU)
>> +  SET(CMAKE_CXX_FLAGS "-DHAS_POOLED_EU ${CMAKE_CXX_FLAGS}")
>> +  SET(CMAKE_C_FLAGS "-DHAS_POOLED_EU ${CMAKE_C_FLAGS}")
>> +endif (HAVE_DRM_INTEL_POOLED_EU)
>> +
>> +if (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>> +  SET(CMAKE_CXX_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_CXX_FLAGS}")
>> +  SET(CMAKE_C_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_C_FLAGS}")
>> +endif (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
>> +
>>   set(GIT_SHA1 "git_sha1.h")
>>   add_custom_target(${GIT_SHA1} ALL
>>     COMMAND chmod +x ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.sh
>> diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
>> index 03d9d34..8f2373b 100644
>> --- a/src/intel/intel_driver.c
>> +++ b/src/intel/intel_driver.c
>> @@ -882,6 +882,21 @@ intel_update_device_info(cl_device_id device)
>>   #endif
>>     }
>>   #endif
>> +
>> +#ifdef HAS_POOLED_EU
>> +  /* BXT pooled eu, 3*6 to 2*9, like sub slice count is 2 */
>> +  unsigned int has_pooled_eu = 0;
>> +  if(!drm_intel_get_pooled_eu(driver->fd, &has_pooled_eu) && has_pooled_eu)
>> +    device->sub_slice_count = 2;
>> +
>> +#ifdef HAS_MIN_EU_IN_POOL
>> +  unsigned int min_eu;
>> +  /* for fused down 2x6 devices, beignet don't support. */
>> +  if (has_pooled_eu && !drm_intel_get_min_eu_in_pool(driver->fd, &min_eu)) {
>> +    assert(min_eu == 9); //don't support fuse down device.
>> +  }
>> +#endif //HAS_MIN_EU_IN_POOL
>> +#endif //HAS_POOLED_EU
>>     //We should get the device memory dynamically, but the
>>     //mapablce mem size usage is unknown. Just ignore it.
>>     size_t total_mem,map_mem;
>> --
>> 2.1.4
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
diff mbox

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fae3e88..af684ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -153,6 +153,18 @@  IF(DRM_INTEL_FOUND)
   ELSE(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
     MESSAGE(STATUS "Disable subslice total query support")
   ENDIF(HAVE_DRM_INTEL_SUBSLICE_TOTAL)
+  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_pooled_eu" "" HAVE_DRM_INTEL_POOLED_EU)
+  IF(HAVE_DRM_INTEL_POOLED_EU)
+    MESSAGE(STATUS "Enable pooled eu query support")
+  ELSE(HAVE_DRM_INTEL_POOLED_EU)
+    MESSAGE(STATUS "Disable pooled eu query support")
+  ENDIF(HAVE_DRM_INTEL_POOLED_EU)
+  CHECK_LIBRARY_EXISTS(drm_intel "drm_intel_get_min_eu_in_pool" "" HAVE_DRM_INTEL_MIN_EU_IN_POOL)
+  IF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
+    MESSAGE(STATUS "Enable min eu in pool query support")
+  ELSE(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
+    MESSAGE(STATUS "Disable min eu in pool query support")
+  ENDIF(HAVE_DRM_INTEL_MIN_EU_IN_POOL)
 ELSE(DRM_INTEL_FOUND)
   MESSAGE(FATAL_ERROR "Looking for DRM Intel (>= 2.4.52) - not found")
 ENDIF(DRM_INTEL_FOUND)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 98f8423..a002865 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -138,6 +138,16 @@  if (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
   SET(CMAKE_C_FLAGS "-DHAS_SUBSLICE_TOTAL ${CMAKE_C_FLAGS}")
 endif (HAVE_DRM_INTEL_SUBSLICE_TOTAL)
 
+if (HAVE_DRM_INTEL_POOLED_EU)
+  SET(CMAKE_CXX_FLAGS "-DHAS_POOLED_EU ${CMAKE_CXX_FLAGS}")
+  SET(CMAKE_C_FLAGS "-DHAS_POOLED_EU ${CMAKE_C_FLAGS}")
+endif (HAVE_DRM_INTEL_POOLED_EU)
+
+if (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
+  SET(CMAKE_CXX_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_CXX_FLAGS}")
+  SET(CMAKE_C_FLAGS "-DHAS_MIN_EU_IN_POOL ${CMAKE_C_FLAGS}")
+endif (HAVE_DRM_INTEL_MIN_EU_IN_POOL)
+
 set(GIT_SHA1 "git_sha1.h")
 add_custom_target(${GIT_SHA1} ALL
   COMMAND chmod +x ${CMAKE_CURRENT_SOURCE_DIR}/git_sha1.sh
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index 03d9d34..8f2373b 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -882,6 +882,21 @@  intel_update_device_info(cl_device_id device)
 #endif
   }
 #endif
+
+#ifdef HAS_POOLED_EU
+  /* BXT pooled eu, 3*6 to 2*9, like sub slice count is 2 */
+  unsigned int has_pooled_eu = 0;
+  if(!drm_intel_get_pooled_eu(driver->fd, &has_pooled_eu) && has_pooled_eu)
+    device->sub_slice_count = 2;
+
+#ifdef HAS_MIN_EU_IN_POOL
+  unsigned int min_eu;
+  /* for fused down 2x6 devices, beignet don't support. */
+  if (has_pooled_eu && !drm_intel_get_min_eu_in_pool(driver->fd, &min_eu)) {
+    assert(min_eu == 9); //don't support fuse down device.
+  }
+#endif //HAS_MIN_EU_IN_POOL
+#endif //HAS_POOLED_EU
   //We should get the device memory dynamically, but the
   //mapablce mem size usage is unknown. Just ignore it.
   size_t total_mem,map_mem;