drm/i915/display: Pass drm_i915_private as param to i915 funcs
authorNirmoy Das <nirmoy.das@intel.com>
Wed, 25 Jan 2023 09:56:03 +0000 (10:56 +0100)
committerAndi Shyti <andi.shyti@linux.intel.com>
Fri, 10 Feb 2023 15:16:21 +0000 (16:16 +0100)
For i915 functions pass struct drm_i915_private directly instead of
struct drm_device.

v2: Use to_i915(dev) directly without alias(Andrzej).

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125095603.17845-1-nirmoy.das@intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_fbdev.c
drivers/gpu/drm/i915/display/intel_fbdev.h
drivers/gpu/drm/i915/i915_driver.c

index a8c91fd..322f3b2 100644 (file)
@@ -9051,7 +9051,7 @@ void intel_display_driver_register(struct drm_i915_private *i915)
         * enabled. We do it last so that the async config cannot run
         * before the connectors are registered.
         */
-       intel_fbdev_initial_config_async(&i915->drm);
+       intel_fbdev_initial_config_async(i915);
 
        /*
         * We need to coordinate the hotplugs with the asynchronous
index d39db80..10b9bc6 100644 (file)
@@ -559,9 +559,9 @@ static void intel_fbdev_initial_config(void *data, async_cookie_t cookie)
                intel_fbdev_unregister(to_i915(ifbdev->helper.dev));
 }
 
-void intel_fbdev_initial_config_async(struct drm_device *dev)
+void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv)
 {
-       struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev;
+       struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;
 
        if (!ifbdev)
                return;
@@ -698,9 +698,9 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
                drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
 
-void intel_fbdev_restore_mode(struct drm_device *dev)
+void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv)
 {
-       struct intel_fbdev *ifbdev = to_i915(dev)->display.fbdev.fbdev;
+       struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;
 
        if (!ifbdev)
                return;
index 0e95e94..04fd523 100644 (file)
@@ -15,12 +15,12 @@ struct intel_framebuffer;
 
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 int intel_fbdev_init(struct drm_device *dev);
-void intel_fbdev_initial_config_async(struct drm_device *dev);
+void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv);
 void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
 void intel_fbdev_fini(struct drm_i915_private *dev_priv);
 void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
 void intel_fbdev_output_poll_changed(struct drm_device *dev);
-void intel_fbdev_restore_mode(struct drm_device *dev);
+void intel_fbdev_restore_mode(struct drm_i915_private *dev_priv);
 struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev);
 #else
 static inline int intel_fbdev_init(struct drm_device *dev)
@@ -28,7 +28,7 @@ static inline int intel_fbdev_init(struct drm_device *dev)
        return 0;
 }
 
-static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
+static inline void intel_fbdev_initial_config_async(struct drm_i915_private *dev_priv)
 {
 }
 
@@ -48,7 +48,7 @@ static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 }
 
-static inline void intel_fbdev_restore_mode(struct drm_device *dev)
+static inline void intel_fbdev_restore_mode(struct drm_i915_private *i915)
 {
 }
 static inline struct intel_framebuffer *intel_fbdev_framebuffer(struct intel_fbdev *fbdev)
index 7f9df11..27b496a 100644 (file)
@@ -940,7 +940,7 @@ static void i915_driver_lastclose(struct drm_device *dev)
 {
        struct drm_i915_private *i915 = to_i915(dev);
 
-       intel_fbdev_restore_mode(dev);
+       intel_fbdev_restore_mode(i915);
 
        if (HAS_DISPLAY(i915))
                vga_switcheroo_process_delayed_switch();