From patchwork Fri Jun 8 08:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 10453979 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 3A86260159 for ; Fri, 8 Jun 2018 08:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26B1F294D8 for ; Fri, 8 Jun 2018 08:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A982294DB; Fri, 8 Jun 2018 08:39: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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C6D6294D8 for ; Fri, 8 Jun 2018 08:39:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02B296E15A; Fri, 8 Jun 2018 08:39:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B4946E15A for ; Fri, 8 Jun 2018 08:39:28 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 01:39:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="61450517" Received: from rosetta.fi.intel.com ([10.237.72.186]) by fmsmga004.fm.intel.com with ESMTP; 08 Jun 2018 01:39:25 -0700 Received: by rosetta.fi.intel.com (Postfix, from userid 1000) id AA0EE8407C8; Fri, 8 Jun 2018 11:39:08 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Jun 2018 11:39:06 +0300 Message-Id: <20180608083906.6006-1-mika.kuoppala@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180607174117.28402-1-mika.kuoppala@linux.intel.com> References: <20180607174117.28402-1-mika.kuoppala@linux.intel.com> Subject: [Intel-gfx] [PATCH 1/6] drm/i915: Store first production revid into device info X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Sarvela , Jani Nikula MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Store first known production revid into the device info. This enables us to easily see if we are running on a preproduction hardware. Uninitialized (zero) product revision id means that there are no known preliminary hardware for this platform, or that the platform is of gen that we don't care. This is all pre gen9 platforms. Unknown product revision maps to REVID_FOREVER on a gen9+ platforms on default. When the platform gets the first production revision and our testing infra is cleaned from preproduction hardware, we can set a first production revid. At that point we start to complain about running driver on preliminary hardware. v2: initialize GEN9_FEATURES too (CI) Suggested-by: Chris Wilson Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Tomi Sarvela Cc: Jani Nikula Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_drv.c | 6 +++--- drivers/gpu/drm/i915/i915_drv.h | 7 +++++++ drivers/gpu/drm/i915/i915_pci.c | 10 ++++++++-- drivers/gpu/drm/i915/intel_device_info.h | 11 +++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index be71fdf8d92e..92f244c12f1e 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -855,10 +855,10 @@ static void intel_detect_preproduction_hw(struct drm_i915_private *dev_priv) bool pre = false; pre |= IS_HSW_EARLY_SDV(dev_priv); - pre |= IS_SKL_REVID(dev_priv, 0, SKL_REVID_F0); - pre |= IS_BXT_REVID(dev_priv, 0, BXT_REVID_B_LAST); + pre |= IS_PREPRODUCTION_HW(dev_priv); - if (pre) { + if (pre && FIRST_PRODUCT_REVID(INTEL_INFO(dev_priv)) + != PRODUCT_REVID_UNKNOWN) { DRM_ERROR("This is a pre-production stepping. " "It may not be fully functional.\n"); add_taint(TAINT_MACHINE_CHECK, LOCKDEP_STILL_OK); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c4073666f1ca..abca814ad758 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2430,6 +2430,10 @@ intel_info(const struct drm_i915_private *dev_priv) #define IS_ALPHA_SUPPORT(intel_info) ((intel_info)->is_alpha_support) +#define PRODUCT_REVID_UNKNOWN REVID_FOREVER +#define FIRST_PRODUCT_REVID(intel_info) ((intel_info)->first_product_revid) +#define IS_PREPRODUCTION_HW(dev_priv) (INTEL_REVID(dev_priv) < FIRST_PRODUCT_REVID(INTEL_INFO(dev_priv))) + #define SKL_REVID_A0 0x0 #define SKL_REVID_B0 0x1 #define SKL_REVID_C0 0x2 @@ -2461,6 +2465,7 @@ intel_info(const struct drm_i915_private *dev_priv) #define GLK_REVID_A0 0x0 #define GLK_REVID_A1 0x1 +#define GLK_REVID_B0 0x3 #define IS_GLK_REVID(dev_priv, since, until) \ (IS_GEMINILAKE(dev_priv) && IS_REVID(dev_priv, since, until)) @@ -2468,6 +2473,8 @@ intel_info(const struct drm_i915_private *dev_priv) #define CNL_REVID_A0 0x0 #define CNL_REVID_B0 0x1 #define CNL_REVID_C0 0x2 +#define CNL_REVID_D0 0x4 +#define CNL_REVID_G0 0x5 #define IS_CNL_REVID(p, since, until) \ (IS_CANNONLAKE(p) && IS_REVID(p, since, until)) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 97a91e6af7e3..ae4a5a0b0c28 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -461,10 +461,12 @@ static const struct intel_device_info intel_cherryview_info = { .has_csr = 1, \ .has_guc = 1, \ .has_ipc = 1, \ + .first_product_revid = PRODUCT_REVID_UNKNOWN, \ .ddb_size = 896 #define SKL_PLATFORM \ GEN9_FEATURES, \ + .first_product_revid = SKL_REVID_G0, \ PLATFORM(INTEL_SKYLAKE) static const struct intel_device_info intel_skylake_gt1_info = { @@ -518,6 +520,7 @@ static const struct intel_device_info intel_skylake_gt4_info = { .has_reset_engine = 1, \ .has_snoop = true, \ .has_ipc = 1, \ + .first_product_revid = PRODUCT_REVID_UNKNOWN, \ GEN9_DEFAULT_PAGE_SIZES, \ GEN_DEFAULT_PIPEOFFSETS, \ IVB_CURSOR_OFFSETS, \ @@ -526,6 +529,7 @@ static const struct intel_device_info intel_skylake_gt4_info = { static const struct intel_device_info intel_broxton_info = { GEN9_LP_FEATURES, PLATFORM(INTEL_BROXTON), + .first_product_revid = BXT_REVID_C0, .ddb_size = 512, }; @@ -538,7 +542,8 @@ static const struct intel_device_info intel_geminilake_info = { #define KBL_PLATFORM \ GEN9_FEATURES, \ - PLATFORM(INTEL_KABYLAKE) + PLATFORM(INTEL_KABYLAKE), \ + .first_product_revid = KBL_REVID_B0 static const struct intel_device_info intel_kabylake_gt1_info = { KBL_PLATFORM, @@ -558,7 +563,8 @@ static const struct intel_device_info intel_kabylake_gt3_info = { #define CFL_PLATFORM \ GEN9_FEATURES, \ - PLATFORM(INTEL_COFFEELAKE) + PLATFORM(INTEL_COFFEELAKE), \ + .first_product_revid = KBL_REVID_B0 static const struct intel_device_info intel_coffeelake_gt1_info = { CFL_PLATFORM, diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index 933e31669557..9ae9dc553192 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -146,6 +146,17 @@ struct intel_device_info { u16 device_id; u16 gen_mask; + u8 first_product_revid; + /* Set to corresponding first production hardware revision or: + * + * 0x00 == uninitialized == no known preliminary hw (legacy gens) + * 0xff == PRODUCT_REVID_UNKNOWN == no known production hw yet + * + * Do not set first product revid unless you are certain + * that testing infrastructure is already on top of production + * revid machines. + */ + u8 gen; u8 gt; /* GT number, 0 if undefined */ u8 num_rings;