From patchwork Fri Sep 14 14:19:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 1459061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 80C98DF280 for ; Fri, 14 Sep 2012 14:19:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 622A1A1029 for ; Fri, 14 Sep 2012 07:19:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 94432A1017 for ; Fri, 14 Sep 2012 07:19:23 -0700 (PDT) Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 4B98AA30EC for ; Fri, 14 Sep 2012 16:19:22 +0200 (CEST) Date: Fri, 14 Sep 2012 16:19:22 +0200 Message-ID: From: Takashi Iwai To: intel-gfx@lists.freedesktop.org User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: mmarek@suse.cz Subject: [Intel-gfx] Valid DP connection without EDID? X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Hi, we've got a machine showing a ghost DP2 output on a docking station. The docking station has only one DP port and it's connected to DP1. As a result, we get an DP2 active output containing the bogus VESA standard modes 1024x768, 800x600, 640x480 although it's not connected at all. Looking a bit deeply on it, it seems that the connector gives actually the valid DPCD. So intel_dp_detect() returns connector_status_connected. But since there is no real connection, EDID isn't obtained. Thus of course no valid modes set. A quick patch below adds (moves) a check of EDID and returns the disconnected state when no valid EDID is returned. An open question is whether this is really safe. Is there any case where no valid EDID is returned but the connection is still valid? thanks, Takashi diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index a6c426a..144da02 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2200,16 +2200,17 @@ intel_dp_detect(struct drm_connector *connector, bool force) intel_dp_probe_oui(intel_dp); + edid = intel_dp_get_edid(connector, &intel_dp->adapter); + if (!edid) + return connector_status_disconnected; + if (intel_dp->force_audio != HDMI_AUDIO_AUTO) { intel_dp->has_audio = (intel_dp->force_audio == HDMI_AUDIO_ON); } else { - edid = intel_dp_get_edid(connector, &intel_dp->adapter); - if (edid) { - intel_dp->has_audio = drm_detect_monitor_audio(edid); - connector->display_info.raw_edid = NULL; - kfree(edid); - } + intel_dp->has_audio = drm_detect_monitor_audio(edid); } + connector->display_info.raw_edid = NULL; + kfree(edid); return connector_status_connected; }