Commit ba0fbca4 authored by Damien Lespiau's avatar Damien Lespiau Committed by Daniel Vetter

drm/i915: Introduce new intel_output_name()

That we can use for debugging purposes.

v2: Use designated initializers for the 'names' array (Paulo Zanoni,
    Jani Nikula).
    Add a check in case the array has a hole (which can now remain
    unnoticed with designated initializers) (Jani Nikula)

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (for v1)
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 5a65f358
...@@ -10262,6 +10262,28 @@ static bool has_edp_a(struct drm_device *dev) ...@@ -10262,6 +10262,28 @@ static bool has_edp_a(struct drm_device *dev)
return true; return true;
} }
const char *intel_output_name(int output)
{
static const char *names[] = {
[INTEL_OUTPUT_UNUSED] = "Unused",
[INTEL_OUTPUT_ANALOG] = "Analog",
[INTEL_OUTPUT_DVO] = "DVO",
[INTEL_OUTPUT_SDVO] = "SDVO",
[INTEL_OUTPUT_LVDS] = "LVDS",
[INTEL_OUTPUT_TVOUT] = "TV",
[INTEL_OUTPUT_HDMI] = "HDMI",
[INTEL_OUTPUT_DISPLAYPORT] = "DisplayPort",
[INTEL_OUTPUT_EDP] = "eDP",
[INTEL_OUTPUT_DSI] = "DSI",
[INTEL_OUTPUT_UNKNOWN] = "Unknown",
};
if (output < 0 || output >= ARRAY_SIZE(names) || !names[output])
return "Invalid";
return names[output];
}
static void intel_setup_outputs(struct drm_device *dev) static void intel_setup_outputs(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
......
...@@ -625,6 +625,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder, ...@@ -625,6 +625,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
/* intel_display.c */ /* intel_display.c */
const char *intel_output_name(int output);
int intel_pch_rawclk(struct drm_device *dev); int intel_pch_rawclk(struct drm_device *dev);
void intel_mark_busy(struct drm_device *dev); void intel_mark_busy(struct drm_device *dev);
void intel_mark_fb_busy(struct drm_i915_gem_object *obj, void intel_mark_fb_busy(struct drm_i915_gem_object *obj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment