diff mbox series

[v4,09/15] drm/i915/display: add platform group for g4x

Message ID c189ffb52003b4bf7a85eedf1d98a93ae7a0df36.1729518793.git.jani.nikula@intel.com (mailing list archive)
State New, archived
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 platform groups, such as g4x that
covers both g45 and gm45.

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

Comments

Rodrigo Vivi Oct. 22, 2024, 5:45 p.m. UTC | #1
On Mon, Oct 21, 2024 at 04:54:10PM +0300, Jani Nikula wrote:
> Add support for defining aliases for platform groups, such as g4x that
> covers both g45 and gm45.
> 
> 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 | 9 +++++++++
>  drivers/gpu/drm/i915/display/intel_display_device.h | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index e9d56f8aa3ab..50ffb31662b1 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -53,6 +53,13 @@ struct platform_desc {
>  	.platforms._platform = 1,		 \
>  	.name = #_platform
>  
> +/*
> + * Group platform alias that matches multiple platforms. For aliases such as g4x
> + * that covers both g45 and gm45.
> + */
> +#define PLATFORM_GROUP(_platform)		\
> +	.platforms._platform = 1
> +
>  #define ID(id) (id)
>  
>  static const struct intel_display_device_info no_display = {};
> @@ -387,6 +394,7 @@ static const struct platform_desc i965gm_desc = {
>  
>  static const struct platform_desc g45_desc = {
>  	PLATFORM(g45),
> +	PLATFORM_GROUP(g4x),
>  	.info = &(const struct intel_display_device_info) {
>  		GEN4_DISPLAY,
>  
> @@ -396,6 +404,7 @@ static const struct platform_desc g45_desc = {
>  
>  static const struct platform_desc gm45_desc = {
>  	PLATFORM(gm45),
> +	PLATFORM_GROUP(g4x),
>  	.info = &(const struct intel_display_device_info) {
>  		GEN4_DISPLAY,
>  		.supports_tv = 1,
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
> index b240c28db2cb..745d03f49acf 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.h
> @@ -38,6 +38,7 @@ struct drm_printer;
>  	func(i965gm) \
>  	func(g45) \
>  	func(gm45) \
> +	func(g4x) /* group alias for g45 and gm45 */ \
>  	/* Display ver 5 */ \
>  	func(ironlake) \
>  	/* Display ver 6 */ \
> -- 
> 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 e9d56f8aa3ab..50ffb31662b1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -53,6 +53,13 @@  struct platform_desc {
 	.platforms._platform = 1,		 \
 	.name = #_platform
 
+/*
+ * Group platform alias that matches multiple platforms. For aliases such as g4x
+ * that covers both g45 and gm45.
+ */
+#define PLATFORM_GROUP(_platform)		\
+	.platforms._platform = 1
+
 #define ID(id) (id)
 
 static const struct intel_display_device_info no_display = {};
@@ -387,6 +394,7 @@  static const struct platform_desc i965gm_desc = {
 
 static const struct platform_desc g45_desc = {
 	PLATFORM(g45),
+	PLATFORM_GROUP(g4x),
 	.info = &(const struct intel_display_device_info) {
 		GEN4_DISPLAY,
 
@@ -396,6 +404,7 @@  static const struct platform_desc g45_desc = {
 
 static const struct platform_desc gm45_desc = {
 	PLATFORM(gm45),
+	PLATFORM_GROUP(g4x),
 	.info = &(const struct intel_display_device_info) {
 		GEN4_DISPLAY,
 		.supports_tv = 1,
diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h
index b240c28db2cb..745d03f49acf 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.h
+++ b/drivers/gpu/drm/i915/display/intel_display_device.h
@@ -38,6 +38,7 @@  struct drm_printer;
 	func(i965gm) \
 	func(g45) \
 	func(gm45) \
+	func(g4x) /* group alias for g45 and gm45 */ \
 	/* Display ver 5 */ \
 	func(ironlake) \
 	/* Display ver 6 */ \