Re: [PATCH 1/2] drm/i915: Introduce new intel_output_name()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/11/29 Damien Lespiau <damien.lespiau@xxxxxxxxx>:
> That we can use for debugging purposes.
>
> Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++++
>  drivers/gpu/drm/i915/intel_drv.h     |  1 +
>  2 files changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5dff7ca..ec5ae69 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10213,6 +10213,19 @@ static bool has_edp_a(struct drm_device *dev)
>         return true;
>  }
>
> +const char *intel_output_name(int output)
> +{
> +       static const char *names[] = {
> +               "Unused", "Analog", "DVO", "SDVO", "LVDS", "TV", "HDMI",
> +               "DisplayPort", "eDP", "DSI", "Unknown"

Optional bikeshed: use designated initializers (not sure if they're
acceptable in the Kernel on arrays...).


> +       };
> +
> +       if (output < 0 || output >= ARRAY_SIZE(names))

Optional bikeshed: WARN in case we hit this.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>


> +               return "Invalid";
> +
> +       return names[output];
> +}
> +
>  static void intel_setup_outputs(struct drm_device *dev)
>  {
>         struct drm_i915_private *dev_priv = dev->dev_private;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 2b5bcb6..dd86961 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -623,6 +623,7 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
>
>
>  /* intel_display.c */
> +const char *intel_output_name(int output);
>  int intel_pch_rawclk(struct drm_device *dev);
>  void intel_mark_busy(struct drm_device *dev);
>  void intel_mark_fb_busy(struct drm_i915_gem_object *obj,
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux