From patchwork Tue Jul 17 20:54:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1206781 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 CE04B3FC8E for ; Tue, 17 Jul 2012 20:41:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B365A0B73 for ; Tue, 17 Jul 2012 13:41:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F1C99E7F9 for ; Tue, 17 Jul 2012 13:41:02 -0700 (PDT) Received: by yenr9 with SMTP id r9so944534yen.36 for ; Tue, 17 Jul 2012 13:41:02 -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=r9NdSNSAIc+Acz7Lv48hyy+axItWZh+RvSgVcFei4pM=; b=lsdtAUBe1dJeByucT34y6WWftL+uUk5mQkUF0duObTmy4KYI8fdlYD0t1HvmdlEoYh bYPJKaMP6nj5+h32dO4Fc7501w88TNd83ucABQ75KfRadSaZOzvChQhYMI9JavzWrHe5 ny9pVbI+5yBWNxwKvEN1eN3Bmvrd9SCC4s00w2Si+FJ2kmouCWkd6Lh0AXR+hEUKbJnh NEL2FbJXnPchXIpQzsZO4JSDrKOQI5wdAlcdADTeqYxrOSMbtA3jA9Q5Kn31HtikFlNB /CNczDOMemoBKxfy71vWti6Ba7H5u2OlksTReI0BVrJX3fRmAtpKSrBaYcm0Lul7Sp7X 5AUw== Received: by 10.50.208.8 with SMTP id ma8mr65075igc.41.1342557661747; Tue, 17 Jul 2012 13:41:01 -0700 (PDT) Received: from homer.localdomain.com ([66.187.233.206]) by mx.google.com with ESMTPS id ai6sm26010302igc.0.2012.07.17.13.41.00 (version=SSLv3 cipher=OTHER); Tue, 17 Jul 2012 13:41:01 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: on hotplug force link training to happen Date: Tue, 17 Jul 2012 16:54:51 -0400 Message-Id: <1342558491-6985-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Jerome Glisse 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 To have kernel behave like VGA/DVI we need to retrain link on hotplug. For this to happen with need to report that we need to link training to happen if we fail to get link status and we need to force link training to happen by setting connector dpms to off before asking it on. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/atombios_dp.c | 2 +- drivers/gpu/drm/radeon/radeon_connectors.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index 5131b3b..7bb5d7e 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -670,7 +670,7 @@ bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector) struct radeon_connector_atom_dig *dig = radeon_connector->con_priv; if (!radeon_dp_get_link_status(radeon_connector, link_status)) - return false; + return true; if (dp_channel_eq_ok(link_status, dig->dp_lane_count)) return false; return true; diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 2914c57..4b42c9f 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -67,10 +67,13 @@ void radeon_connector_hotplug(struct drm_connector *connector) 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)) { + /* force a mode on to trigger dp link training */ + connector->dpms = DRM_MODE_DPMS_OFF; drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); + } connector->dpms = saved_dpms; } }