From patchwork Mon Aug 19 18:44:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768866 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 B5EA4C5320E for ; Mon, 19 Aug 2024 18:44:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3773610E209; Mon, 19 Aug 2024 18:44:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Wih6nYp3"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id E9BDA10E209; Mon, 19 Aug 2024 18:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093089; x=1755629089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FKNiqyu/zSOYCXp0wsZsuTnIGutHzZbxJyxXUXVLs2M=; b=Wih6nYp3awSjGqBidF5c2cXx/jCEGkC1zmvRzEbVSErUuEy4HKeTELvf kylvWkPP9NHbH4kgEQ3nCb3hu7Rj5neQs+i06LmE5HhIpN90XppXR2oR2 gxgzF2WL0u1MNiZFfXHNxxhbx9dReNvZcQw3in8dHK93ne99K2aFpQRxj HBO2e50FrTPjagVxYgM/9Vf+sU+MBsyaMcenGGcfWCnV2mQ5FxGxV+7U8 gLugcKkXfkgplQNJk1SJWOgwT7G1906qJkn7skWqUXT0PBZakzTybPd3J bsYkJ6Nbf+ZG3lDdDpqjJVzGU/GSrQkF6pEBR5sPTZJwiYf3v47RYyiFd Q==; X-CSE-ConnectionGUID: 43c/aNKkS3S642p/JZwUwg== X-CSE-MsgGUID: drL8G17rST6i9aPhQODshw== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26157481" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="26157481" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:44:49 -0700 X-CSE-ConnectionGUID: 8gM4HLwtQu+iR9lKSCpVTg== X-CSE-MsgGUID: S1uqbX/MQcKTCk5ENy6UjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="97940264" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:44:46 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 1/9] drm/i915/display: use a macro to initialize subplatforms Date: Mon, 19 Aug 2024 21:44:28 +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" 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. Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula --- .../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 a31f89df2c0a..7bb7348b96d8 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 Mon Aug 19 18:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768867 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 9EF2CC52D7C for ; Mon, 19 Aug 2024 18:44:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 445B710E227; Mon, 19 Aug 2024 18:44:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="IYRuC+7i"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5537210E227; Mon, 19 Aug 2024 18:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093099; x=1755629099; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fgZJAUKJM8ZqmPtBkdV4iFHMA3Ldgx4mQHgBunVkYRc=; b=IYRuC+7i4q7mBGFk9z9wvK9Of8m3k4Ft2mJ5twtBp2QBUFSNju9NRmde f/jLKzdeeE9QxqsBU9HDGCIf0KTHAle6iSvkwZVBKETOGisvFroyhiOg0 5TCco1y4AqxrTyDEBjYTqkDZt0l8ZRXB8/31D8/BrnUGHQyFr+7ngAlLF 7wixExiY3v3N45pOkomtefNhsDTrkAJt4T7OlKXnCfIPH1rci+tIkY0Fi 24Y5pKqHceENPIzsLCT0Kxp6ohSzhIKIIgsym0O87zSZUIOJC35lQChha zE+cIfryuRj/GWqPPZRPHYGBg8w1oQHPEVK7IjHPsE2hLAviIIBt/hLib g==; X-CSE-ConnectionGUID: oTQums+bRkucYP3fyoikvw== X-CSE-MsgGUID: Hy53E8ctQ/C7dEWh8VHiEQ== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26157486" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="26157486" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:44:59 -0700 X-CSE-ConnectionGUID: C9nMYzH+SHOKgHOJSIUfPw== X-CSE-MsgGUID: MbXeOjgCSKaJ/Nlg4hVS0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="97940312" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:44:52 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 2/9] drm/i915/display: use a macro to define platform enumerations Date: Mon, 19 Aug 2024 21:44:29 +0300 Message-Id: <326615309c714fd6cfdde0ca63d3502ddb58c417.1724092799.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" We'll be needing a macro based list of platforms for more things in the future. Start by defining the platform enumerations with it. Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula --- .../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..f5c9bba3baa2 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 Mon Aug 19 18:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768868 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 0897BC3DA4A for ; Mon, 19 Aug 2024 18:45:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 994D610E265; Mon, 19 Aug 2024 18:45:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ceUPZIJZ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C9AF10E246; Mon, 19 Aug 2024 18:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093102; x=1755629102; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xJm813J2lSrBrTZaCZceWxGkSApEgtj+N3wc6A8BTow=; b=ceUPZIJZM/Co9NPvstVQDvOGd+wSE8irQ0A2mIvU00jDPzvP9GnZ271G JCWknZf0shZAtXW0caooI1VJgY64Ze5WuRK/uFuc8sk87BE1+Kv2idNtK MRsIxiV/3ZyDrzPb6r/WyDUYGHw1iPKx/e/q2KnqyGcBb7gOOj0g+mDpD Kv1K/NxgqbSHTO7F4lRi+Lwn4PCcyBaJZsxLFg8YyBE5YB2GDr+hArfaq zwvPaboNEPkmQcx7vyZZGJpcdN7YeCiebCIfffaRvm53RJLcC9+VMiG4X tgkjDkCBP+u8m4dA9SlOA7FpiXodmU6d3cMaqTNPuWY6ET6z9joK5ECyk g==; X-CSE-ConnectionGUID: pB6BzRePTyW7hkLh4ryKbg== X-CSE-MsgGUID: Z1cPPk1cTnaDCtLoiyIksg== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26157493" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="26157493" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:02 -0700 X-CSE-ConnectionGUID: k2HfDYLETRGvjzUc/r0vbA== X-CSE-MsgGUID: bFUEHoI+RASBxHdhB/sBaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="97940333" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:44:58 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 3/9] drm/i915/display: join the platform and subplatform enums Date: Mon, 19 Aug 2024 21:44:30 +0300 Message-Id: <31fb575ec6334d484c1cb1cdd5d7abb5e849cdcb.1724092799.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" We'll want to use the subplatforms similar to platforms. Reviewed-by: Rodrigo Vivi Signed-off-by: Jani Nikula --- .../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 7bb7348b96d8..336cc8e717f5 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 f5c9bba3baa2..0a78f7438035 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 Mon Aug 19 18:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768869 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 E10BCC3DA4A for ; Mon, 19 Aug 2024 18:45:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8522210E270; Mon, 19 Aug 2024 18:45:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="nuGSTl2k"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EE9810E246; Mon, 19 Aug 2024 18:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093107; x=1755629107; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZCcT47uwO4VoEga/kdQZ2pkBomYzncOwKS5vpXjLB0c=; b=nuGSTl2kTS1/VS6K6rIAtaiAzah+gyMIf1ZHdUa0yweQYwhZk8g+L+0i R/eRLIor6N7mTwMdZUpeKbLVZM2q+e+wD9JQ6LrKQSGRM/X8+fycQEWIt pLyGtJheLfhUcAP6yCvhGSciCJk2M7MKUBnhYbIHcadXxwFuj/gnBznBP WP+nvXLiSdWSnzBvJMZ8R+hqLn60aHMLG8Ihy3vyFiEeTV9oagJMuWiUy f5NxCBnAgIyVgQl6DkWH09iGDCDTn8epNqPn6zlIu3AWpmsTAqU5EMGCn BXWz9rfBvB+NfgZlp2Ui/KMEfH6VO0zaNRcci7tuoKZgfHG5JYLqH3jHO g==; X-CSE-ConnectionGUID: GrEyVnRESzqKydHyI9zIIQ== X-CSE-MsgGUID: O0NyUN20QwaWGQ6O/8aJHw== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26157504" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="26157504" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:07 -0700 X-CSE-ConnectionGUID: 8sh00HSgR36i3gYoRy5kAA== X-CSE-MsgGUID: 0NtqNaHZSxCCggYcbVOikw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="97940380" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:04 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 4/9] drm/i915/display: add display platforms structure with platform members Date: Mon, 19 Aug 2024 21:44:31 +0300 Message-Id: <0a0323da6ef02481187eae2c72df9eb0c8f1f2e7.1724092799.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. The structure also contains a bitmap in a union for easier manipulation of the bits. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../drm/i915/display/intel_display_device.c | 8 ++++++-- .../drm/i915/display/intel_display_device.h | 19 +++++++++++++++++++ 2 files changed, 25 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 336cc8e717f5..55ab1923c8b3 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_platforms platforms; 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, \ + .platforms._platform##_##_subplatform = 1 struct platform_desc { + struct intel_display_platforms platforms; 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, \ + .platforms._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 0a78f7438035..6f8814d1fabd 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -6,6 +6,7 @@ #ifndef __INTEL_DISPLAY_DEVICE_H__ #define __INTEL_DISPLAY_DEVICE_H__ +#include #include #include "intel_display_conversion.h" @@ -101,6 +102,24 @@ enum intel_display_platform { #undef __ENUM +#define __MEMBER(name) unsigned long name:1; +#define __COUNT(x) 1 + + +#define __NUM_PLATFORMS (INTEL_DISPLAY_PLATFORMS(__COUNT) 0) + +struct intel_display_platforms { + union { + struct { + INTEL_DISPLAY_PLATFORMS(__MEMBER); + }; + DECLARE_BITMAP(bitmap, __NUM_PLATFORMS); + }; +}; + +#undef __MEMBER +#undef __COUNT +#undef __NUM_PLATFORMS + #define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \ /* Keep in alphabetical order */ \ func(cursor_needs_physical); \ From patchwork Mon Aug 19 18:44:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768870 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 363B9C3DA4A for ; Mon, 19 Aug 2024 18:45:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD9FB10E26F; Mon, 19 Aug 2024 18:45:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="NwZuvR9N"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id A971610E26F; Mon, 19 Aug 2024 18:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093113; x=1755629113; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kTfCC9csSux6b8n2wu/CXbN22xuAKXGJSDkqdw7YrLc=; b=NwZuvR9NCtw/TfU4YaXYWCdjfieuT4D2mxlMwFWKCDDHI5PoPEmvd9Fl 7cOi2kqBk7jzzvV53xVmVV7RRFYcmW/iVypduDBwIkwmDJMo7Z6QMrtIR DtRQa1A4Z1Ia2JcUg8Kwr7z6mehlA+Pg9W4zIKKUjn18Rz03F2EvYQafe d0zHF4ahGsRrOH0SESK2AtY9OiQ0Y6qRefuDU0JYd2879KLrI8EXUhuo0 PTtPB0glw1RetgJ4rPzsB+MsTE3NX3kkeF95b7YoOEE6/AZbnIJi8h+AZ M+2MrD/clNSdZrhoSOwQ0hiKjEcs3qrHy38sOJHOcTBX9zHlmDs4T94SS Q==; X-CSE-ConnectionGUID: kCM9417kSgOkOTgVai5L9A== X-CSE-MsgGUID: unQWinODRge1KnfnvgNlRw== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="26157515" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="26157515" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:13 -0700 X-CSE-ConnectionGUID: 3XECO2avT8aadsydDVScag== X-CSE-MsgGUID: n2r207opRZeRIWFdUvRJRg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="97940427" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:10 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 5/9] drm/i915/display: add platforms "is" member to struct intel_display Date: Mon, 19 Aug 2024 21:44:32 +0300 Message-Id: <7219e172b99401458ef6783c67b0b47115c6e772.1724092799.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 and display->is.HASWELL_ULT etc. for identifying platforms and subplatforms. Merge platform and subplatform members together. v2: - Use bitmap ops - Add some sanity checks with warnings 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 | 31 +++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h index 0a711114ff2b..b2907894fa28 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 (and subplatform, if any) identification */ + struct intel_display_platforms 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 55ab1923c8b3..3d3b4ed7940e 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -1269,8 +1269,28 @@ find_subplatform_desc(struct pci_dev *pdev, const struct platform_desc *desc) return NULL; } +/* Size of the entire bitmap, not the number of platforms */ +static unsigned int display_platforms_num_bits(void) +{ + return sizeof(((struct intel_display_platforms *)0)->bitmap) * BITS_PER_BYTE; +} + +/* Number of platform bits set */ +static unsigned int display_platforms_weight(const struct intel_display_platforms *p) +{ + return bitmap_weight(p->bitmap, display_platforms_num_bits()); +} + +/* Merge the subplatform information from src to dst */ +static void display_platforms_or(struct intel_display_platforms *dst, + const struct intel_display_platforms *src) +{ + bitmap_or(dst->bitmap, dst->bitmap, src->bitmap, display_platforms_num_bits()); +} + 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 = {}; @@ -1306,13 +1326,20 @@ 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); + drm_WARN_ON(&i915->drm, !desc->platform || !desc->name || + display_platforms_weight(&desc->platforms) != 1); DISPLAY_RUNTIME_INFO(i915)->platform = desc->platform; + display->is = desc->platforms; subdesc = find_subplatform_desc(pdev, desc); if (subdesc) { - drm_WARN_ON(&i915->drm, !subdesc->subplatform || !subdesc->name); + drm_WARN_ON(&i915->drm, !subdesc->subplatform || !subdesc->name || + display_platforms_weight(&subdesc->platforms) != 1); DISPLAY_RUNTIME_INFO(i915)->subplatform = subdesc->subplatform; + display_platforms_or(&display->is, &subdesc->platforms); + + /* Ensure platform and subplatform are distinct */ + drm_WARN_ON(&i915->drm, display_platforms_weight(&subdesc->platforms) == 1); } if (ip_ver.ver || ip_ver.rel || ip_ver.step) From patchwork Mon Aug 19 18:44:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768871 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 03D9CC3DA4A for ; Mon, 19 Aug 2024 18:45:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9278510E297; Mon, 19 Aug 2024 18:45:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="R0CBK5UG"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B05910E271; Mon, 19 Aug 2024 18:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093118; x=1755629118; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EoO9+vnZ+UgJzWJe/9JySq/dd1Lyg6R1Lqkor5Gijv4=; b=R0CBK5UGxWRBAjjQCPLyQacd5RsofJM3vmN/4TrNKpwk2rM4pGNBHJEm eLthqPv9b1wtbPo0DogTrkk9uuBllVOGaBajsyYDGnUiAo2/Upc6N5G5l MLXc5ZqGfBv1epRQyjB2m0Qm1QYWIs6LVz0CliqdCpFQThcWWNrVNg1vz 5//8x8dB7ketY/XPCA3CLMsUvH28ac2VXRERZnz0PMm8Yo2326cP7l8Uj UtvqHUAUK4meN9lkHEXHx0bzRxSxBaezuk7YT5r0p1myD9jDjLe1deP2A /hlHJtebQfp4EYQT3e5HpbcH7GzGtjPujkLeVLtqiZrK1TdlkCn1q2mPC Q==; X-CSE-ConnectionGUID: /7a6kKFLRqeZb+LD+bUlYg== X-CSE-MsgGUID: Vryn81q4SoicHO3zbTTiqg== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="21981262" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="21981262" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:18 -0700 X-CSE-ConnectionGUID: Qzd27loUSOeatYZd0AcwGw== X-CSE-MsgGUID: 4mJlRNjESaaruvXM0jp7qA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="83670874" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:16 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 6/9] drm/i915/display: remove the display platform enum as unnecessary Date: Mon, 19 Aug 2024 21:44:33 +0300 Message-Id: <38e923b9fe76664b83c258fe7a806a8daa6ecc48.1724092799.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. Without the enum, PLATFORM_UNINITIALIZED is also no longer needed for keeping the first enum 0. 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 | 12 ------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index 3d3b4ed7940e..90609b561630 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_platforms platforms; - enum intel_display_platform subplatform; const char *name; const u16 *pciidlist; }; #define SUBPLATFORM(_platform, _subplatform) \ - .subplatform = (INTEL_DISPLAY_##_platform##_##_subplatform), \ .name = #_subplatform, \ .platforms._platform##_##_subplatform = 1 struct platform_desc { struct intel_display_platforms platforms; - 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, \ .platforms._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; @@ -1326,16 +1322,14 @@ 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 || + drm_WARN_ON(&i915->drm, !desc->name || display_platforms_weight(&desc->platforms) != 1); - DISPLAY_RUNTIME_INFO(i915)->platform = desc->platform; display->is = desc->platforms; subdesc = find_subplatform_desc(pdev, desc); if (subdesc) { - drm_WARN_ON(&i915->drm, !subdesc->subplatform || !subdesc->name || + drm_WARN_ON(&i915->drm, !subdesc->name || display_platforms_weight(&subdesc->platforms) != 1); - DISPLAY_RUNTIME_INFO(i915)->subplatform = subdesc->subplatform; display_platforms_or(&display->is, &subdesc->platforms); /* Ensure platform and subplatform are distinct */ diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 6f8814d1fabd..6d1f3de46836 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -17,7 +17,6 @@ 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) \ @@ -94,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) unsigned long name:1; #define __COUNT(x) 1 + @@ -218,9 +209,6 @@ struct intel_display_platforms { (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; From patchwork Mon Aug 19 18:44:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768872 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 85BCAC3DA4A for ; Mon, 19 Aug 2024 18:45:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D7D010E299; Mon, 19 Aug 2024 18:45:25 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="GJl/Cfrj"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E31810E298; Mon, 19 Aug 2024 18:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093124; x=1755629124; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NyBsof0zbRFLIUQAn48iqsbMSAEp8yKJ0X/axtVHNIw=; b=GJl/Cfrj0WzC1svhowvfIPQXoh3I2EIDO7OkMsUbV43REily//Q/l6EA cs/rs3viJP2fGKlZ+rLakkSzAIad6NWLvcotIVtn98ezP0qiDwmnxCc1F iScKP8AxPRNiF1aokcJ+nCq0g7bi+c6LWFu2feUX3HnRvhPxYGKDOoSkP qyOiH3kqAbz3+2nEGPdnVaRmyz/lixPI5LGBansQOZwuJ9YJ18gKHUfsG Ih3Ecs/SEeAte021Fmu3M/zkWHfiQMrIeBthjldHe/JFgJLYNWDJiaoGv FwmHJ+j6xgdUcUlYTSsC/Xwkxsfd3jBszofDneKNq5dlDX7K0ZqFB9l9j w==; X-CSE-ConnectionGUID: PhJo0g+OQuCtABmk7hcS9w== X-CSE-MsgGUID: mLENushGQB+N/EvEo0NzFA== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="21902222" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="21902222" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:24 -0700 X-CSE-ConnectionGUID: KsmEGb0RQf2vaTIXKO325w== X-CSE-MsgGUID: Bq3gYxUbQi+oow9JsfZ4bA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="83670893" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:21 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 7/9] drm/i915/display: consider HSW/BDW ULX to also be ULT Date: Mon, 19 Aug 2024 21:44:34 +0300 Message-Id: <6d09d1d5b1868798c879b93f079742b472ef4f1e.1724092799.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" Follow i915 core and IS_HASWELL_ULT()/IS_BROADWELL_ULT() conventions, i.e. "is ULT" also matches ULX platforms. Using multiple SUBPLATFORM() macros, we initialize both ULT and ULX subplatforms, and take the subplatform name from the last (so be careful to keep ULX last). This is *not* an example to be copied. Note: Pedantically, this should have been done earlier, but it's only feasible now that we no longer have a subplatform enum and can actually initialize multiple subplatforms. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_display_device.c | 6 ++++-- 1 file changed, 4 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 90609b561630..fd145f87d86b 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -490,7 +490,8 @@ static const struct platform_desc hsw_desc = { PLATFORM(HASWELL), .subplatforms = (const struct subplatform_desc[]) { { SUBPLATFORM(HASWELL, ULT), .pciidlist = hsw_ult_ids }, - { SUBPLATFORM(HASWELL, ULX), .pciidlist = hsw_ulx_ids }, + /* Special case: ULX is also ULT. Do not copy this approach. */ + { SUBPLATFORM(HASWELL, ULT), SUBPLATFORM(HASWELL, ULX), .pciidlist = hsw_ulx_ids }, {}, }, .info = &(const struct intel_display_device_info) { @@ -534,7 +535,8 @@ static const struct platform_desc bdw_desc = { PLATFORM(BROADWELL), .subplatforms = (const struct subplatform_desc[]) { { SUBPLATFORM(BROADWELL, ULT), .pciidlist = bdw_ult_ids }, - { SUBPLATFORM(BROADWELL, ULX), .pciidlist = bdw_ulx_ids }, + /* Special case: ULX is also ULT. Do not copy this approach. */ + { SUBPLATFORM(BROADWELL, ULT), SUBPLATFORM(BROADWELL, ULX), .pciidlist = bdw_ulx_ids }, {}, }, .info = &(const struct intel_display_device_info) { From patchwork Mon Aug 19 18:44:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768873 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 76B0BC5320E for ; Mon, 19 Aug 2024 18:45:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21B9A10E29A; Mon, 19 Aug 2024 18:45:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="lJ80zWiK"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29EFF10E292; Mon, 19 Aug 2024 18:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724093129; x=1755629129; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rJQ2R+Y4yURj7oVintsbUZLVrCanseKc8eMvWq2zW6Y=; b=lJ80zWiKv9aQ4Cnir4FXHlgOQyW9dzfluTpUfDb04dklofNylBIch0cq AmV/nsqO4em5iJ1YmtKLAxduuVwKN47asQNcvjLZot0OZPTSC3zLCSOrR T3YK7QtaxD14x9mu4qx06Sgu+VxjbxXPN6Mrkd2TydmwIQFQvKHfH5Oad UGfFpv3KIwsyQQWh2SitX1tEkBgv48iYV1gm5RgameMitw9wBoIaxMJZD GXAvCRTZ/YiCLo6Cnf/wVm1tw37SwPJ2Gz4uZ70T6Dc+yDzMjq+bRkwrZ IIXVgXHFXbPAwrMEVF49gmr1AgJSnUfshl60oD8bEulcUzZJa6tM8TnvQ g==; X-CSE-ConnectionGUID: yT2hNHp2QmCK3+J6FXgKwQ== X-CSE-MsgGUID: GTZeKGs/QkGQHsSn8k7cIQ== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="21902230" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="21902230" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:29 -0700 X-CSE-ConnectionGUID: z82SVGvXQ2ahooWGiiW94g== X-CSE-MsgGUID: i2DpUTbFSEu0bU3VLRWDGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="83670910" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:27 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 8/9] drm/i915/display: keep subplatforms next to their platforms Date: Mon, 19 Aug 2024 21:44:35 +0300 Message-Id: <43a8e73d499d909741e4b6c78ed4e20895fe1b24.1724092799.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" There's no reason to keep subplatforms separated in the members. Update the comment while at it. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- .../drm/i915/display/intel_display_device.h | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 6d1f3de46836..86664b999ca9 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -15,7 +15,11 @@ struct drm_i915_private; struct drm_printer; -/* Keep in gen based order, and chronological order within a gen */ +/* + * Display platforms and subplatforms. Keep platforms in display version based + * order, chronological order within a version, and subplatforms next to the + * platform. + */ #define INTEL_DISPLAY_PLATFORMS(func) \ /* Display ver 2 */ \ func(I830) \ @@ -42,56 +46,55 @@ struct drm_printer; func(IVYBRIDGE) \ func(VALLEYVIEW) \ func(HASWELL) \ + func(HASWELL_ULT) \ + func(HASWELL_ULX) \ /* Display ver 8 */ \ func(BROADWELL) \ + func(BROADWELL_ULT) \ + func(BROADWELL_ULX) \ func(CHERRYVIEW) \ /* Display ver 9 */ \ func(SKYLAKE) \ + func(SKYLAKE_ULT) \ + func(SKYLAKE_ULX) \ func(BROXTON) \ func(KABYLAKE) \ + func(KABYLAKE_ULT) \ + func(KABYLAKE_ULX) \ func(GEMINILAKE) \ func(COFFEELAKE) \ + func(COFFEELAKE_ULT) \ + func(COFFEELAKE_ULX) \ func(COMETLAKE) \ + func(COMETLAKE_ULT) \ + func(COMETLAKE_ULX) \ /* Display ver 11 */ \ func(ICELAKE) \ + func(ICELAKE_PORT_F) \ func(JASPERLAKE) \ func(ELKHARTLAKE) \ /* Display ver 12 */ \ func(TIGERLAKE) \ + func(TIGERLAKE_UY) \ func(ROCKETLAKE) \ func(DG1) \ func(ALDERLAKE_S) \ + func(ALDERLAKE_S_RAPTORLAKE_S) \ /* Display ver 13 */ \ func(ALDERLAKE_P) \ + func(ALDERLAKE_P_ALDERLAKE_N) \ + func(ALDERLAKE_P_RAPTORLAKE_P) \ + func(ALDERLAKE_P_RAPTORLAKE_U) \ func(DG2) \ + func(DG2_G10) \ + func(DG2_G11) \ + func(DG2_G12) \ /* 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) \ - /* 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) + func(BATTLEMAGE) #define __MEMBER(name) unsigned long name:1; #define __COUNT(x) 1 + From patchwork Mon Aug 19 18:44:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13768874 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 0EDEDC52D7C for ; Mon, 19 Aug 2024 18:45:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A486A10E29C; Mon, 19 Aug 2024 18:45:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="EYeV6gFt"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EE1910E05F; Mon, 19 Aug 2024 18:45: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=1724093135; x=1755629135; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RpJcBR9DGXISzQpOyvtvKS1aqHuZh5TVSTi/8t1OAQQ=; b=EYeV6gFt1ISJuWqZDtbSjIvSSoQm5J5Oja4PGEdT3KmKj4vcJg1XT3F9 QBZPMesX7CqwXHTKQYscAmV6QuGyaPGB5WC80zs8TiKmQJV1P7t0PZxfQ 4YsRVrr5D+UfC2wsCGnlAdTli3qhgQjIm4t2f27HA16LuPNi0Z7ej/xzc BSiJOdTJyu+1uzpFXvNZpzWOvi71kfHpVfV0qEXL0XkOCRB5mlo1/8N77 +OTPA4bvzqTYvV6a67LMyVB2t/q66ovyhM6mGVYYcMOV7Nta//o5FWGkB 92PIU0ZGsSM+3+1uL8P6XsgEl71LXj1ufQx4rjorcQJkTHnKDWxd+8czt Q==; X-CSE-ConnectionGUID: 8/QH1KC3S5GPbzjEiORbiQ== X-CSE-MsgGUID: UvZZ1yRjSciXOqK6b5wx1Q== X-IronPort-AV: E=McAfee;i="6700,10204,11169"; a="21902237" X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="21902237" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:35 -0700 X-CSE-ConnectionGUID: aqquQoPESnuPBfjooQhJbA== X-CSE-MsgGUID: PupLVogBT9+EREiVLuf7iA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,159,1719903600"; d="scan'208";a="83670921" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.70]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2024 11:45:32 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, rodrigo.vivi@intel.com, lucas.demarchi@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v2 9/9] drm/i915/bios: use display->is.PLATFORM instead of IS_PLATFORM() Date: Mon, 19 Aug 2024 21:44:36 +0300 Message-Id: <3957cefee1b89d5443297248a806755d2b001b7a.1724092799.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" Switch to using the new display->is.PLATFORM members. There are still cases like IS_G4X() which is trivial with macros, but not so with platform members. Ditto for IS_IRONLAKE_M() and IS_IVB_GT1() etc. although not used in this file. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_bios.c | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index d49435af62c7..c701f13e0cf6 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -1168,7 +1168,6 @@ static int intel_bios_ssc_frequency(struct intel_display *display, static void parse_general_features(struct intel_display *display) { - struct drm_i915_private *i915 = to_i915(display->drm); const struct bdb_general_features *general; general = bdb_find_section(display, BDB_GENERAL_FEATURES); @@ -1178,7 +1177,7 @@ parse_general_features(struct intel_display *display) display->vbt.int_tv_support = general->int_tv_support; /* int_crt_support can't be trusted on earlier platforms */ if (display->vbt.version >= 155 && - (HAS_DDI(display) || IS_VALLEYVIEW(i915))) + (HAS_DDI(display) || display->is.VALLEYVIEW)) display->vbt.int_crt_support = general->int_crt_support; display->vbt.lvds_use_ssc = general->enable_ssc; display->vbt.lvds_ssc_freq = @@ -1541,7 +1540,6 @@ static void parse_psr(struct intel_display *display, struct intel_panel *panel) { - struct drm_i915_private *i915 = to_i915(display->drm); const struct bdb_psr *psr; const struct psr_table *psr_table; int panel_type = panel->vbt.panel_type; @@ -1566,7 +1564,7 @@ parse_psr(struct intel_display *display, * Old decimal value is wake up time in multiples of 100 us. */ if (display->vbt.version >= 205 && - (DISPLAY_VER(display) >= 9 && !IS_BROXTON(i915))) { + (DISPLAY_VER(display) >= 9 && !display->is.BROXTON)) { switch (psr_table->tp1_wakeup_time) { case 0: panel->vbt.psr.tp1_wakeup_time_us = 500; @@ -2028,11 +2026,9 @@ static void icl_fixup_mipi_sequences(struct intel_display *display, static void fixup_mipi_sequences(struct intel_display *display, struct intel_panel *panel) { - struct drm_i915_private *i915 = to_i915(display->drm); - if (DISPLAY_VER(display) >= 11) icl_fixup_mipi_sequences(display, panel); - else if (IS_VALLEYVIEW(i915)) + else if (display->is.VALLEYVIEW) vlv_fixup_mipi_sequences(display, panel); } @@ -2242,15 +2238,15 @@ static u8 map_ddc_pin(struct intel_display *display, u8 vbt_pin) const u8 *ddc_pin_map; int i, n_entries; - if (INTEL_PCH_TYPE(i915) >= PCH_MTL || IS_ALDERLAKE_P(i915)) { + if (INTEL_PCH_TYPE(i915) >= PCH_MTL || display->is.ALDERLAKE_P) { ddc_pin_map = adlp_ddc_pin_map; n_entries = ARRAY_SIZE(adlp_ddc_pin_map); - } else if (IS_ALDERLAKE_S(i915)) { + } else if (display->is.ALDERLAKE_S) { ddc_pin_map = adls_ddc_pin_map; n_entries = ARRAY_SIZE(adls_ddc_pin_map); } else if (INTEL_PCH_TYPE(i915) >= PCH_DG1) { return vbt_pin; - } else if (IS_ROCKETLAKE(i915) && INTEL_PCH_TYPE(i915) == PCH_TGP) { + } else if (display->is.ROCKETLAKE && INTEL_PCH_TYPE(i915) == PCH_TGP) { ddc_pin_map = rkl_pch_tgp_ddc_pin_map; n_entries = ARRAY_SIZE(rkl_pch_tgp_ddc_pin_map); } else if (HAS_PCH_TGP(i915) && DISPLAY_VER(display) == 9) { @@ -2333,7 +2329,6 @@ static enum port __dvo_port_to_port(int n_ports, int n_dvo, static enum port dvo_port_to_port(struct intel_display *display, u8 dvo_port) { - struct drm_i915_private *i915 = to_i915(display->drm); /* * Each DDI port can have more than one value on the "DVO Port" field, * so look for all the possible values for each port. @@ -2390,12 +2385,12 @@ static enum port dvo_port_to_port(struct intel_display *display, ARRAY_SIZE(xelpd_port_mapping[0]), xelpd_port_mapping, dvo_port); - else if (IS_ALDERLAKE_S(i915)) + else if (display->is.ALDERLAKE_S) return __dvo_port_to_port(ARRAY_SIZE(adls_port_mapping), ARRAY_SIZE(adls_port_mapping[0]), adls_port_mapping, dvo_port); - else if (IS_DG1(i915) || IS_ROCKETLAKE(i915)) + else if (display->is.DG1 || display->is.ROCKETLAKE) return __dvo_port_to_port(ARRAY_SIZE(rkl_port_mapping), ARRAY_SIZE(rkl_port_mapping[0]), rkl_port_mapping, @@ -2518,7 +2513,6 @@ static void sanitize_hdmi_level_shift(struct intel_bios_encoder_data *devdata, enum port port) { struct intel_display *display = devdata->display; - struct drm_i915_private *i915 = to_i915(display->drm); if (!intel_bios_encoder_supports_dvi(devdata)) return; @@ -2528,7 +2522,7 @@ static void sanitize_hdmi_level_shift(struct intel_bios_encoder_data *devdata, * with a HSW VBT where the level shifter value goes * up to 11, whereas the BDW max is 9. */ - if (IS_BROADWELL(i915) && devdata->child.hdmi_level_shifter_value > 9) { + if (display->is.BROADWELL && devdata->child.hdmi_level_shifter_value > 9) { drm_dbg_kms(display->drm, "Bogus port %c VBT HDMI level shift %d, adjusting to %d\n", port_name(port), devdata->child.hdmi_level_shifter_value, 9); @@ -2617,14 +2611,13 @@ int intel_bios_hdmi_max_tmds_clock(const struct intel_bios_encoder_data *devdata static bool is_port_valid(struct intel_display *display, enum port port) { - struct drm_i915_private *i915 = to_i915(display->drm); /* * On some ICL SKUs port F is not present, but broken VBTs mark * the port as present. Only try to initialize port F for the * SKUs that may actually have it. */ - if (port == PORT_F && IS_ICELAKE(i915)) - return IS_ICL_WITH_PORT_F(i915); + if (port == PORT_F && display->is.ICELAKE) + return display->is.ICELAKE_PORT_F; return true; } @@ -2906,7 +2899,7 @@ init_vbt_missing_defaults(struct intel_display *display) unsigned int ports = DISPLAY_RUNTIME_INFO(display)->port_mask; enum port port; - if (!HAS_DDI(display) && !IS_CHERRYVIEW(i915)) + if (!HAS_DDI(display) && !display->is.CHERRYVIEW) return; for_each_port_masked(port, ports) { @@ -3671,17 +3664,16 @@ static const u8 direct_aux_ch_map[] = { static enum aux_ch map_aux_ch(struct intel_display *display, u8 aux_channel) { - struct drm_i915_private *i915 = to_i915(display->drm); const u8 *aux_ch_map; int i, n_entries; if (DISPLAY_VER(display) >= 13) { aux_ch_map = adlp_aux_ch_map; n_entries = ARRAY_SIZE(adlp_aux_ch_map); - } else if (IS_ALDERLAKE_S(i915)) { + } else if (display->is.ALDERLAKE_S) { aux_ch_map = adls_aux_ch_map; n_entries = ARRAY_SIZE(adls_aux_ch_map); - } else if (IS_DG1(i915) || IS_ROCKETLAKE(i915)) { + } else if (display->is.DG1 || display->is.ROCKETLAKE) { aux_ch_map = rkl_aux_ch_map; n_entries = ARRAY_SIZE(rkl_aux_ch_map); } else {