From patchwork Fri Jul 7 02:57:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9829451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C257C60317 for ; Fri, 7 Jul 2017 02:57:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD46E28531 for ; Fri, 7 Jul 2017 02:57:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFA352853D; Fri, 7 Jul 2017 02:57:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2DB8028531 for ; Fri, 7 Jul 2017 02:57:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 693B96E0FC; Fri, 7 Jul 2017 02:57:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9E036E0FC; Fri, 7 Jul 2017 02:57:27 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id 77so4527478wrb.3; Thu, 06 Jul 2017 19:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RrB6dXAnT3W/xb6uEs8fmx04PidcMP4fkSyYDS7KnjY=; b=V2eHpMmOYJrdLGAy+wVVslnb/8UZrSB1AulNQ9BnDfkm9OuwUB8lGhw1lqpxsJHjyo h8Lg74nAUarC/OdVIsxe1nxm0MbpEUiE4KUlj7F/i/mu1QdTWBb7pjbpNJF0JOzOg93p r07L1+dHr7VwpAfdBpuLh3C/IxOKsh4nQ0F+pIu7JmkZWq9pdGWEm3AteK0ViuURmXkt L1U5qQTZBA69Jeu5ngVC97OZvTtzVMaR5ayy2MmmHb+EWdhv1kA29S82XIWpv0A9s3qI H7qCjt9hizD0Fa3YHNRDWW7OMeOqkjiz0tEbF4Bb+LVEjXJML/dgrthr197JAuxBX/CO O7Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RrB6dXAnT3W/xb6uEs8fmx04PidcMP4fkSyYDS7KnjY=; b=Sp4NlIroyYhazpFNcxj+NUAD3qeXzlN5XU3FElIYwFTSO9eItPXF03Pl5teWyJciaJ yWyQJLSgd2ektQ2Y+Eit7cuYkZQie3d4ij8GNIcSWtD/IwV5vGTMOLskJxenntbhJjse CEhgDU2FjIzW23kvTcrix5n9OP1TNRy6uieqjccueLFT4w881zERkUvVBkFZQqN/MUZW vMXHKSv1yLzVvpUJRLU/kiGRpu6C5BmiGHL4fKzD0OLyZX4LwQTdEPor/I8QlwVBZB1W MG70JV5hElhMZw7ba8H6V0UJmcWnRm3lnxoASq1TvwevA2IZa9ohjm859/KKQTklsxzv OMgQ== X-Gm-Message-State: AIVw112A+my9DMHsfyJEAm6LTLxalbkZ2QG5VFscw2hyqe+WVvGlaNJm JR+Y2MXv5wzGxVCo X-Received: by 10.28.87.205 with SMTP id l196mr568838wmb.121.1499396246043; Thu, 06 Jul 2017 19:57:26 -0700 (PDT) Received: from twisty.cin.medizin.uni-tuebingen.de (cin-11.medizin.uni-tuebingen.de. [134.2.118.242]) by smtp.gmail.com with ESMTPSA id e31sm2602094wre.54.2017.07.06.19.57.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 19:57:25 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: Fix eDP for single-display iMac10,1 (v2) Date: Fri, 7 Jul 2017 04:57:04 +0200 Message-Id: <20170707025704.1864-1-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.13.0.rc1.294.g07d810a77f MIME-Version: 1.0 Cc: Alex Deucher , =?UTF-8?q?Michel=20D=C3=A4nzer?= , stable@vger.kernel.org, amd-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The late 2009, 27 inch Apple iMac10,1 has an internal eDP display and an external Mini- Displayport output, driven by a DCE-3.2, RV730 Radeon Mobility HD-4670. The machine worked fine in a dual-display setup with eDP panel + externally connected HDMI or DVI-D digital display sink, connected via MiniDP to DVI or HDMI adapter. However, booting the machine single-display with only eDP panel results in a completely black display - even backlight powering off, as soon as the radeon modesetting driver loads. This patch fixes the single dispay eDP case by assigning encoders based on dig->linkb, similar to DCE-4+. While this should not be generally necessary (Alex: "...atom on normal boards should be able to handle any mapping."), Apple seems to use some special routing here. One remaining problem not solved by this patch is that an external Minidisplayport->DP sink does still not work on iMac10,1, whereas external DVI and HDMI sinks continue to work. The problem affects at least all tested kernels since Linux 3.13 - didn't test earlier kernels, so backporting to stable probably makes sense. v2: With the original patch from 2016, Alex was worried it will break other DCE3.2 systems. Use dmi_match() to apply this special encoder assignment only for the Apple iMac 10,1 from late 2009. Signed-off-by: Mario Kleiner Cc: Alex Deucher Cc: Michel Dänzer Cc: --- drivers/gpu/drm/radeon/atombios_encoders.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index fa4f8f0..e67ed38 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -31,6 +31,7 @@ #include "radeon_asic.h" #include "atom.h" #include +#include extern int atom_debug; @@ -2184,9 +2185,17 @@ int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder, int fe_idx) goto assigned; } - /* on DCE32 and encoder can driver any block so just crtc id */ + /* + * On DCE32 any encoder can drive any block so usually just use crtc id, + * but Apple thinks different at least on iMac10,1, so there use linkb, + * otherwise the internal eDP panel will stay dark. + */ if (ASIC_IS_DCE32(rdev)) { - enc_idx = radeon_crtc->crtc_id; + if (dmi_match(DMI_PRODUCT_NAME, "iMac10,1")) + enc_idx = (dig->linkb) ? 1 : 0; + else + enc_idx = radeon_crtc->crtc_id; + goto assigned; }