From patchwork Tue Oct 11 15:38:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sripada, Radhakrishna" X-Patchwork-Id: 13004120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 01AE6C433FE for ; Tue, 11 Oct 2022 15:40:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D344E10E81E; Tue, 11 Oct 2022 15:39:46 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BBF310E81E; Tue, 11 Oct 2022 15:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665502781; x=1697038781; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qugFPqyrKp2dvC4lex1KAYAs4NlXmCknPxIeyZaAxoc=; b=CrEIE4N6C2SiibaChD7OkaerbYyUVODAmXgSaljD0gLPVqdIVhBHc+2n FnkLN+l/nhyCPec2JExlelz7TnOPfuylRfyP1wJAAvW2wykw18Z7mkBLz 1v3ak7TYUqU3mI6yHtwjtmvSqKlKbJ4XAx3biKfEzp96NYYhJqHK62Ibt ryDOb+8XHcjifZ5ztsrGY4TkzLwd1mck8gsHQG9FVq10isiAiNbE66pI+ Wrh5BHBXhgk408PIlDRL8hgkgIJdFZ4QvDh+NZqVSZbdVzh6cZjX5ALJb GmSK6JhNCYs8IXVZzpYSKuf0Adb7bPLXVeLLdkDfNMqnsGEhF6iCmQ5FU w==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="305591630" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="305591630" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:39:26 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="768839274" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="768839274" Received: from invictus.jf.intel.com ([10.165.21.201]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:39:26 -0700 From: Radhakrishna Sripada To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 1/2] drm/i915: Add intel_ prefix to struct ip_version Date: Tue, 11 Oct 2022 08:38:50 -0700 Message-Id: <20221011153851.3781507-1-radhakrishna.sripada@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Radhakrishna Sripada Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rename struct ip_version to intel_ip_version to comply with the naming conventions for structures. Suggested-by: Jani Nikula Signed-off-by: Radhakrishna Sripada Reviewed-by: Lucas De Marchi --- drivers/gpu/drm/i915/intel_device_info.c | 2 +- drivers/gpu/drm/i915/intel_device_info.h | 8 ++++---- drivers/gpu/drm/i915/intel_step.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c index 090097bb3c0a..37267c662dc6 100644 --- a/drivers/gpu/drm/i915/intel_device_info.c +++ b/drivers/gpu/drm/i915/intel_device_info.c @@ -289,7 +289,7 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915) RUNTIME_INFO(i915)->platform_mask[pi] |= mask; } -static void ip_ver_read(struct drm_i915_private *i915, u32 offset, struct ip_version *ip) +static void ip_ver_read(struct drm_i915_private *i915, u32 offset, struct intel_ip_version *ip) { struct pci_dev *pdev = to_pci_dev(i915->drm.dev); void __iomem *addr; diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h index bc87d3156b14..0a37c0a3edc5 100644 --- a/drivers/gpu/drm/i915/intel_device_info.h +++ b/drivers/gpu/drm/i915/intel_device_info.h @@ -196,7 +196,7 @@ enum intel_ppgtt_type { func(overlay_needs_physical); \ func(supports_tv); -struct ip_version { +struct intel_ip_version { u8 ver; u8 rel; u8 step; @@ -208,13 +208,13 @@ struct intel_runtime_info { * render, compute and copy behavior. */ struct { - struct ip_version ip; + struct intel_ip_version ip; } graphics; struct { - struct ip_version ip; + struct intel_ip_version ip; } media; struct { - struct ip_version ip; + struct intel_ip_version ip; } display; /* diff --git a/drivers/gpu/drm/i915/intel_step.c b/drivers/gpu/drm/i915/intel_step.c index 91e7c51991b0..75d7a86c60c0 100644 --- a/drivers/gpu/drm/i915/intel_step.c +++ b/drivers/gpu/drm/i915/intel_step.c @@ -136,7 +136,7 @@ static const struct intel_step_info adlp_n_revids[] = { }; static u8 gmd_to_intel_step(struct drm_i915_private *i915, - struct ip_version *gmd) + struct intel_ip_version *gmd) { u8 step = gmd->step + STEP_A0; From patchwork Tue Oct 11 15:38:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sripada, Radhakrishna" X-Patchwork-Id: 13004121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 03C8DC433FE for ; Tue, 11 Oct 2022 15:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 757CD10E874; Tue, 11 Oct 2022 15:39:47 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 67CF910E380; Tue, 11 Oct 2022 15:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665502781; x=1697038781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rt5TN++QcPZFbsjfvyDFQ96+McN98i7Ji8Gsdhl57AU=; b=niOu+zNzFuZ2FiU4YBLqX0FvUG8vscU4Yexa9rzdZp8tXIOxVuyRwefO 3Ph6Z/VQLWm8RKn6z+wVdZHGJ2hif/hfcv5pmUl5j1fQmgU8LUeegTNYr R/+sK8oLFt8y/8bp+feDqS1XBRRXMWj/qYbK8lqj4IEID/74uuQ0Jz6o1 hl+9fye0C2JGTTPzhQoJ7YytiM+VUckt6Cws6nCaFtlAMlJXzC8YPoxXt SQuwI2ivBEzKZB/IfDCLXhCv4GJW/EZ4r3XJVu8t7D3kVNYekqwOCjLaF peeHUEWt7dTkSu961skI5fxnUOjhU8oh4ruMugNoVs7fakPIJZc7hhNrZ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="305591637" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="305591637" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:39:31 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10497"; a="768839296" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="768839296" Received: from invictus.jf.intel.com ([10.165.21.201]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 08:39:31 -0700 From: Radhakrishna Sripada To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 2/2] drm/i915: Use graphics ver, rel info for media on old platforms Date: Tue, 11 Oct 2022 08:38:51 -0700 Message-Id: <20221011153851.3781507-2-radhakrishna.sripada@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221011153851.3781507-1-radhakrishna.sripada@intel.com> References: <20221011153851.3781507-1-radhakrishna.sripada@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Radhakrishna Sripada , Lucas De Marchi , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Platforms prior to MTL do not have a separate media and graphics version. On platforms where GMD id is not supported, reuse the graphics ip version, release info for media. The rest of the IP graphics, display versions would be copied during driver creation. While at it warn if GMD is not used for platforms greater than gen12. v2: - Use simple assignment to copy contents of the structure(JaniN) Fixes: c2c7075225ef ("drm/i915: Read graphics/media/display arch version from hw") Cc: Jani Nikula Cc: Lucas De Marchi Cc: Matt Roper Cc: Ville Syrjälä Signed-off-by: Radhakrishna Sripada Reviewed-by: Lucas De Marchi --- drivers/gpu/drm/i915/intel_device_info.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c index 37267c662dc6..1dc1fb29a776 100644 --- a/drivers/gpu/drm/i915/intel_device_info.c +++ b/drivers/gpu/drm/i915/intel_device_info.c @@ -329,8 +329,16 @@ static void intel_ipver_early_init(struct drm_i915_private *i915) { struct intel_runtime_info *runtime = RUNTIME_INFO(i915); - if (!HAS_GMD_ID(i915)) + if (!HAS_GMD_ID(i915)) { + drm_WARN_ON(&i915->drm, RUNTIME_INFO(i915)->graphics.ip.ver > 12); + /* + * On older platforms, graphics and media share the same ip + * version and release. + */ + RUNTIME_INFO(i915)->media.ip = + RUNTIME_INFO(i915)->graphics.ip; return; + } ip_ver_read(i915, i915_mmio_reg_offset(GMD_ID_GRAPHICS), &runtime->graphics.ip);