From patchwork Tue Jun 18 14:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702460 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 7FE05C2BD05 for ; Tue, 18 Jun 2024 14:23:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB5B510E6AE; Tue, 18 Jun 2024 14:23:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="FxKN2nUU"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C64F10E6AC; Tue, 18 Jun 2024 14:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720589; x=1750256589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KWEGNgh9gFbIFi42tYLXu+xv/HtJHzLfqvYKaYY9HZE=; b=FxKN2nUUqMgwKCzfltu9Fa0ccuIDJlL0CyeUqpER6dc7je2s9MsyOLvq 5bwz0IKo+hqv4gqNOLZEhtuN2xmJWB/IBac6wLTheA6yO+t9OpsAEZxIQ DKdDyQrC2gZUXRi8oId6SBn9An95bspe2MmBlkYWDgmeGHxlZEmwEEmzg lVfxOZ0w7UCEzWeGYPIa2moHfqa6B2ZkC413Qe1Oae/TBahhQzs15ZdyZ 3J1AMfYTa7sCmoypcb94yP12Y0FgwToWYdckBsACgsVXPb8gkIB6M5jHp doccVw9jHG3hIJqGFPNwiqxKfSzhDrAEtHv8cA+n00fB/0fjfECV2+nJd Q==; X-CSE-ConnectionGUID: RMBk0M/CSquyOl+FYF9D2Q== X-CSE-MsgGUID: Cb21krk4TpKvjnGWjLoQ3A== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15365274" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="15365274" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:09 -0700 X-CSE-ConnectionGUID: RPAQU3wqShmgOLSAxfLSyA== X-CSE-MsgGUID: xhadKhwTT0u83i04kxwJBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41495458" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:06 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 1/6] drm/i915/display: use a macro to initialize subplatforms Date: Tue, 18 Jun 2024 17:22:51 +0300 Message-Id: <03025d8bbb5036abd4c670b052f20a273feac62f.1718719962.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Make it easier to change the underlying structures by using a macro similar to PLATFORM() for initialization. The subplatform names in debug logs change slightly as they now reflect the enum rather than manually entered names. For example, RAPTORLAKE_S rather than RPL-S. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../drm/i915/display/intel_display_device.c | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index dd7dce4b0e7a..d900c30907ac 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -26,6 +26,10 @@ struct subplatform_desc { const u16 *pciidlist; }; +#define SUBPLATFORM(_platform, _subplatform) \ + .subplatform = (INTEL_DISPLAY_##_platform##_##_subplatform), \ + .name = #_subplatform + struct platform_desc { enum intel_display_platform platform; const char *name; @@ -485,8 +489,8 @@ static const u16 hsw_ulx_ids[] = { static const struct platform_desc hsw_desc = { PLATFORM(HASWELL), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_HASWELL_ULT, "ULT", hsw_ult_ids }, - { INTEL_DISPLAY_HASWELL_ULX, "ULX", hsw_ulx_ids }, + { SUBPLATFORM(HASWELL, ULT), .pciidlist = hsw_ult_ids }, + { SUBPLATFORM(HASWELL, ULX), .pciidlist = hsw_ulx_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -529,8 +533,8 @@ static const u16 bdw_ulx_ids[] = { static const struct platform_desc bdw_desc = { PLATFORM(BROADWELL), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_BROADWELL_ULT, "ULT", bdw_ult_ids }, - { INTEL_DISPLAY_BROADWELL_ULX, "ULX", bdw_ulx_ids }, + { SUBPLATFORM(BROADWELL, ULT), .pciidlist = bdw_ult_ids }, + { SUBPLATFORM(BROADWELL, ULX), .pciidlist = bdw_ulx_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -613,8 +617,8 @@ static const u16 skl_ulx_ids[] = { static const struct platform_desc skl_desc = { PLATFORM(SKYLAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_SKYLAKE_ULT, "ULT", skl_ult_ids }, - { INTEL_DISPLAY_SKYLAKE_ULX, "ULX", skl_ulx_ids }, + { SUBPLATFORM(SKYLAKE, ULT), .pciidlist = skl_ult_ids }, + { SUBPLATFORM(SKYLAKE, ULX), .pciidlist = skl_ulx_ids }, {}, }, .info = &skl_display, @@ -637,8 +641,8 @@ static const u16 kbl_ulx_ids[] = { static const struct platform_desc kbl_desc = { PLATFORM(KABYLAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_KABYLAKE_ULT, "ULT", kbl_ult_ids }, - { INTEL_DISPLAY_KABYLAKE_ULX, "ULX", kbl_ulx_ids }, + { SUBPLATFORM(KABYLAKE, ULT), .pciidlist = kbl_ult_ids }, + { SUBPLATFORM(KABYLAKE, ULX), .pciidlist = kbl_ulx_ids }, {}, }, .info = &skl_display, @@ -661,8 +665,8 @@ static const u16 cfl_ulx_ids[] = { static const struct platform_desc cfl_desc = { PLATFORM(COFFEELAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_COFFEELAKE_ULT, "ULT", cfl_ult_ids }, - { INTEL_DISPLAY_COFFEELAKE_ULX, "ULX", cfl_ulx_ids }, + { SUBPLATFORM(COFFEELAKE, ULT), .pciidlist = cfl_ult_ids }, + { SUBPLATFORM(COFFEELAKE, ULX), .pciidlist = cfl_ulx_ids }, {}, }, .info = &skl_display, @@ -677,7 +681,7 @@ static const u16 cml_ult_ids[] = { static const struct platform_desc cml_desc = { PLATFORM(COMETLAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_COMETLAKE_ULT, "ULT", cml_ult_ids }, + { SUBPLATFORM(COMETLAKE, ULT), .pciidlist = cml_ult_ids }, {}, }, .info = &skl_display, @@ -776,7 +780,7 @@ static const u16 icl_port_f_ids[] = { static const struct platform_desc icl_desc = { PLATFORM(ICELAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_ICELAKE_PORT_F, "Port F", icl_port_f_ids }, + { SUBPLATFORM(ICELAKE, PORT_F), .pciidlist = icl_port_f_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -853,7 +857,7 @@ static const u16 tgl_uy_ids[] = { static const struct platform_desc tgl_desc = { PLATFORM(TIGERLAKE), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_TIGERLAKE_UY, "UY", tgl_uy_ids }, + { SUBPLATFORM(TIGERLAKE, UY), .pciidlist = tgl_uy_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -902,7 +906,7 @@ static const u16 adls_rpls_ids[] = { static const struct platform_desc adl_s_desc = { PLATFORM(ALDERLAKE_S), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_ALDERLAKE_S_RAPTORLAKE_S, "RPL-S", adls_rpls_ids }, + { SUBPLATFORM(ALDERLAKE_S, RAPTORLAKE_S), .pciidlist = adls_rpls_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -989,9 +993,9 @@ static const u16 adlp_rplp_ids[] = { static const struct platform_desc adl_p_desc = { PLATFORM(ALDERLAKE_P), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_ALDERLAKE_P_ALDERLAKE_N, "ADL-N", adlp_adln_ids }, - { INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_U, "RPL-U", adlp_rplu_ids }, - { INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_P, "RPL-P", adlp_rplp_ids }, + { SUBPLATFORM(ALDERLAKE_P, ALDERLAKE_N), .pciidlist = adlp_adln_ids }, + { SUBPLATFORM(ALDERLAKE_P, RAPTORLAKE_U), .pciidlist = adlp_rplu_ids }, + { SUBPLATFORM(ALDERLAKE_P, RAPTORLAKE_P), .pciidlist = adlp_rplp_ids }, {}, }, .info = &xe_lpd_display, @@ -1026,9 +1030,9 @@ static const u16 dg2_g12_ids[] = { static const struct platform_desc dg2_desc = { PLATFORM(DG2), .subplatforms = (const struct subplatform_desc[]) { - { INTEL_DISPLAY_DG2_G10, "G10", dg2_g10_ids }, - { INTEL_DISPLAY_DG2_G11, "G11", dg2_g11_ids }, - { INTEL_DISPLAY_DG2_G12, "G12", dg2_g12_ids }, + { SUBPLATFORM(DG2, G10), .pciidlist = dg2_g10_ids }, + { SUBPLATFORM(DG2, G11), .pciidlist = dg2_g11_ids }, + { SUBPLATFORM(DG2, G12), .pciidlist = dg2_g12_ids }, {}, }, .info = &xe_hpd_display, From patchwork Tue Jun 18 14:22:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702461 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 9BD6AC2BA18 for ; Tue, 18 Jun 2024 14:23:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E735B10E6A8; Tue, 18 Jun 2024 14:23:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="f3CPO7XN"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE9E110E6A8; Tue, 18 Jun 2024 14:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720611; x=1750256611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZX2q7x1xELWxdenDQFdd87uxo0nF74j4AC4BA6EUryE=; b=f3CPO7XNfh0GCNHKsZVrsg1m38UquEFHc6bIe/Zsob54TJyeGXxLfK7l yBD0thCVhRiG8WjkeMQ0/pc5ybP2MxMclHxDvzXHGil+4fT35Cawh324P EHpG/X9AkcFjZtjnC6r6EPC9zD+uE8hlgWjQZ131r9KBQomulkVXwiIGL 8QnTBS62m49bO9xlEOvxPkjFAjdUgUFTi2NEN/vjOiUqwZPRhYlgc6vok LC7UnoSgtsGvb3/jZjIoxdTTJ3nPPTwEsltNokY/Ce8X4huubm9dr+2gy uOdRX5dxqiP973x1KEVEZ4BE7hvqewiw/ZtaXL2OqGxNU/jW+oEM0FaPn w==; X-CSE-ConnectionGUID: vhBQjUmGTOm0Kh+DWWFQLA== X-CSE-MsgGUID: oVbjdSvQS5qD1ypTfHaauQ== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15365299" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="15365299" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:15 -0700 X-CSE-ConnectionGUID: fly57UsYQxCS9IoHyX8qLA== X-CSE-MsgGUID: IZP5i8LWQLycKoux2b3AzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41495475" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:12 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 2/6] drm/i915/display: use a macro to define platform enumerations Date: Tue, 18 Jun 2024 17:22:52 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" We'll be needing a macro based list of platforms for more things in the future. Start by defining the platform enumerations with it. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../drm/i915/display/intel_display_device.h | 115 ++++++++++-------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 13453ea4daea..aca3dfd5e7af 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -15,63 +15,70 @@ struct drm_i915_private; struct drm_printer; /* Keep in gen based order, and chronological order within a gen */ +#define INTEL_DISPLAY_PLATFORMS(func) \ + func(PLATFORM_UNINITIALIZED) \ + /* Display ver 2 */ \ + func(I830) \ + func(I845G) \ + func(I85X) \ + func(I865G) \ + /* Display ver 3 */ \ + func(I915G) \ + func(I915GM) \ + func(I945G) \ + func(I945GM) \ + func(G33) \ + func(PINEVIEW) \ + /* Display ver 4 */ \ + func(I965G) \ + func(I965GM) \ + func(G45) \ + func(GM45) \ + /* Display ver 5 */ \ + func(IRONLAKE) \ + /* Display ver 6 */ \ + func(SANDYBRIDGE) \ + /* Display ver 7 */ \ + func(IVYBRIDGE) \ + func(VALLEYVIEW) \ + func(HASWELL) \ + /* Display ver 8 */ \ + func(BROADWELL) \ + func(CHERRYVIEW) \ + /* Display ver 9 */ \ + func(SKYLAKE) \ + func(BROXTON) \ + func(KABYLAKE) \ + func(GEMINILAKE) \ + func(COFFEELAKE) \ + func(COMETLAKE) \ + /* Display ver 11 */ \ + func(ICELAKE) \ + func(JASPERLAKE) \ + func(ELKHARTLAKE) \ + /* Display ver 12 */ \ + func(TIGERLAKE) \ + func(ROCKETLAKE) \ + func(DG1) \ + func(ALDERLAKE_S) \ + /* Display ver 13 */ \ + func(ALDERLAKE_P) \ + func(DG2) \ + /* Display ver 14 (based on GMD ID) */ \ + func(METEORLAKE) \ + /* Display ver 20 (based on GMD ID) */ \ + func(LUNARLAKE) \ + /* Display ver 14.1 (based on GMD ID) */ \ + func(BATTLEMAGE) + +#define ENUM(x) INTEL_DISPLAY_ ## x, + enum intel_display_platform { - INTEL_DISPLAY_PLATFORM_UNINITIALIZED = 0, - /* Display ver 2 */ - INTEL_DISPLAY_I830, - INTEL_DISPLAY_I845G, - INTEL_DISPLAY_I85X, - INTEL_DISPLAY_I865G, - /* Display ver 3 */ - INTEL_DISPLAY_I915G, - INTEL_DISPLAY_I915GM, - INTEL_DISPLAY_I945G, - INTEL_DISPLAY_I945GM, - INTEL_DISPLAY_G33, - INTEL_DISPLAY_PINEVIEW, - /* Display ver 4 */ - INTEL_DISPLAY_I965G, - INTEL_DISPLAY_I965GM, - INTEL_DISPLAY_G45, - INTEL_DISPLAY_GM45, - /* Display ver 5 */ - INTEL_DISPLAY_IRONLAKE, - /* Display ver 6 */ - INTEL_DISPLAY_SANDYBRIDGE, - /* Display ver 7 */ - INTEL_DISPLAY_IVYBRIDGE, - INTEL_DISPLAY_VALLEYVIEW, - INTEL_DISPLAY_HASWELL, - /* Display ver 8 */ - INTEL_DISPLAY_BROADWELL, - INTEL_DISPLAY_CHERRYVIEW, - /* Display ver 9 */ - INTEL_DISPLAY_SKYLAKE, - INTEL_DISPLAY_BROXTON, - INTEL_DISPLAY_KABYLAKE, - INTEL_DISPLAY_GEMINILAKE, - INTEL_DISPLAY_COFFEELAKE, - INTEL_DISPLAY_COMETLAKE, - /* Display ver 11 */ - INTEL_DISPLAY_ICELAKE, - INTEL_DISPLAY_JASPERLAKE, - INTEL_DISPLAY_ELKHARTLAKE, - /* Display ver 12 */ - INTEL_DISPLAY_TIGERLAKE, - INTEL_DISPLAY_ROCKETLAKE, - INTEL_DISPLAY_DG1, - INTEL_DISPLAY_ALDERLAKE_S, - /* Display ver 13 */ - INTEL_DISPLAY_ALDERLAKE_P, - INTEL_DISPLAY_DG2, - /* Display ver 14 (based on GMD ID) */ - INTEL_DISPLAY_METEORLAKE, - /* Display ver 20 (based on GMD ID) */ - INTEL_DISPLAY_LUNARLAKE, - /* Display ver 14.1 (based on GMD ID) */ - INTEL_DISPLAY_BATTLEMAGE, + INTEL_DISPLAY_PLATFORMS(ENUM) }; +#undef ENUM + enum intel_display_subplatform { INTEL_DISPLAY_SUBPLATFORM_UNINITIALIZED = 0, INTEL_DISPLAY_HASWELL_ULT, From patchwork Tue Jun 18 14:22:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702462 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 914F6C2BA18 for ; Tue, 18 Jun 2024 14:23:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2178510E6B1; Tue, 18 Jun 2024 14:23:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="WOdrLs2n"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0351F10E6AF; Tue, 18 Jun 2024 14:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720614; x=1750256614; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eqzp0UIeFDdm6i16hkas4t202GRI0dEzo2njO9rF7FU=; b=WOdrLs2n+2/nC307Te+qGWMOEamhnam2ydArF81oGH+QAjyNyui7GVhZ i5Ph/bmzLhD5ods11VckKVP8YhtXyw+ihfGuUancyn8fOhsU3U67noUYS d1V792fjhy5RgRw8QPfPhCbw46NN+vF7YVUI3h3HJKtndo4+ktRvlGCMo VkZKCVW1+8UAgjk1sSxweD6UXwCbfC5j79CHrsZ9cp3FdNrOaJ9K0ud2Y 9hxqm2KJrCc8Rxotjj3YzoHvfNgcArNQDdm7UJ/MJ+LD1kczA7oqs5Cid eu1D5Jn3Wscf0ZgBGgNSzHQgJKGghgt/pHNHq1ZVzXh5ajNWMstDpSYQR g==; X-CSE-ConnectionGUID: PKuioJmiSBaSFdYJJOCLWQ== X-CSE-MsgGUID: W9fULUJmTMWmCY1nKzNsPw== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15365334" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="15365334" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:21 -0700 X-CSE-ConnectionGUID: jtLi4Fs5Sgmt1TXNXjcNGw== X-CSE-MsgGUID: q02BdYV1TB6FoWB2CsrDfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41495499" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:19 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 3/6] drm/i915/display: join the platform and subplatform macros Date: Tue, 18 Jun 2024 17:22:53 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" We'll want to use the subplatforms similar to platforms. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../drm/i915/display/intel_display_device.c | 2 +- .../drm/i915/display/intel_display_device.h | 51 +++++++++---------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index d900c30907ac..80563af7ac71 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -21,7 +21,7 @@ __diag_push(); __diag_ignore_all("-Woverride-init", "Allow field initialization overrides for display info"); struct subplatform_desc { - enum intel_display_subplatform subplatform; + enum intel_display_platform subplatform; const char *name; const u16 *pciidlist; }; diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index aca3dfd5e7af..50485235ef09 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -69,7 +69,29 @@ struct drm_printer; /* Display ver 20 (based on GMD ID) */ \ func(LUNARLAKE) \ /* Display ver 14.1 (based on GMD ID) */ \ - func(BATTLEMAGE) + func(BATTLEMAGE) \ + /* Subplatforms */ \ + func(HASWELL_ULT) \ + func(HASWELL_ULX) \ + func(BROADWELL_ULT) \ + func(BROADWELL_ULX) \ + func(SKYLAKE_ULT) \ + func(SKYLAKE_ULX) \ + func(KABYLAKE_ULT) \ + func(KABYLAKE_ULX) \ + func(COFFEELAKE_ULT) \ + func(COFFEELAKE_ULX) \ + func(COMETLAKE_ULT) \ + func(COMETLAKE_ULX) \ + func(ICELAKE_PORT_F) \ + func(TIGERLAKE_UY) \ + func(ALDERLAKE_S_RAPTORLAKE_S) \ + func(ALDERLAKE_P_ALDERLAKE_N) \ + func(ALDERLAKE_P_RAPTORLAKE_P) \ + func(ALDERLAKE_P_RAPTORLAKE_U) \ + func(DG2_G10) \ + func(DG2_G11) \ + func(DG2_G12) #define ENUM(x) INTEL_DISPLAY_ ## x, @@ -79,31 +101,6 @@ enum intel_display_platform { #undef ENUM -enum intel_display_subplatform { - INTEL_DISPLAY_SUBPLATFORM_UNINITIALIZED = 0, - INTEL_DISPLAY_HASWELL_ULT, - INTEL_DISPLAY_HASWELL_ULX, - INTEL_DISPLAY_BROADWELL_ULT, - INTEL_DISPLAY_BROADWELL_ULX, - INTEL_DISPLAY_SKYLAKE_ULT, - INTEL_DISPLAY_SKYLAKE_ULX, - INTEL_DISPLAY_KABYLAKE_ULT, - INTEL_DISPLAY_KABYLAKE_ULX, - INTEL_DISPLAY_COFFEELAKE_ULT, - INTEL_DISPLAY_COFFEELAKE_ULX, - INTEL_DISPLAY_COMETLAKE_ULT, - INTEL_DISPLAY_COMETLAKE_ULX, - INTEL_DISPLAY_ICELAKE_PORT_F, - INTEL_DISPLAY_TIGERLAKE_UY, - INTEL_DISPLAY_ALDERLAKE_S_RAPTORLAKE_S, - INTEL_DISPLAY_ALDERLAKE_P_ALDERLAKE_N, - INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_P, - INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_U, - INTEL_DISPLAY_DG2_G10, - INTEL_DISPLAY_DG2_G11, - INTEL_DISPLAY_DG2_G12, -}; - #define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \ /* Keep in alphabetical order */ \ func(cursor_needs_physical); \ @@ -203,7 +200,7 @@ enum intel_display_subplatform { struct intel_display_runtime_info { enum intel_display_platform platform; - enum intel_display_subplatform subplatform; + enum intel_display_platform subplatform; struct intel_display_ip_ver { u16 ver; From patchwork Tue Jun 18 14:22:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702463 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 A42EFC27C4F for ; Tue, 18 Jun 2024 14:23:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25F1410E6AF; Tue, 18 Jun 2024 14:23:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="PxXMCHFy"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14E4010E6AF; Tue, 18 Jun 2024 14:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720615; x=1750256615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=upKXWPwi2BtW7PrTUNAs1L4bzshoUcajeg9JE5KQ2IQ=; b=PxXMCHFy1lRVMR4VJ82g+8gmH94Rblvu4LL7yPTzSVn/dyNOWCSLLlke VqINmsAfZfKlLna44GergHsuGcdqV41U6wp4hK/UVcMF0l0q9wh15NdVd rglXFrKFAIUfwsG8rdvH8n1y4DittJjew9mQfjLsU8ngXFTI5n8MBaC+e viYkXGMRJEDI3HppydlfcDE6XQJtqaLLSOvjb5lKH0fdnFkk8g6qIkTiD lWk+8Impz20jjB+yWBoED6DXrNNTPesfqHXp00zVlgHI3l2nwpBQf2tEI cI3LJgp7hmnjHVGwm/KQeMB/MPB33sxWhx5JzQUZhKefkpq8LCtenqAKd g==; X-CSE-ConnectionGUID: ZUdmNQsCQ8O/7LO8/cWQ5g== X-CSE-MsgGUID: hvBmWvW7QrCHNebzkiGrUA== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="15365365" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="15365365" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:28 -0700 X-CSE-ConnectionGUID: y+3pPsEHRA2CA2r5i5HrCA== X-CSE-MsgGUID: D9bI22UPR6qy9tAHjiLLww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41495525" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:25 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 4/6] drm/i915/display: add "display is" structure with platform members Date: Tue, 18 Jun 2024 17:22:54 +0300 Message-Id: <80e564e550bc0972c9e0199f1a361a99545ab81b.1718719962.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 structure with a bitfield member for each platform and subplatform, and initialize them in platform and subplatform descs. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_display_device.c | 8 ++++++-- drivers/gpu/drm/i915/display/intel_display_device.h | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 80563af7ac71..0c275d85bd30 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -21,6 +21,7 @@ __diag_push(); __diag_ignore_all("-Woverride-init", "Allow field initialization overrides for display info"); struct subplatform_desc { + struct intel_display_is is; enum intel_display_platform subplatform; const char *name; const u16 *pciidlist; @@ -28,9 +29,11 @@ struct subplatform_desc { #define SUBPLATFORM(_platform, _subplatform) \ .subplatform = (INTEL_DISPLAY_##_platform##_##_subplatform), \ - .name = #_subplatform + .name = #_subplatform, \ + .is._platform##_##_subplatform = 1 struct platform_desc { + struct intel_display_is is; enum intel_display_platform platform; const char *name; const struct subplatform_desc *subplatforms; @@ -39,7 +42,8 @@ struct platform_desc { #define PLATFORM(_platform) \ .platform = (INTEL_DISPLAY_##_platform), \ - .name = #_platform + .name = #_platform, \ + .is._platform = 1 #define ID(id) (id) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 50485235ef09..73070c8487ff 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -101,6 +101,14 @@ enum intel_display_platform { #undef ENUM +#define MEMBER(name) u32 name:1; + +struct intel_display_is { + INTEL_DISPLAY_PLATFORMS(MEMBER); +}; + +#undef MEMBER + #define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \ /* Keep in alphabetical order */ \ func(cursor_needs_physical); \ From patchwork Tue Jun 18 14:22:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702464 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 A8E56C2BB85 for ; Tue, 18 Jun 2024 14:23:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D3E510E6B5; Tue, 18 Jun 2024 14:23:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XQFFMoLy"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id A18CF10E6AF; Tue, 18 Jun 2024 14:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720615; x=1750256615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MIMY9hVL2JJyBQ934Nwvo2GD8BNSJZVlDYWJFJkWPL0=; b=XQFFMoLy0/3mLSUwYskAaGY2TVwQOJc8BEfsQHDUG/ZiQmq8Ed/uQhXz s+96Qc83Nb6QzlZOQN20jwfeWpIV6+wOpCLYhATgwXoyM6h+Y/hk8IeOH MIEpU3bffXLRnbqVlnxMxX2tRXSNWlF+iIKOvxbolMD6o/yd1OfHf4S93 n4zzUjDoEUiWY9TMnPCOLcfv6rw03fl+MQwVO/zcBhRe7hXaIkpn+uqHt gQu4QVmpjua4Kg90D3Y/LBYyzue0GLB8P14KcPNpQ+C1EKu5gCOjj+I4S yh8ytR18Ae++ilbylzvM3cJRIz3HSgGERNzTUiKIsjtsxy7PDMyBBgmcI g==; X-CSE-ConnectionGUID: vUnsQvCHRaW9VKvZwhSAcw== X-CSE-MsgGUID: JP6dfvQuSvWKLqJi5Wb47Q== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="27016879" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="27016879" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:34 -0700 X-CSE-ConnectionGUID: b9lCNE9QSxSMJvEnRJ0uVg== X-CSE-MsgGUID: 6uJhAhl0Qg2AU/JjnndwVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41687819" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:31 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 5/6] drm/i915/display: add "is" member to struct intel_display Date: Tue, 18 Jun 2024 17:22:55 +0300 Message-Id: <450b5883a7783d0967c3da8ce853af0c2da8082f.1718719962.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" Facilitate using display->is.HASWELL etc. for identifying platforms and subplatforms. Merge platform and subplatform members together. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../gpu/drm/i915/display/intel_display_core.h | 3 +++ .../drm/i915/display/intel_display_device.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h index 7715fc329057..35bea92893af 100644 --- a/drivers/gpu/drm/i915/display/intel_display_core.h +++ b/drivers/gpu/drm/i915/display/intel_display_core.h @@ -286,6 +286,9 @@ struct intel_display { /* drm device backpointer */ struct drm_device *drm; + /* Platform identification */ + struct intel_display_is is; + /* Display functions */ struct { /* Top level crtc-ish functions */ diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 0c275d85bd30..954caea38005 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -1269,8 +1269,25 @@ find_subplatform_desc(struct pci_dev *pdev, const struct platform_desc *desc) return NULL; } +static void mem_or(void *_dst, const void *_src, size_t size) +{ + const u8 *src = _src; + u8 *dst = _dst; + size_t i; + + for (i = 0; i < size; i++) + dst[i] |= src[i]; +} + +static void merge_display_is(struct intel_display_is *dst, + const struct intel_display_is *src) +{ + mem_or(dst, src, sizeof(*dst)); +} + void intel_display_device_probe(struct drm_i915_private *i915) { + struct intel_display *display = &i915->display; struct pci_dev *pdev = to_pci_dev(i915->drm.dev); const struct intel_display_device_info *info; struct intel_display_ip_ver ip_ver = {}; @@ -1308,11 +1325,13 @@ void intel_display_device_probe(struct drm_i915_private *i915) drm_WARN_ON(&i915->drm, !desc->platform || !desc->name); DISPLAY_RUNTIME_INFO(i915)->platform = desc->platform; + display->is = desc->is; subdesc = find_subplatform_desc(pdev, desc); if (subdesc) { drm_WARN_ON(&i915->drm, !subdesc->subplatform || !subdesc->name); DISPLAY_RUNTIME_INFO(i915)->subplatform = subdesc->subplatform; + merge_display_is(&display->is, &subdesc->is); } if (ip_ver.ver || ip_ver.rel || ip_ver.step) From patchwork Tue Jun 18 14:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13702465 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 3CD51C27C4F for ; Tue, 18 Jun 2024 14:23:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8859910E6B9; Tue, 18 Jun 2024 14:23:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="THNT4DLP"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2D1810E6B7; Tue, 18 Jun 2024 14:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718720620; x=1750256620; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=11GmTxZaDLJIPN1u8UDPB0RE+kNDxZfY5bbOPj5AIAk=; b=THNT4DLPrX7CYYcQtefMeI7rFdMtZNFcNmiZYQo7ZXEXgnCEh+GZ1KhT lVRCcc+UZp2iCKbds7hXHl+/oXqYm4wIuMgzBqQuVrQgeSPIU2N3N8kRa idZImGoesjLGwDlA0QgIZpheDbkVXjW5srol+oKkiwKBnw7SfQPQDlyo8 2cNt1zGjz3ynGYNtKSy+Z96mVYFTuvUTF/86rUYl/XdUhkTQ00Z4d+SfC yDFeuFkymG5sskp+crbLln0Qob6C6o41lAbIO/D53twJX2uhPeS67dmvM yDt4rgGCFGXrKIt8HGRw3RW6ws4secsYB42pHmBUbjIPztYUdL1frEU8R Q==; X-CSE-ConnectionGUID: BIcF2owNRq6HqMQTpjQ5nw== X-CSE-MsgGUID: hddM6/e/Qc+heGHvjUwcdQ== X-IronPort-AV: E=McAfee;i="6700,10204,11107"; a="27016885" X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="27016885" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:40 -0700 X-CSE-ConnectionGUID: /M9gn+uKRGe9LXDVeAKDVw== X-CSE-MsgGUID: u1HJGlu1TDqTuLKBiJekpg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,247,1712646000"; d="scan'208";a="41687859" Received: from bergbenj-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.176]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2024 07:23:37 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, lucas.demarchi@intel.com Subject: [PATCH 6/6] drm/i915/display: remove the display platform enum as unnecessary Date: Tue, 18 Jun 2024 17:22:56 +0300 Message-Id: <323aa570a2cf58cede7fa0ca8bb46a273bad3395.1718719962.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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" The display platform enums are not really needed for anything. Remove. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_display_device.c | 12 +++--------- drivers/gpu/drm/i915/display/intel_display_device.h | 11 ----------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 954caea38005..6a71e7a8b686 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -22,26 +22,22 @@ __diag_ignore_all("-Woverride-init", "Allow field initialization overrides for d struct subplatform_desc { struct intel_display_is is; - enum intel_display_platform subplatform; const char *name; const u16 *pciidlist; }; #define SUBPLATFORM(_platform, _subplatform) \ - .subplatform = (INTEL_DISPLAY_##_platform##_##_subplatform), \ .name = #_subplatform, \ .is._platform##_##_subplatform = 1 struct platform_desc { struct intel_display_is is; - enum intel_display_platform platform; const char *name; const struct subplatform_desc *subplatforms; const struct intel_display_device_info *info; /* NULL for GMD ID */ }; #define PLATFORM(_platform) \ - .platform = (INTEL_DISPLAY_##_platform), \ .name = #_platform, \ .is._platform = 1 @@ -1261,7 +1257,7 @@ find_subplatform_desc(struct pci_dev *pdev, const struct platform_desc *desc) const struct subplatform_desc *sp; const u16 *id; - for (sp = desc->subplatforms; sp && sp->subplatform; sp++) + for (sp = desc->subplatforms; sp && sp->pciidlist; sp++) for (id = sp->pciidlist; *id; id++) if (*id == pdev->device) return sp; @@ -1323,14 +1319,12 @@ void intel_display_device_probe(struct drm_i915_private *i915) &DISPLAY_INFO(i915)->__runtime_defaults, sizeof(*DISPLAY_RUNTIME_INFO(i915))); - drm_WARN_ON(&i915->drm, !desc->platform || !desc->name); - DISPLAY_RUNTIME_INFO(i915)->platform = desc->platform; + drm_WARN_ON(&i915->drm, !desc->name); display->is = desc->is; subdesc = find_subplatform_desc(pdev, desc); if (subdesc) { - drm_WARN_ON(&i915->drm, !subdesc->subplatform || !subdesc->name); - DISPLAY_RUNTIME_INFO(i915)->subplatform = subdesc->subplatform; + drm_WARN_ON(&i915->drm, !subdesc->name); merge_display_is(&display->is, &subdesc->is); } diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 73070c8487ff..97033d26c1b3 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -93,14 +93,6 @@ struct drm_printer; func(DG2_G11) \ func(DG2_G12) -#define ENUM(x) INTEL_DISPLAY_ ## x, - -enum intel_display_platform { - INTEL_DISPLAY_PLATFORMS(ENUM) -}; - -#undef ENUM - #define MEMBER(name) u32 name:1; struct intel_display_is { @@ -207,9 +199,6 @@ struct intel_display_is { (DISPLAY_VER(i915) >= (from) && DISPLAY_VER(i915) <= (until)) struct intel_display_runtime_info { - enum intel_display_platform platform; - enum intel_display_platform subplatform; - struct intel_display_ip_ver { u16 ver; u16 rel;