drm/i915: make transcoder_name return a string
authorJani Nikula <jani.nikula@intel.com>
Tue, 15 Mar 2016 19:51:10 +0000 (21:51 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 16 Mar 2016 16:09:53 +0000 (18:09 +0200)
Nicer for eDP (actually "EDP" instead of "D"), and makes future
expansion for DSI transcoders easier.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/2ac55ed584e450fe154daecb6453dff8eede5e7d.1458070700.git.jani.nikula@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_fifo_underrun.c

index e5e2982cbd83c9a16b40ff29ebcfb06277a77fb6..33e13116854b49c27e621a4c6e24d024ebd7e736 100644 (file)
@@ -125,7 +125,22 @@ enum transcoder {
        TRANSCODER_EDP,
        I915_MAX_TRANSCODERS
 };
-#define transcoder_name(t) ((t) + 'A')
+
+static inline const char *transcoder_name(enum transcoder transcoder)
+{
+       switch (transcoder) {
+       case TRANSCODER_A:
+               return "A";
+       case TRANSCODER_B:
+               return "B";
+       case TRANSCODER_C:
+               return "C";
+       case TRANSCODER_EDP:
+               return "EDP";
+       default:
+               return "<invalid>";
+       }
+}
 
 /*
  * I915_MAX_PLANES in the enum below is the maximum (across all platforms)
index 79eea3d9427619b8b5b3353d39a8ca43708062c7..f3bcafa22e84ff8ba389618e746af26e1f859175 100644 (file)
@@ -12092,7 +12092,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
        DRM_DEBUG_KMS("[CRTC:%d]%s config %p for pipe %c\n", crtc->base.base.id,
                      context, pipe_config, pipe_name(crtc->pipe));
 
-       DRM_DEBUG_KMS("cpu_transcoder: %c\n", transcoder_name(pipe_config->cpu_transcoder));
+       DRM_DEBUG_KMS("cpu_transcoder: %s\n", transcoder_name(pipe_config->cpu_transcoder));
        DRM_DEBUG_KMS("pipe bpp: %i, dithering: %i\n",
                      pipe_config->pipe_bpp, pipe_config->dither);
        DRM_DEBUG_KMS("fdi/pch: %i, lanes: %i, gmch_m: %u, gmch_n: %u, link_m: %u, link_n: %u, tu: %u\n",
@@ -16221,7 +16221,7 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
        }
 
        for (i = 0; i < error->num_transcoders; i++) {
-               err_printf(m, "CPU transcoder: %c\n",
+               err_printf(m, "CPU transcoder: %s\n",
                           transcoder_name(error->transcoder[i].cpu_transcoder));
                err_printf(m, "  Power: %s\n",
                           onoff(error->transcoder[i].power_domain_on));
index bda526660e20f673815a5e0d8cd3c4d2f36d1694..19e50fdf9a910b429349363254273ae5506dd292 100644 (file)
@@ -212,7 +212,7 @@ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
        I915_WRITE(SERR_INT, SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder));
        POSTING_READ(SERR_INT);
 
-       DRM_ERROR("pch fifo underrun on pch transcoder %c\n",
+       DRM_ERROR("pch fifo underrun on pch transcoder %s\n",
                  transcoder_name(pch_transcoder));
 }
 
@@ -235,7 +235,7 @@ 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 %c\n",
+                       DRM_ERROR("uncleared pch fifo underrun on pch transcoder %s\n",
                                  transcoder_name(pch_transcoder));
                }
        }
@@ -386,7 +386,7 @@ 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))
-               DRM_ERROR("PCH transcoder %c FIFO underrun\n",
+               DRM_ERROR("PCH transcoder %s FIFO underrun\n",
                          transcoder_name(pch_transcoder));
 }