drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 1 Sep 2017 14:31:23 +0000 (17:31 +0300)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 1 Sep 2017 17:30:43 +0000 (10:30 -0700)
Use enum pipe for PCH transcoders also in the FIFO underrun code.

Fixes the following new sparse warnings:
intel_fifo_underrun.c:340:49: warning: mixing different enum types
intel_fifo_underrun.c:340:49:     int enum pipe  versus
intel_fifo_underrun.c:340:49:     int enum transcoder
intel_fifo_underrun.c:344:49: warning: mixing different enum types
intel_fifo_underrun.c:344:49:     int enum pipe  versus
intel_fifo_underrun.c:344:49:     int enum transcoder
intel_fifo_underrun.c:397:57: warning: mixing different enum types
intel_fifo_underrun.c:397:57:     int enum pipe  versus
intel_fifo_underrun.c:397:57:     int enum transcoder
intel_fifo_underrun.c:398:17: warning: mixing different enum types
intel_fifo_underrun.c:398:17:     int enum pipe  versus
intel_fifo_underrun.c:398:17:     int enum transcoder

Cc: Matthias Kaehlcke <mka@chromium.org>
Fixes: a21960339c8c ("drm/i915: Consistently use enum pipe for PCH transcoders")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170901143123.7590-3-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 41c32e5da3ff3922490341a988b2a3ae46d0b6a8)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_trace.h
drivers/gpu/drm/i915/intel_fifo_underrun.c

index b24a83d435592bde89236f12c218f747d1632e04..6fd5c57e21f6cb29f41138c3d02f17702d6e0c59 100644 (file)
@@ -38,7 +38,7 @@ TRACE_EVENT(intel_cpu_fifo_underrun,
 );
 
 TRACE_EVENT(intel_pch_fifo_underrun,
-           TP_PROTO(struct drm_i915_private *dev_priv, enum transcoder pch_transcoder),
+           TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
            TP_ARGS(dev_priv, pch_transcoder),
 
            TP_STRUCT__entry(
@@ -48,7 +48,7 @@ TRACE_EVENT(intel_pch_fifo_underrun,
                             ),
 
            TP_fast_assign(
-                          enum pipe pipe = (enum pipe)pch_transcoder;
+                          enum pipe pipe = pch_transcoder;
                           __entry->pipe = pipe;
                           __entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
                           __entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));
index 5a7cca32c0fab2e3e6b455b6969f9fbf0c1bcc3c..04689600e337ccd8d27b3eec244925e5715000e2 100644 (file)
@@ -187,11 +187,11 @@ static void broadwell_set_fifo_underrun_reporting(struct drm_device *dev,
 }
 
 static void ibx_set_fifo_underrun_reporting(struct drm_device *dev,
-                                           enum transcoder pch_transcoder,
+                                           enum pipe pch_transcoder,
                                            bool enable)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
-       uint32_t bit = (pch_transcoder == TRANSCODER_A) ?
+       uint32_t bit = (pch_transcoder == PIPE_A) ?
                       SDE_TRANSA_FIFO_UNDER : SDE_TRANSB_FIFO_UNDER;
 
        if (enable)
@@ -203,7 +203,7 @@ static void ibx_set_fifo_underrun_reporting(struct drm_device *dev,
 static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
 {
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-       enum transcoder pch_transcoder = (enum transcoder) crtc->pipe;
+       enum pipe pch_transcoder = crtc->pipe;
        uint32_t serr_int = I915_READ(SERR_INT);
 
        lockdep_assert_held(&dev_priv->irq_lock);
@@ -215,12 +215,12 @@ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
        POSTING_READ(SERR_INT);
 
        trace_intel_pch_fifo_underrun(dev_priv, pch_transcoder);
-       DRM_ERROR("pch fifo underrun on pch transcoder %s\n",
-                 transcoder_name(pch_transcoder));
+       DRM_ERROR("pch fifo underrun on pch transcoder %c\n",
+                 pipe_name(pch_transcoder));
 }
 
 static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,
-                                           enum transcoder pch_transcoder,
+                                           enum pipe pch_transcoder,
                                            bool enable, bool old)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
@@ -238,8 +238,8 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,
 
                if (old && I915_READ(SERR_INT) &
                    SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) {
-                       DRM_ERROR("uncleared pch fifo underrun on pch transcoder %s\n",
-                                 transcoder_name(pch_transcoder));
+                       DRM_ERROR("uncleared pch fifo underrun on pch transcoder %c\n",
+                                 pipe_name(pch_transcoder));
                }
        }
 }
@@ -395,8 +395,8 @@ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
        if (intel_set_pch_fifo_underrun_reporting(dev_priv, pch_transcoder,
                                                  false)) {
                trace_intel_pch_fifo_underrun(dev_priv, pch_transcoder);
-               DRM_ERROR("PCH transcoder %s FIFO underrun\n",
-                         transcoder_name(pch_transcoder));
+               DRM_ERROR("PCH transcoder %c FIFO underrun\n",
+                         pipe_name(pch_transcoder));
        }
 }