]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: move more of the display probe to display code
authorJani Nikula <jani.nikula@intel.com>
Tue, 12 Sep 2023 12:05:35 +0000 (15:05 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 15 Sep 2023 15:29:05 +0000 (18:29 +0300)
Initializing i915->display.info.__device_info and DISPLAY_RUNTIME_INFO()
really belongs in display code. Move them there.

Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230912120537.2158209-1-jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display_device.c
drivers/gpu/drm/i915/display/intel_display_device.h
drivers/gpu/drm/i915/intel_device_info.c

index c39f8a15d8aae99711adc7f8c2a2d12f60f8cde1..ed564566e31b978949286b21297b1c059fb2cc8d 100644 (file)
@@ -850,9 +850,9 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step
        return &no_display;
 }
 
-const struct intel_display_device_info *
-intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
-                          u16 *gmdid_ver, u16 *gmdid_rel, u16 *gmdid_step)
+static const struct intel_display_device_info *
+probe_display(struct drm_i915_private *i915, bool has_gmdid,
+             u16 *gmdid_ver, u16 *gmdid_rel, u16 *gmdid_step)
 {
        struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
        int i;
@@ -876,6 +876,24 @@ intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
        return &no_display;
 }
 
+void intel_display_device_probe(struct drm_i915_private *i915)
+{
+       u16 ver, rel, step;
+
+       /* Probe display support */
+       i915->display.info.__device_info = probe_display(i915, HAS_GMD_ID(i915),
+                                                        &ver, &rel, &step);
+       memcpy(DISPLAY_RUNTIME_INFO(i915),
+              &DISPLAY_INFO(i915)->__runtime_defaults,
+              sizeof(*DISPLAY_RUNTIME_INFO(i915)));
+
+       if (HAS_GMD_ID(i915)) {
+               DISPLAY_RUNTIME_INFO(i915)->ip.ver = ver;
+               DISPLAY_RUNTIME_INFO(i915)->ip.rel = rel;
+               DISPLAY_RUNTIME_INFO(i915)->ip.step = step;
+       }
+}
+
 void intel_display_device_info_runtime_init(struct drm_i915_private *i915)
 {
        struct intel_display_runtime_info *display_runtime = DISPLAY_RUNTIME_INFO(i915);
index 8198401aa5be8074202595803506a9f03f9fd5c2..a7b6469b43a6a05d15269dbc0847003b228dad5b 100644 (file)
@@ -149,9 +149,7 @@ struct intel_display_device_info {
        } color;
 };
 
-const struct intel_display_device_info *
-intel_display_device_probe(struct drm_i915_private *i915, bool has_gmdid,
-                          u16 *ver, u16 *rel, u16 *step);
+void intel_display_device_probe(struct drm_i915_private *i915);
 void intel_display_device_info_runtime_init(struct drm_i915_private *i915);
 
 void intel_display_device_info_print(const struct intel_display_device_info *info,
index ea0ec6174ce50cfc845e8a5c09be9ce93733e974..20bd73f9d0497cd1aae657e00e60eddcda70d647 100644 (file)
@@ -424,7 +424,6 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
                                     const struct intel_device_info *match_info)
 {
        struct intel_runtime_info *runtime;
-       u16 ver, rel, step;
 
        /* Setup INTEL_INFO() */
        i915->__info = match_info;
@@ -433,18 +432,7 @@ void intel_device_info_driver_create(struct drm_i915_private *i915,
        runtime = RUNTIME_INFO(i915);
        memcpy(runtime, &INTEL_INFO(i915)->__runtime, sizeof(*runtime));
 
-       /* Probe display support */
-       i915->display.info.__device_info = intel_display_device_probe(i915, HAS_GMD_ID(i915),
-                                                                     &ver, &rel, &step);
-       memcpy(DISPLAY_RUNTIME_INFO(i915),
-              &DISPLAY_INFO(i915)->__runtime_defaults,
-              sizeof(*DISPLAY_RUNTIME_INFO(i915)));
-
-       if (HAS_GMD_ID(i915)) {
-               DISPLAY_RUNTIME_INFO(i915)->ip.ver = ver;
-               DISPLAY_RUNTIME_INFO(i915)->ip.rel = rel;
-               DISPLAY_RUNTIME_INFO(i915)->ip.step = step;
-       }
+       intel_display_device_probe(i915);
 
        runtime->device_id = device_id;
 }