From patchwork Wed Jun 15 08:19:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Rong R" X-Patchwork-Id: 9177687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6299960776 for ; Wed, 15 Jun 2016 06:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50DDE2831B for ; Wed, 15 Jun 2016 06:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 449A428347; Wed, 15 Jun 2016 06:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E98B12831B for ; Wed, 15 Jun 2016 06:49:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D610C6E00E; Wed, 15 Jun 2016 06:49:26 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 913016E00E; Wed, 15 Jun 2016 06:49:24 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 14 Jun 2016 23:49:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="828356485" Received: from yr-ivb.sh.intel.com ([10.239.159.103]) by orsmga003.jf.intel.com with ESMTP; 14 Jun 2016 23:49:23 -0700 From: Yang Rong To: beignet@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, arun.siluvery@linux.intel.com Date: Wed, 15 Jun 2016 16:19:53 +0800 Message-Id: <1465978794-30792-1-git-send-email-rong.r.yang@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [Intel-gfx] [PATCH] Runtime: set the sub slice according to kernel pooled EU configure. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;