diff mbox series

[v2,7/9] drm/i915/display: consider HSW/BDW ULX to also be ULT

Message ID 6d09d1d5b1868798c879b93f079742b472ef4f1e.1724092799.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/display: platform identification with display->is.<PLATFORM> | expand

Commit Message

Jani Nikula Aug. 19, 2024, 6:44 p.m. UTC
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 <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_device.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Vivi, Rodrigo Aug. 28, 2024, 8:50 p.m. UTC | #1
On Mon, Aug 19, 2024 at 09:44:34PM +0300, Jani Nikula wrote:
> 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.

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 | 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) {
> -- 
> 2.39.2
>
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 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) {