From patchwork Sun Mar 6 01:39:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 8512111 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 583A6C0553 for ; Sun, 6 Mar 2016 01:41:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 479DD20204 for ; Sun, 6 Mar 2016 01:41:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4E1F7201EF for ; Sun, 6 Mar 2016 01:41:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AC586E167; Sun, 6 Mar 2016 01:40:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA5CA6E167 for ; Sun, 6 Mar 2016 01:40:53 +0000 (UTC) Received: by mail-wm0-x229.google.com with SMTP id p65so65626359wmp.1 for ; Sat, 05 Mar 2016 17:40:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=rQ3qy4ns0Pgxwwo15Bt0+hHBLs2YdI2b92B9bfMpx2A=; b=PnfB49FKDJ24BukM+zF3J4q9BiZ8zUqjpyp2Bm7wV9rLuyZEc+ogBYr/bEfZBddQ9S HNU8B5WGVjZIRcHjvDUq7dn/SaO74UIPTqR/M2Sn5rASnB0HiKb6daYafLWc9NyEousH q34u+QC9Xp8wto8m8eTQ3g+IpQh9c7yp/+xMu0eOi1PmGh/6tZ1uwOFCbv81A9FIZkXI z77J61oQPEXPqqJLF3s/DxRRNcxRJLAnacq/lfeA4embPmfhS9n9/mowh442uF0ZSDaE Ry2kbed5JswFH96j26QpwTnQE/vtPPZh9GIFsjJm59h45tIuwchtXCk9CCyczBBvND+B ojyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rQ3qy4ns0Pgxwwo15Bt0+hHBLs2YdI2b92B9bfMpx2A=; b=Tn4DvcewAC5F4ko/J6252/Jyzx4cGUc0P6Ed+3jBGQfyC5Ok8FXaxcLXD3jIsaXxgw g1j6arUN+p+I4m7gegF5tY3zgyatbPULXmWIolawbgCyvCB9zuX2a5JtizJL0gALMOPv J9aTp3j/1KD/rGcMOyU6W1kQdUaoUykQR7/IbVG8azos0g3ObOGS2Eu/ZJuwwxdTqXTo MYy5IFaZIy+hFFlptMTxRhQVLc4+E3DqxBW9RAegZhdnG4hCry77ZdHKFB1GGg1bIdx1 FUqFzzdu37SMDZHqIT+oQzZY7TI+dZX5wulDCgF/n4GkMz+j/s3dx6mdtGI2Hc3ZwXm5 sIaA== X-Gm-Message-State: AD7BkJKmbjlIkMeBJMOLpyc0GVcQ0ZFRrSaR5Lqr3WPL5+pt6OOlysrvqVkDZNdbHGy77A== X-Received: by 10.194.61.131 with SMTP id p3mr15492463wjr.159.1457228452419; Sat, 05 Mar 2016 17:40:52 -0800 (PST) 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 jo6sm10569191wjb.48.2016.03.05.17.40.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Mar 2016 17:40:51 -0800 (PST) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/radeon: Fix eDP for single-display iMac10,1 Date: Sun, 6 Mar 2016 02:39:52 +0100 Message-Id: <1457228393-23650-1-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 Cc: alexander.deucher@amd.com, stable@vger.kernel.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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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. Signed-off-by: Mario Kleiner Cc: --- drivers/gpu/drm/radeon/atombios_encoders.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 01b20e1..a28377c 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -2176,9 +2176,15 @@ 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 could just use crtc id, + * but Apple thinks different at least on iMac10,1, so use linkb. + */ if (ASIC_IS_DCE32(rdev)) { - enc_idx = radeon_crtc->crtc_id; + if (dig->linkb) + enc_idx = 1; + else + enc_idx = 0; goto assigned; }