diff mbox series

[v4,10/15] drm/i915/display: add subplatform group for HSW/BDW ULT

Message ID 22e5c42f8b8580fa5c6b40a6e1ef9760ba3c99a8.1729518793.git.jani.nikula@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/display: platform identification with display->platform.<platform> | expand

Commit Message

Jani Nikula Oct. 21, 2024, 1:54 p.m. UTC
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

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

Comments

Rodrigo Vivi Oct. 23, 2024, 3:08 p.m. UTC | #1
On Mon, Oct 21, 2024 at 04:54:11PM +0300, Jani Nikula wrote:
> 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
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@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
>
diff mbox series

Patch

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,
 		},
 		{},