Identify discrete graphics separately in display, using the platform
group mechanism. This enables dropping the dependency on i915_drv.h
IS_DGFX() from display code.

Start grouping platform groups separately in INTEL_DISPLAY_PLATFORMS()
in anticipation of more groups to come.

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

diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c 
b/drivers/gpu/drm/i915/display/intel_display_device.c
index 5f98e1b2a401..47957384d56d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -1011,6 +1011,7 @@ static const enum intel_step dg1_steppings[] = {
 
 static const struct platform_desc dg1_desc = {
        PLATFORM(dg1),
+       PLATFORM_GROUP(dgfx),
        .info = &(const struct intel_display_device_info) {
                XE_D_DISPLAY,
 
@@ -1238,6 +1239,7 @@ static const enum intel_step dg2_g12_steppings[] = {
 
 static const struct platform_desc dg2_desc = {
        PLATFORM(dg2),
+       PLATFORM_GROUP(dgfx),
        .subplatforms = (const struct subplatform_desc[]) {
                {
                        SUBPLATFORM(dg2, g10),
@@ -1338,6 +1340,7 @@ static const struct platform_desc lnl_desc = {
 
 static const struct platform_desc bmg_desc = {
        PLATFORM(battlemage),
+       PLATFORM_GROUP(dgfx),
 };
 
 static const struct platform_desc ptl_desc = {
@@ -1636,9 +1639,10 @@ void intel_display_device_probe(struct drm_i915_private 
*i915)
 
        DISPLAY_RUNTIME_INFO(i915)->step = step;
 
-       drm_info(&i915->drm, "Found %s%s%s (device ID %04x) display version 
%u.%02u stepping %s\n",
+       drm_info(&i915->drm, "Found %s%s%s (device ID %04x) %s display version 
%u.%02u stepping %s\n",
                 desc->name, subdesc ? "/" : "", subdesc ? subdesc->name : "",
-                pdev->device, DISPLAY_RUNTIME_INFO(i915)->ip.ver,
+                pdev->device, display->platform.dgfx ? "discrete" : 
"integrated",
+                DISPLAY_RUNTIME_INFO(i915)->ip.ver,
                 DISPLAY_RUNTIME_INFO(i915)->ip.rel,
                 step != STEP_NONE ? intel_step_name(step) : "N/A");
 
diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h 
b/drivers/gpu/drm/i915/display/intel_display_device.h
index 43144a037f9f..392fbe29e974 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.h
+++ b/drivers/gpu/drm/i915/display/intel_display_device.h
@@ -21,6 +21,9 @@ struct drm_printer;
  * platform.
  */
 #define INTEL_DISPLAY_PLATFORMS(func) \
+       /* Platform group aliases */ \
+       func(g4x) /* g45 and gm45 */ \
+       func(dgfx) /* discrete graphics */ \
        /* Display ver 2 */ \
        func(i830) \
        func(i845g) \
@@ -38,7 +41,6 @@ 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

Reply via email to