From patchwork Mon Oct 21 13:54:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13844205 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 13C6DD15D96 for ; Mon, 21 Oct 2024 13:54:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E25410E51E; Mon, 21 Oct 2024 13:54:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QjgtjI20"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD56010E518; Mon, 21 Oct 2024 13:54: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=1729518875; x=1761054875; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aCy0TjXMg20dRsMrVXmSFqvtbzzoQU9MXZ5tt3aH/OQ=; b=QjgtjI206+On8JEumDjWtW6RvhFIT51ixAYeP2e1sfaQDNlSpDMQEGxC C/JfOFV5EKiMA7CdOs2BdituIVyn8L2zCyIEHVPkwDd9yV95mnna3Ac0X o6E9ONyIY6y83N/V+if+RCsSC1+t1fFc+e6gHGVDjVkitW8J3pbOCUTBz zZ2gIReETD380rJu32uWQUNNKZQvhOwqrDdFqIpwyfNdFLvOwF8w6Yqyb PwN4+7U5tURf0wcpLKZTQsm+ogadjqUF5tLkJ1+8wyIroRXN/kMLavgAB C4n34dtt+eXdAl4drxpOwHUxKuVPXldB5D2YdLGecByA9i6kvITuOF4YN Q==; X-CSE-ConnectionGUID: SvpLmv86TSWfLvyRfgKjjg== X-CSE-MsgGUID: t1Qt0TCLSLy8uLbQci/vvQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39540492" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39540492" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2024 06:54:34 -0700 X-CSE-ConnectionGUID: J9nAwV1jT1S9adCBVgQcsw== X-CSE-MsgGUID: CLUux2H9SyeR1OZlCNuSeA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,221,1725346800"; d="scan'208";a="83547855" Received: from lbogdanm-mobl3.ger.corp.intel.com (HELO localhost) ([10.245.246.222]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2024 06:54: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, maarten.lankhorst@linux.intel.com Subject: [PATCH v4 02/15] drm/i915/display: use a macro to initialize subplatforms Date: Mon, 21 Oct 2024 16:54:03 +0300 Message-Id: <74c99490c3e755806c5882b19726cc1a3d6d76bd.1729518793.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.5 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 9c54a8b3cb6f..3330ec1bf2cf 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -37,6 +37,10 @@ struct subplatform_desc { struct stepping_desc step_info; }; +#define SUBPLATFORM(_platform, _subplatform) \ + .subplatform = (INTEL_DISPLAY_##_platform##_##_subplatform), \ + .name = #_subplatform + struct platform_desc { enum intel_display_platform platform; const char *name; @@ -498,11 +502,11 @@ static const struct platform_desc hsw_desc = { PLATFORM(HASWELL), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_HASWELL_ULT, "ULT", + SUBPLATFORM(HASWELL, ULT), .pciidlist = hsw_ult_ids, }, { - INTEL_DISPLAY_HASWELL_ULX, "ULX", + SUBPLATFORM(HASWELL, ULX), .pciidlist = hsw_ulx_ids, }, {}, @@ -548,11 +552,11 @@ static const struct platform_desc bdw_desc = { PLATFORM(BROADWELL), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_BROADWELL_ULT, "ULT", + SUBPLATFORM(BROADWELL, ULT), .pciidlist = bdw_ult_ids, }, { - INTEL_DISPLAY_BROADWELL_ULX, "ULX", + SUBPLATFORM(BROADWELL, ULX), .pciidlist = bdw_ulx_ids, }, {}, @@ -645,11 +649,11 @@ static const struct platform_desc skl_desc = { PLATFORM(SKYLAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_SKYLAKE_ULT, "ULT", + SUBPLATFORM(SKYLAKE, ULT), .pciidlist = skl_ult_ids, }, { - INTEL_DISPLAY_SKYLAKE_ULX, "ULX", + SUBPLATFORM(SKYLAKE, ULX), .pciidlist = skl_ulx_ids, }, {}, @@ -686,11 +690,11 @@ static const struct platform_desc kbl_desc = { PLATFORM(KABYLAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_KABYLAKE_ULT, "ULT", + SUBPLATFORM(KABYLAKE, ULT), .pciidlist = kbl_ult_ids, }, { - INTEL_DISPLAY_KABYLAKE_ULX, "ULX", + SUBPLATFORM(KABYLAKE, ULX), .pciidlist = kbl_ulx_ids, }, {}, @@ -717,11 +721,11 @@ static const struct platform_desc cfl_desc = { PLATFORM(COFFEELAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_COFFEELAKE_ULT, "ULT", + SUBPLATFORM(COFFEELAKE, ULT), .pciidlist = cfl_ult_ids, }, { - INTEL_DISPLAY_COFFEELAKE_ULX, "ULX", + SUBPLATFORM(COFFEELAKE, ULX), .pciidlist = cfl_ulx_ids, }, {}, @@ -739,7 +743,7 @@ static const struct platform_desc cml_desc = { PLATFORM(COMETLAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_COMETLAKE_ULT, "ULT", + SUBPLATFORM(COMETLAKE, ULT), .pciidlist = cml_ult_ids, }, {}, @@ -858,7 +862,7 @@ static const struct platform_desc icl_desc = { PLATFORM(ICELAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_ICELAKE_PORT_F, "Port F", + SUBPLATFORM(ICELAKE, PORT_F), .pciidlist = icl_port_f_ids, }, {}, @@ -958,7 +962,7 @@ static const struct platform_desc tgl_desc = { PLATFORM(TIGERLAKE), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_TIGERLAKE_UY, "UY", + SUBPLATFORM(TIGERLAKE, UY), .pciidlist = tgl_uy_ids, STEP_INFO(tgl_uy_steppings), }, @@ -1038,7 +1042,7 @@ static const struct platform_desc adl_s_desc = { PLATFORM(ALDERLAKE_S), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_ALDERLAKE_S_RAPTORLAKE_S, "RPL-S", + SUBPLATFORM(ALDERLAKE_S, RAPTORLAKE_S), .pciidlist = adls_rpls_ids, STEP_INFO(adl_s_rpl_s_steppings), }, @@ -1145,17 +1149,17 @@ static const struct platform_desc adl_p_desc = { PLATFORM(ALDERLAKE_P), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_ALDERLAKE_P_ALDERLAKE_N, "ADL-N", + SUBPLATFORM(ALDERLAKE_P, ALDERLAKE_N), .pciidlist = adlp_adln_ids, STEP_INFO(adl_p_adl_n_steppings), }, { - INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_P, "RPL-P", + SUBPLATFORM(ALDERLAKE_P, RAPTORLAKE_P), .pciidlist = adlp_rplp_ids, STEP_INFO(adl_p_rpl_pu_steppings), }, { - INTEL_DISPLAY_ALDERLAKE_P_RAPTORLAKE_U, "RPL-U", + SUBPLATFORM(ALDERLAKE_P, RAPTORLAKE_U), .pciidlist = adlp_rplu_ids, STEP_INFO(adl_p_rpl_pu_steppings), }, @@ -1213,17 +1217,17 @@ static const struct platform_desc dg2_desc = { PLATFORM(DG2), .subplatforms = (const struct subplatform_desc[]) { { - INTEL_DISPLAY_DG2_G10, "G10", + SUBPLATFORM(DG2, G10), .pciidlist = dg2_g10_ids, STEP_INFO(dg2_g10_steppings), }, { - INTEL_DISPLAY_DG2_G11, "G11", + SUBPLATFORM(DG2, G11), .pciidlist = dg2_g11_ids, STEP_INFO(dg2_g11_steppings), }, { - INTEL_DISPLAY_DG2_G12, "G12", + SUBPLATFORM(DG2, G12), .pciidlist = dg2_g12_ids, STEP_INFO(dg2_g12_steppings), },