drm/i915: Initialize drm_driver vblank funcs at compile time
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 19 Jun 2019 17:08:42 +0000 (20:08 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 26 Jun 2019 16:23:28 +0000 (19:23 +0300)
Move the .get_vblank_timestamp() and .get_scanout_position()
initialization to happen at compile time. No point in delaying
it since we always assign the same functions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190619170842.20579-5-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/i915_irq.h

index 441a68338b9be3547c2aae2d4b2a4ea98b8c3d69..12182d2fc03cdb636959d9110ccd531265f362d8 100644 (file)
@@ -3232,6 +3232,9 @@ static struct drm_driver driver = {
        .gem_prime_export = i915_gem_prime_export,
        .gem_prime_import = i915_gem_prime_import,
 
+       .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
+       .get_scanout_position = i915_get_crtc_scanoutpos,
+
        .dumb_create = i915_gem_dumb_create,
        .dumb_map_offset = i915_gem_mmap_gtt,
        .ioctls = i915_ioctls,
index c76c498769d80e6d33317e3920e3e6e6de3d0091..1b83d6e2ae697f5fa964ef36143596f9c40fbb78 100644 (file)
@@ -1109,10 +1109,10 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
        return (position + crtc->scanline_offset) % vtotal;
 }
 
-static bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
-                                    bool in_vblank_irq, int *vpos, int *hpos,
-                                    ktime_t *stime, ktime_t *etime,
-                                    const struct drm_display_mode *mode)
+bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
+                             bool in_vblank_irq, int *vpos, int *hpos,
+                             ktime_t *stime, ktime_t *etime,
+                             const struct drm_display_mode *mode)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
        struct intel_crtc *intel_crtc = intel_get_crtc_for_pipe(dev_priv,
@@ -4789,9 +4789,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
         */
        dev_priv->hotplug.hpd_short_storm_enabled = !HAS_DP_MST(dev_priv);
 
-       dev->driver->get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos;
-       dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
-
        if (HAS_GMCH(dev_priv)) {
                if (I915_HAS_HOTPLUG(dev_priv))
                        dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
index ef782e5ab24071d73e79659e0e17090aa8283cb1..5af5654f801d9f7c6be7a508ef4e7903a67e6c9c 100644 (file)
@@ -114,6 +114,11 @@ void gen11_reset_guc_interrupts(struct drm_i915_private *i915);
 void gen11_enable_guc_interrupts(struct drm_i915_private *i915);
 void gen11_disable_guc_interrupts(struct drm_i915_private *i915);
 
+bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
+                             bool in_vblank_irq, int *vpos, int *hpos,
+                             ktime_t *stime, ktime_t *etime,
+                             const struct drm_display_mode *mode);
+
 u32 i915_get_vblank_counter(struct drm_crtc *crtc);
 u32 g4x_get_vblank_counter(struct drm_crtc *crtc);