From patchwork Sun Sep 9 17:58:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1427981 Return-Path: X-Original-To: patchwork-intel-gfx@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 C71E8402E1 for ; Sun, 9 Sep 2012 19:06:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72C559EECA for ; Sun, 9 Sep 2012 12:06:36 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id BAE7F9E78C for ; Sun, 9 Sep 2012 12:06:23 -0700 (PDT) Received: by eekc13 with SMTP id c13so626321eek.36 for ; Sun, 09 Sep 2012 12:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=4vM25BDta/doOCPfLlI047uYCGwqeX4NblX2WJsfn0Q=; b=lCDQgjn5HnEm6Jg9RIfod1tJFa8JATAN0chjDnpzREPo6//Ea44yN9jpwNPvnd38JK hw4L5hWNpyASQqSznijtu42aloOF67519SjkAvQF826yi1nf25mIeTGplRipONX1zr6+ kieNXFaaUbY4qLBdOB6HoinNoIj0UxxknB+/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=4vM25BDta/doOCPfLlI047uYCGwqeX4NblX2WJsfn0Q=; b=OwmS3f2hSbRhPfA649ourIPPkW9odTkmZudmCMmXkbGrjhLeiMaAjDVWvgtgP6o5uB Bf1nF77KRYB57sfRR+0PqMNVBnpLOdksxatqcadAvS4Xmww8/cZWq6WZRk2dA2T74Pax qsYyH/lg4hfeRvxj6DdQ75O1EIR3D5N+Z/V/F6KDk7FDSbiJ6aDjT2MrbllyA7Befj2K Ko5dbFVYiYqy1PxQkEF0fygD1LqMGt9jokKONMLzDddYpSP02CBL3p4Pl4XHYCVM2A/n 016Wdieb5yZhFZgN7GqTb0JYx1q3RdqssNm2gEky6iRoCYM0bOxxMkSdsj+sKNGUuomN DOpA== Received: by 10.204.152.207 with SMTP id h15mr3339120bkw.5.1347217582686; Sun, 09 Sep 2012 12:06:22 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id g6sm5590683bkg.2.2012.09.09.12.06.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 12:06:21 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Sun, 9 Sep 2012 19:58:56 +0200 Message-Id: <1347213536-20340-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.2 X-Gm-Message-State: ALoCoQmtIwAizrZ7qBOJY6PAUsLXmcFs5W3M++Q3azVGs0rgkclvGzu/41FGGwSxHHtRfNjDraZ3 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/i915: rip out edp special case from dp_link_down 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: , MIME-Version: 1.0 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 This has been tons of fun to figure out with git blame. The first notion of this code block goes back to the original cpu edp enabling for ilk in commit 32f9d658aee5be09ebdd28fc730630e61d0b46db Author: Zhenyu Wang Date: Fri Jul 24 01:00:32 2009 +0800 drm/i915: Add eDP support on IGDNG mobile chip Two things are notable in this commit wrt to the this edp special case: - The IS_eDP check _only_ fires for DP A, i.e. cpu edp ports. - The cpu edp port is disabled at the top of the dp_link_down function. My theory is that these hacks was added to work around the completely different modeset sequence for cpu edp ports compared to pch edp ports. With the cpu edp confusion on ilk (and snb/ivb) now fixed up, this shouldn't be required any more. The really interesting question is how this special cases survived this long in the code. The first step is declaring the pch port D as eDP if it's used for an internal panel: commit b329530ca7cdf6bf014f2124efd983e01265d623 Author: Adam Jackson Date: Fri Jul 16 14:46:28 2010 -0400 drm/i915/dp: Correctly report eDP in the core connector type This commit unfortunately failed to notice that not all edp ports are created equal. Then follow a flurry of refactorings, culminating in a patch from Keith Packard which resulted in the current logic (by making it "correct" for all platforms that have edp): commit 417e822deee1d2bcd8a8a60660c40a0903713f2b Author: Keith Packard Date: Tue Nov 1 19:54:11 2011 -0700 drm/i915: Treat PCH eDP like DP in most places None of these cleanups or refactorings supply any reason why we need this code, they've simply carried it on as-is. Hence presume it might be harmful with the current code and rip it out. We do rewrite the link training bits completely anyway when re-training the link. Signed-off-by: Daniel Vetter Reviewed-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_dp.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f28353d..8adad5e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1934,13 +1934,6 @@ intel_dp_link_down(struct intel_dp *intel_dp) msleep(17); - if (is_edp(intel_dp)) { - if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) - DP |= DP_LINK_TRAIN_OFF_CPT; - else - DP |= DP_LINK_TRAIN_OFF; - } - if (HAS_PCH_IBX(dev) && I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) { struct drm_crtc *crtc = intel_dp->base.base.crtc;