From patchwork Sun Sep 19 06:52:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 193142 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8J6rtCZ011017 for ; Sun, 19 Sep 2010 06:54:31 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9EE99F078 for ; Sat, 18 Sep 2010 23:53:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FCA49E79E; Sat, 18 Sep 2010 23:52:13 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 18 Sep 2010 23:52:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,388,1280732400"; d="scan'208";a="838951240" Received: from ubuntu-hp.sh.intel.com ([10.239.36.210]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2010 23:52:12 -0700 From: Zhenyu Wang To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm/i915: Enable DisplayPort audio Date: Sun, 19 Sep 2010 14:52:07 +0800 Message-Id: <1284879129-19720-3-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284879129-19720-1-git-send-email-zhenyuw@linux.intel.com> References: <1284879129-19720-1-git-send-email-zhenyuw@linux.intel.com> Cc: intel-gfx@lists.freedesktop.org, fengguang.wu@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 19 Sep 2010 06:54:32 +0000 (UTC) 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; + } - 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; - } + temp = I915_READ(PORT_HOTPLUG_STAT); - temp = I915_READ(PORT_HOTPLUG_STAT); + if ((temp & bit) == 0) + return connector_status_disconnected; - if ((temp & bit) == 0) - return connector_status_disconnected; + status = connector_status_disconnected; + if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, + sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) + { + if (intel_dp->dpcd[0] != 0) + status = connector_status_connected; + } + } - status = connector_status_disconnected; - if (intel_dp_aux_native_read(intel_dp, - 0x000, intel_dp->dpcd, - sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) - { - if (intel_dp->dpcd[0] != 0) - status = connector_status_connected; + if (status == connector_status_connected) { + edid = drm_get_edid(connector, intel_dp->base.ddc_bus); + if (edid) { + intel_dp->has_audio = drm_detect_monitor_audio(edid); + connector->display_info.raw_edid = NULL; + kfree(edid); + } } + return status; }