From patchwork Wed Jun 15 08:19:54 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: 9177689 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 4113E60776 for ; Wed, 15 Jun 2016 06:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31A522831B for ; Wed, 15 Jun 2016 06:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25F5228347; Wed, 15 Jun 2016 06:49:39 +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 D6E1B2831B for ; Wed, 15 Jun 2016 06:49:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2E196E84C; Wed, 15 Jun 2016 06:49:37 +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 A79A06E00E; Wed, 15 Jun 2016 06:49:25 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 14 Jun 2016 23:49:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,475,1459839600"; d="scan'208";a="828356493" Received: from yr-ivb.sh.intel.com ([10.239.159.103]) by orsmga003.jf.intel.com with ESMTP; 14 Jun 2016 23:49:24 -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:54 +0800 Message-Id: <1465978794-30792-2-git-send-email-rong.r.yang@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465978794-30792-1-git-send-email-rong.r.yang@intel.com> References: <1465978794-30792-1-git-send-email-rong.r.yang@intel.com> Subject: [Intel-gfx] [PATCH] intel: Export pooled EU and min no. of eus in a pool. 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 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. Signed-off-by: Yang Rong --- include/drm/i915_drm.h | 2 ++ intel/intel_bufmgr.h | 3 +++ intel/intel_bufmgr_gem.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index c4ce6b2..eb611a7 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -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; diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index a1abbcd..8370694 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -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, unsigned int *has_pooled_eu); +int drm_intel_get_min_eu_in_pool(int fd, unsigned int *min_eu); + /** @{ Compatibility defines to keep old code building despite the symbol rename * from dri_* to drm_intel_* */ diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 0a4012b..b8bb654 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -3237,6 +3237,38 @@ drm_intel_get_eu_total(int fd, unsigned int *eu_total) return 0; } +int +drm_intel_get_pooled_eu(int fd, unsigned int *has_pooled_eu) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)has_pooled_eu; + gp.param = I915_PARAM_HAS_POOLED_EU; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} + +int +drm_intel_get_min_eu_in_pool(int fd, unsigned int *min_eu) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)min_eu; + gp.param = I915_PARAM_MIN_EU_IN_POOL; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} + /** * Annotate the given bo for use in aub dumping. *