[PATCH 2/4] drm/i915: Enable DisplayPort audio
Chris Wilson
chris at chris-wilson.co.uk
Sun Sep 19 00:43:30 PDT 2010
On Sun, 19 Sep 2010 14:52:07 +0800, Zhenyu Wang <zhenyuw at linux.intel.com> wrote:
> This will turn on DP audio output by checking monitor's audio
> capability.
>
> Tested-by: Wu Fengguang <fengguang.wu at intel.com>
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 61 +++++++++++++++++++++++----------------
> 1 files changed, 36 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 208a4ec..81fca1e 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1444,39 +1444,50 @@ intel_dp_detect(struct drm_connector *connector)
> struct drm_i915_private *dev_priv = dev->dev_private;
> uint32_t temp, bit;
> enum drm_connector_status status;
> + struct edid *edid = NULL;
>
> intel_dp->has_audio = false;
>
> - if (HAS_PCH_SPLIT(dev))
> - return ironlake_dp_detect(connector);
> + if (HAS_PCH_SPLIT(dev)) {
> + status = ironlake_dp_detect(connector);
> + } else {
> + switch (intel_dp->output_reg) {
> + case DP_B:
> + bit = DPB_HOTPLUG_INT_STATUS;
> + break;
> + case DP_C:
> + bit = DPC_HOTPLUG_INT_STATUS;
> + break;
> + case DP_D:
> + bit = DPD_HOTPLUG_INT_STATUS;
> + break;
> + default:
> + return connector_status_unknown;
> + }
Move the switch and register check into a separate function, so
the main detect body becomes:
if (HAS_PCH_SPLIT(dev))
status = ironlake_dp_detect(connector);
else
status = g4x_dp_detect(connector);
if (status != connector_status_connected)
return status;
--
Chris Wilson, Intel Open Source Technology Centre
More information about the dri-devel
mailing list