From patchwork Thu Jul 8 23:18:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srivatsa, Anusha" X-Patchwork-Id: 12366327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBBDDC11F6C for ; Thu, 8 Jul 2021 23:18:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99400613E1 for ; Thu, 8 Jul 2021 23:18:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99400613E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0547A6E976; Thu, 8 Jul 2021 23:18:37 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id C37666E93B for ; Thu, 8 Jul 2021 23:18:27 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10039"; a="209578466" X-IronPort-AV: E=Sophos;i="5.84,225,1620716400"; d="scan'208";a="209578466" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2021 16:18:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,225,1620716400"; d="scan'208";a="482707942" Received: from anushasr-mobl6.jf.intel.com ([10.165.21.155]) by fmsmga004.fm.intel.com with ESMTP; 08 Jul 2021 16:18:27 -0700 From: Anusha Srivatsa To: intel-gfx@lists.freedesktop.org Date: Thu, 8 Jul 2021 16:18:20 -0700 Message-Id: <20210708231821.9163-10-anusha.srivatsa@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210708231821.9163-1-anusha.srivatsa@intel.com> References: <20210708231821.9163-1-anusha.srivatsa@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 09/10] drm/i915/step: Add intel_step_name() helper X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add a helper to convert the step info to string. This is specifically useful when we want to load a specific firmware for a given stepping/substepping combination. Suggested-by: Jani Nikula Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/i915/intel_step.c | 58 +++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_step.h | 1 + 2 files changed, 59 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_step.c b/drivers/gpu/drm/i915/intel_step.c index 99c0d3df001b..9af7f30b777e 100644 --- a/drivers/gpu/drm/i915/intel_step.c +++ b/drivers/gpu/drm/i915/intel_step.c @@ -182,3 +182,61 @@ void intel_step_init(struct drm_i915_private *i915) RUNTIME_INFO(i915)->step = step; } + +const char *intel_step_name(enum intel_step step) { + switch (step) { + case STEP_A0: + return "A0"; + break; + case STEP_A1: + return "A1"; + break; + case STEP_A2: + return "A2"; + break; + case STEP_B0: + return "B0"; + break; + case STEP_B1: + return "B1"; + break; + case STEP_B2: + return "B2"; + break; + case STEP_C0: + return "C0"; + break; + case STEP_C1: + return "C1"; + break; + case STEP_D0: + return "D0"; + break; + case STEP_D1: + return "D1"; + break; + case STEP_E0: + return "E0"; + break; + case STEP_F0: + return "F0"; + break; + case STEP_G0: + return "G0"; + break; + case STEP_H0: + return "H0"; + break; + case STEP_I0: + return "I0"; + break; + case STEP_I1: + return "I1"; + break; + case STEP_J0: + return "J0"; + break; + default: + return "**"; + } +} diff --git a/drivers/gpu/drm/i915/intel_step.h b/drivers/gpu/drm/i915/intel_step.h index 3e8b2babd9da..2fbe51483472 100644 --- a/drivers/gpu/drm/i915/intel_step.h +++ b/drivers/gpu/drm/i915/intel_step.h @@ -43,5 +43,6 @@ enum intel_step { }; void intel_step_init(struct drm_i915_private *i915); +const char *intel_step_name(enum intel_step step); #endif /* __INTEL_STEP_H__ */