Merge tag 'v4.4-rc2' into drm-intel-next-queued
[sfrench/cifs-2.6.git] / drivers / gpu / drm / i915 / i915_irq.c
index 78f0ac3d1e7f297df9da720a9e9a56e7f697843e..c8ba94968aaf4ed259fe757af8768ff1d03bd3a2 100644 (file)
@@ -654,7 +654,7 @@ static void i915_enable_asle_pipestat(struct drm_device *dev)
  *   of horizontal active on the first line of vertical active
  */
 
-static u32 i8xx_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 i8xx_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 {
        /* Gen2 doesn't have a hardware frame counter */
        return 0;
@@ -663,7 +663,7 @@ static u32 i8xx_get_vblank_counter(struct drm_device *dev, int pipe)
 /* Called from drm generic code, passed a 'crtc', which
  * we use as a pipe index
  */
-static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 i915_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        i915_reg_t high_frame, low_frame;
@@ -710,7 +710,7 @@ static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
        return (((high1 << 8) | low) + (pixel >= vbl_start)) & 0xffffff;
 }
 
-static u32 g4x_get_vblank_counter(struct drm_device *dev, int pipe)
+static u32 g4x_get_vblank_counter(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
 
@@ -747,7 +747,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
         * problem.  We may need to extend this to include other platforms,
         * but so far testing only shows the problem on HSW.
         */
-       if (IS_HASWELL(dev) && !position) {
+       if (HAS_DDI(dev) && !position) {
                int i, temp;
 
                for (i = 0; i < 100; i++) {
@@ -768,7 +768,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
        return (position + crtc->scanline_offset) % vtotal;
 }
 
-static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
+static int i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int pipe,
                                    unsigned int flags, int *vpos, int *hpos,
                                    ktime_t *stime, ktime_t *etime,
                                    const struct drm_display_mode *mode)
@@ -905,27 +905,27 @@ int intel_get_crtc_scanline(struct intel_crtc *crtc)
        return position;
 }
 
-static int i915_get_vblank_timestamp(struct drm_device *dev, int pipe,
+static int i915_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe,
                              int *max_error,
                              struct timeval *vblank_time,
                              unsigned flags)
 {
        struct drm_crtc *crtc;
 
-       if (pipe < 0 || pipe >= INTEL_INFO(dev)->num_pipes) {
-               DRM_ERROR("Invalid crtc %d\n", pipe);
+       if (pipe >= INTEL_INFO(dev)->num_pipes) {
+               DRM_ERROR("Invalid crtc %u\n", pipe);
                return -EINVAL;
        }
 
        /* Get drm_crtc to timestamp: */
        crtc = intel_get_crtc_for_pipe(dev, pipe);
        if (crtc == NULL) {
-               DRM_ERROR("Invalid crtc %d\n", pipe);
+               DRM_ERROR("Invalid crtc %u\n", pipe);
                return -EINVAL;
        }
 
        if (!crtc->hwmode.crtc_clock) {
-               DRM_DEBUG_KMS("crtc %d is disabled\n", pipe);
+               DRM_DEBUG_KMS("crtc %u is disabled\n", pipe);
                return -EBUSY;
        }
 
@@ -2620,7 +2620,7 @@ void i915_handle_error(struct drm_device *dev, bool wedged,
 /* Called from drm generic code, passed 'crtc' which
  * we use as a pipe index
  */
-static int i915_enable_vblank(struct drm_device *dev, int pipe)
+static int i915_enable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2637,7 +2637,7 @@ static int i915_enable_vblank(struct drm_device *dev, int pipe)
        return 0;
 }
 
-static int ironlake_enable_vblank(struct drm_device *dev, int pipe)
+static int ironlake_enable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2651,7 +2651,7 @@ static int ironlake_enable_vblank(struct drm_device *dev, int pipe)
        return 0;
 }
 
-static int valleyview_enable_vblank(struct drm_device *dev, int pipe)
+static int valleyview_enable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2664,7 +2664,7 @@ static int valleyview_enable_vblank(struct drm_device *dev, int pipe)
        return 0;
 }
 
-static int gen8_enable_vblank(struct drm_device *dev, int pipe)
+static int gen8_enable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2680,7 +2680,7 @@ static int gen8_enable_vblank(struct drm_device *dev, int pipe)
 /* Called from drm generic code, passed 'crtc' which
  * we use as a pipe index
  */
-static void i915_disable_vblank(struct drm_device *dev, int pipe)
+static void i915_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2692,7 +2692,7 @@ static void i915_disable_vblank(struct drm_device *dev, int pipe)
        spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-static void ironlake_disable_vblank(struct drm_device *dev, int pipe)
+static void ironlake_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2704,7 +2704,7 @@ static void ironlake_disable_vblank(struct drm_device *dev, int pipe)
        spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-static void valleyview_disable_vblank(struct drm_device *dev, int pipe)
+static void valleyview_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -2715,7 +2715,7 @@ static void valleyview_disable_vblank(struct drm_device *dev, int pipe)
        spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 }
 
-static void gen8_disable_vblank(struct drm_device *dev, int pipe)
+static void gen8_disable_vblank(struct drm_device *dev, unsigned int pipe)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        unsigned long irqflags;
@@ -4237,9 +4237,10 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
 
        /* Ignore TV since it's buggy */
        i915_hotplug_interrupt_update_locked(dev_priv,
-                                     (HOTPLUG_INT_EN_MASK
-                                      | CRT_HOTPLUG_VOLTAGE_COMPARE_MASK),
-                                     hotplug_en);
+                                            HOTPLUG_INT_EN_MASK |
+                                            CRT_HOTPLUG_VOLTAGE_COMPARE_MASK |
+                                            CRT_HOTPLUG_ACTIVATION_PERIOD_64,
+                                            hotplug_en);
 }
 
 static irqreturn_t i965_irq_handler(int irq, void *arg)