Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
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: [CI v4 v4 10/16] drm/i915/display: add subplatform group for HSW/BDW ULT
Date: Thu, 24 Oct 2024 15:33:36 +0300	[thread overview]
Message-ID: <035c2f91763ec413ddca377cf6905df2853cee79.1729773149.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1729773149.git.jani.nikula@intel.com>

Add support for defining aliases for subplatform groups, such as HSW/BDW
ULT that covers both ULT and ULX.

ULT is a special case, because we slightly abuse the ULT subplatform
both as a subplatform and group, but with the way this is defined, it
should be fairly clear.

This follows i915 core and IS_HASWELL_ULT()/IS_BROADWELL_ULT()
conventions, i.e. "is ULT" also matches ULX platforms.

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.

v2: Use the subplatform group idea

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_device.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
index 50ffb31662b1..35abb4eaa0ef 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -41,6 +41,13 @@ struct subplatform_desc {
 	.platforms._platform##_##_subplatform = 1,			\
 	.name = #_subplatform
 
+/*
+ * Group subplatform alias that matches multiple subplatforms. For making ult
+ * cover both ult and ulx on HSW/BDW.
+ */
+#define SUBPLATFORM_GROUP(_platform, _subplatform)			\
+	.platforms._platform##_##_subplatform = 1
+
 struct platform_desc {
 	struct intel_display_platforms platforms;
 	const char *name;
@@ -510,12 +517,15 @@ static const u16 hsw_ulx_ids[] = {
 static const struct platform_desc hsw_desc = {
 	PLATFORM(haswell),
 	.subplatforms = (const struct subplatform_desc[]) {
+		/* Special case: Use ult both as group and subplatform. */
 		{
 			SUBPLATFORM(haswell, ult),
+			SUBPLATFORM_GROUP(haswell, ult),
 			.pciidlist = hsw_ult_ids,
 		},
 		{
 			SUBPLATFORM(haswell, ulx),
+			SUBPLATFORM_GROUP(haswell, ult),
 			.pciidlist = hsw_ulx_ids,
 		},
 		{},
@@ -560,12 +570,15 @@ static const u16 bdw_ulx_ids[] = {
 static const struct platform_desc bdw_desc = {
 	PLATFORM(broadwell),
 	.subplatforms = (const struct subplatform_desc[]) {
+		/* Special case: Use ult both as group and subplatform. */
 		{
 			SUBPLATFORM(broadwell, ult),
+			SUBPLATFORM_GROUP(broadwell, ult),
 			.pciidlist = bdw_ult_ids,
 		},
 		{
 			SUBPLATFORM(broadwell, ulx),
+			SUBPLATFORM_GROUP(broadwell, ult),
 			.pciidlist = bdw_ulx_ids,
 		},
 		{},
-- 
2.39.5


  parent reply	other threads:[~2024-10-24 12:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 12:33 [CI v4 v4 00/16] drm/i915/display: platform identification with display->platform.<platform> Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 01/16] drm/i915/display: reindent subplatform initialization Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 02/16] drm/i915/display: use a macro to initialize subplatforms Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 03/16] drm/i915/display: use a macro to define platform enumerations Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 04/16] drm/i915/display: join the platform and subplatform enums Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 05/16] drm/i915/display: convert display platforms to lower case Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 06/16] drm/i915/display: add display platforms structure with platform members Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 07/16] drm/i915/display: add platform member to struct intel_display Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 08/16] drm/i915/display: remove the display platform enum as unnecessary Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 09/16] drm/i915/display: add platform group for g4x Jani Nikula
2024-10-24 12:33 ` Jani Nikula [this message]
2024-10-24 12:33 ` [CI v4 v4 11/16] drm/i915/bios: use display->platform.<platform> instead of IS_<PLATFORM>() Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 12/16] drm/i915/pps: " Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 13/16] drm/i915/tv: " Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 14/16] drm/i915/vga: " Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 15/16] drm/i915/vblank: drop unnecessary i915 local variable Jani Nikula
2024-10-24 12:33 ` [CI v4 v4 16/16] drm/i915/vblank: use display->platform.<platform> instead of IS_<PLATFORM>() Jani Nikula
2024-10-24 13:18 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: platform identification with display->platform.<platform> (rev3) Patchwork
2024-10-24 13:18 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-24 13:35 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-24 17:11 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=035c2f91763ec413ddca377cf6905df2853cee79.1729773149.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox