From patchwork Wed Jul 29 05:25:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ling.ma@intel.com X-Patchwork-Id: 38064 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6T5PInS014908 for ; Wed, 29 Jul 2009 05:25:18 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23D2B9F601; Tue, 28 Jul 2009 22:25:18 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F3509E8C0 for ; Tue, 28 Jul 2009 22:25:15 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 28 Jul 2009 22:13:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,286,1246863600"; d="scan'208";a="434237682" Received: from unknown (HELO localhost.localdomain) ([10.239.36.100]) by orsmga002.jf.intel.com with ESMTP; 28 Jul 2009 22:31:58 -0700 From: ling.ma@intel.com To: intel-gfx@lists.freedesktop.org Date: Wed, 29 Jul 2009 13:25:15 +0800 Message-Id: <1248845115-22508-1-git-send-email-ling.ma@intel.com> X-Mailer: git-send-email 1.5.4.4 Cc: Ma Ling Subject: [Intel-gfx] [PATCH] Detect SDVO digital output according to EDID X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org We send sdvo attach command to check sdvo output status, it is good enough for most cases. However we also should care about the similar case on 4X platform, which also share DDC bus with other analog devices. The patch fixed bug on MP965-D. When plugged VGA by DVI-I output, it shows sdvo dvi is detected incorrectly. Signed-off-by: Ma Ling --- src/i830_sdvo.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c index 8f3193b..f46306e 100644 --- a/src/i830_sdvo.c +++ b/src/i830_sdvo.c @@ -1819,18 +1819,20 @@ i830_sdvo_detect(xf86OutputPtr output) } } + status = XF86OutputStatusConnected; if (response & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) { xf86MonPtr edid_mon; /* Check EDID in DVI-I case */ edid_mon = xf86OutputGetEDID (output, intel_output->pDDCBus); - if (edid_mon && !DIGITAL(edid_mon->features.input_type)) { - xfree(edid_mon); - return XF86OutputStatusDisconnected; + if (edid_mon == NULL || !DIGITAL(edid_mon->features.input_type)) { + status = XF86OutputStatusDisconnected; } - xfree(edid_mon); + + if (edid_mon) + xfree(edid_mon); } - return XF86OutputStatusConnected; + return status; } static DisplayModePtr