From patchwork Thu Jul 19 21:12:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1218501 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 38C543FD48 for ; Thu, 19 Jul 2012 20:56:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09C1D9F0E5 for ; Thu, 19 Jul 2012 13:56:40 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gh0-f177.google.com (mail-gh0-f177.google.com [209.85.160.177]) by gabe.freedesktop.org (Postfix) with ESMTP id E811A9E923 for ; Thu, 19 Jul 2012 13:56:29 -0700 (PDT) Received: by ghbf11 with SMTP id f11so3519353ghb.36 for ; Thu, 19 Jul 2012 13:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=g14oOEjxnJ/Tc9O8ahTHeokTRDlCSl8iCNBjMONoz/M=; b=KZj0JJXvtM/l1mPFVK9pN2RDzDT5Zh3rwvx56kHv269kNw8Yg2BFrEqaMj8xou9Wzr M/8bG2tjuhUTL/3n6kbxlyt1A5XfXEd1W+QPG0PuiaoRNoRZuhxpA6VKh1klhhpRhnvn aQfSSRsaW+d0/ezrhXZ/riqEhpptJu31gIDOpNZk/CFhXy1KViz/a+5OQ1KD1DOv6rZf FS1Egyydw5VtG21WPhJX3TuI+g6TK3iZPrtCAmSpFNG1HvW0vmhIYal2xQr+rf/KHgZY 3rA+R8fGT1aUZyAIQutfa8uyQAy7SmwCTToIteF9OPuHdu0wNRvctF0cTk+PuTta1R+v Z50g== Received: by 10.101.24.4 with SMTP id b4mr980376anj.55.1342731389447; Thu, 19 Jul 2012 13:56:29 -0700 (PDT) Received: from homer.localdomain.com ([66.187.233.206]) by mx.google.com with ESMTPS id s42sm5723640yhg.7.2012.07.19.13.56.28 (version=SSLv3 cipher=OTHER); Thu, 19 Jul 2012 13:56:28 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: hotplug of passive dp to dvi|hdmi|vga adaptor Date: Thu, 19 Jul 2012 17:12:22 -0400 Message-Id: <1342732342-3896-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Jerome Glisse , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 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 From: Jerome Glisse We should not turn off the connector neither try to retrain DP link if a passive DP adaptor is connected to a DP port. Cc: Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_connectors.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 2914c57..890cf1d 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -49,6 +49,7 @@ void radeon_connector_hotplug(struct drm_connector *connector) struct drm_device *dev = connector->dev; struct radeon_device *rdev = dev->dev_private; struct radeon_connector *radeon_connector = to_radeon_connector(connector); + struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; /* bail if the connector does not have hpd pin, e.g., * VGA, TV, etc. @@ -62,15 +63,32 @@ void radeon_connector_hotplug(struct drm_connector *connector) if (connector->dpms != DRM_MODE_DPMS_ON) return; + /* don't do anything is sink is not display port + * (passive dp->(dvi|hdmi|vga) adaptor + */ + if (radeon_dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) { + return; + } + /* just deal with DP (not eDP) here. */ if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { int saved_dpms = connector->dpms; /* Only turn off the display it it's physically disconnected */ - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); - else if (radeon_dp_needs_link_train(radeon_connector)) + } else if (radeon_dp_needs_link_train(radeon_connector)) { + + /* first get sink type as it's reset after unplug */ + radeon_dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector); + /* don't do anything is sink is not display port + * (passive dp->(dvi|hdmi|vga) adaptor + */ + if (radeon_dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT) { + return; + } drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); + } connector->dpms = saved_dpms; } }