From patchwork Fri Jun 8 13:42:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 10454517 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 6FEBA60159 for ; Fri, 8 Jun 2018 13:42:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7220D2944D for ; Fri, 8 Jun 2018 13:42:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 666D12945C; Fri, 8 Jun 2018 13:42:31 +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 B41352944D for ; Fri, 8 Jun 2018 13:42:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80E986E0BF; Fri, 8 Jun 2018 13:42: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 675C36E0BF for ; Fri, 8 Jun 2018 13:42:28 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 06:42:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,490,1520924400"; d="scan'208";a="55193257" Received: from rosetta.fi.intel.com ([10.237.72.186]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2018 06:42:25 -0700 Received: by rosetta.fi.intel.com (Postfix, from userid 1000) id 57FBF8400DB; Fri, 8 Jun 2018 16:42:08 +0300 (EEST) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Fri, 8 Jun 2018 16:42:02 +0300 Message-Id: <20180608134205.6452-2-mika.kuoppala@linux.intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180608134205.6452-1-mika.kuoppala@linux.intel.com> References: <20180608134205.6452-1-mika.kuoppala@linux.intel.com> Subject: [Intel-gfx] [PATCH 2/5] 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) v3: comment, eyesore fix (Chris), cfl fix, squash Suggested-by: Chris Wilson Cc: Joonas Lahtinen Cc: Chris Wilson Cc: Tomi Sarvela Cc: Jani Nikula Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.c | 6 +++--- drivers/gpu/drm/i915/i915_pci.c | 10 ++++++++-- drivers/gpu/drm/i915/intel_chipset.h | 7 +++++++ drivers/gpu/drm/i915/intel_device_info.h | 10 ++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index be71fdf8d92e..86725c272251 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -852,13 +852,13 @@ static void i915_workqueues_cleanup(struct drm_i915_private *dev_priv) */ static void intel_detect_preproduction_hw(struct drm_i915_private *dev_priv) { + const struct intel_device_info *info = INTEL_INFO(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(info) != 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_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 97a91e6af7e3..60a02082055c 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_PRODUCT, \ 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_PRODUCT, .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_PRODUCT 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 = 0x00 /* cfl doesn't use revids */ static const struct intel_device_info intel_coffeelake_gt1_info = { CFL_PLATFORM, diff --git a/drivers/gpu/drm/i915/intel_chipset.h b/drivers/gpu/drm/i915/intel_chipset.h index 0e71571fb4c1..a917ab40f857 100644 --- a/drivers/gpu/drm/i915/intel_chipset.h +++ b/drivers/gpu/drm/i915/intel_chipset.h @@ -127,6 +127,10 @@ #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 @@ -134,6 +138,7 @@ #define SKL_REVID_E0 0x4 #define SKL_REVID_F0 0x5 #define SKL_REVID_G0 0x6 +#define SKL_REVID_PRODUCT SKL_REVID_G0 #define SKL_REVID_H0 0x7 #define IS_SKL_REVID(p, since, until) (IS_SKYLAKE(p) && IS_REVID(p, since, until)) @@ -143,12 +148,14 @@ #define BXT_REVID_B0 0x3 #define BXT_REVID_B_LAST 0x8 #define BXT_REVID_C0 0x9 +#define BXT_REVID_PRODUCT BXT_REVID_C0 #define IS_BXT_REVID(dev_priv, since, until) \ (IS_BROXTON(dev_priv) && IS_REVID(dev_priv, since, until)) #define KBL_REVID_A0 0x0 #define KBL_REVID_B0 0x1 +#define KBL_REVID_PRODUCT KBL_REVID_B0 #define KBL_REVID_C0 0x2 #define KBL_REVID_D0 0x3 #define KBL_REVID_E0 0x4 diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index 933e31669557..64ec283003dd 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -146,6 +146,16 @@ struct intel_device_info { u16 device_id; u16 gen_mask; + /* + * First known production hardware pci revision id, or: + * - uninitialized (0x00): no known preliminary hw, (gen < 9) + * - PRODUCT_REVID_UNKNOWN (0xff): no known production hw yet (gen >= 9) + * + * Do not set first product revid unless you are certain that testing + * infrastructure is already on top of production revid machines. + */ + u8 first_product_revid; + u8 gen; u8 gt; /* GT number, 0 if undefined */ u8 num_rings;