From patchwork Wed Aug 24 14:58:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9297979 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 1E9E460757 for ; Wed, 24 Aug 2016 14:58:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F845290BD for ; Wed, 24 Aug 2016 14:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03CBD290C0; Wed, 24 Aug 2016 14:58:34 +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_SIGNED, 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 A7638290BD for ; Wed, 24 Aug 2016 14:58:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF2F46E8CF; Wed, 24 Aug 2016 14:58:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D4116E8CF for ; Wed, 24 Aug 2016 14:58:31 +0000 (UTC) Received: by mail-qk0-x236.google.com with SMTP id v123so17273426qkh.2 for ; Wed, 24 Aug 2016 07:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=jp92B6nkIbzHxcHl39jNfJQpE6d05mp016aCehDtUyo=; b=VPWscDHDmZMAS0cDuaOFe4C53vmBhJyQhLUhFpzAqSmu+kgf+nlOdqJWstjVQQdUuF T+lquqiwQjtsjp8fVPwthAH+gh8xCMQmbOED8BzRPadxaWw07nhxeI0KELyGKj8pasap 70IDVhp/tJF2qAIL7eRCY+m1zjdEz4z7cTQnQ= 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=jp92B6nkIbzHxcHl39jNfJQpE6d05mp016aCehDtUyo=; b=mZkSHf0FdNreESNVNHvPzB0Zyxu7nnFHXwZfVH2kVDlJdHptpPBaAuueGmIGlf97aD MxF+7bfyw8MKkh7OPn3X9IyuZywbfG6b8bBrsn4WcM9VNgIEmE1U5xELS+T5kaIpSEpE k1DN3qjfyQNe2PC5444NuRAe9p1U86WJYMKi4sgt9KKG0PMnMm2pZp/PWaONzgJJJAR5 h5Qf3xAmKktAqmK06R1UZevGqfgmCiavzsCgrdDYZprU6iF4PWz82ySdKr2woXICZTH3 1ITTu2RBEwHeClcPaZ74bL60+fiDhOGtyf8OkwyUvm4jVS71UTnZSZPqvmaxy8MEKgd5 1twQ== X-Gm-Message-State: AE9vXwNY6Rt70DwgSPZp67faIG001xFxxP/dLLgsmrF13+M3EUYRr6ztgIOyeReKc50cRK9c X-Received: by 10.55.48.10 with SMTP id w10mr4034298qkw.43.1472050710501; Wed, 24 Aug 2016 07:58:30 -0700 (PDT) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id r5sm4832005qkf.34.2016.08.24.07.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Aug 2016 07:58:29 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, ykk@rock-chips.com, yzq@rock-chips.com, thierry.reding@gmail.com, architt@codeaurora.org Subject: [PATCH] drm/bridge: analogix_dp: Don't read EDID if panel present Date: Wed, 24 Aug 2016 10:58:26 -0400 Message-Id: <1472050706-32911-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Cc: daniel.vetter@intel.com, linux-kernel@vger.kernel.org, tomeu.vizoso@collabora.com, javier@osg.samsung.com 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-Virus-Scanned: ClamAV using ClamSMTP If there's a panel connected to the analogix_dp bridge, rely on the panel driver for modes, rather than reading EDID *and* calling get_modes() on the panel. This allows panels with a valid EDID to read it in the panel driver (e.g. simple_panel), and panels with invalid EDID to homebrew modes in their get_modes implementation. Signed-off-by: Sean Paul --- This patch is based on Tomeu's cleanup patch which can be found here: https://patchwork.freedesktop.org/patch/107114/ drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 774cc796..e9c9aeb 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -930,15 +930,17 @@ int analogix_dp_get_modes(struct drm_connector *connector) return 0; } - edid = drm_get_edid(connector, &dp->aux.ddc); - if (edid) { - drm_mode_connector_update_edid_property(&dp->connector, edid); - num_modes += drm_add_edid_modes(&dp->connector, edid); - kfree(edid); - } - - if (dp->plat_data->panel) + if (dp->plat_data->panel) { num_modes += drm_panel_get_modes(dp->plat_data->panel); + } else { + edid = drm_get_edid(connector, &dp->aux.ddc); + if (edid) { + drm_mode_connector_update_edid_property(&dp->connector, + edid); + num_modes += drm_add_edid_modes(&dp->connector, edid); + kfree(edid); + } + } if (dp->plat_data->get_modes) num_modes += dp->plat_data->get_modes(dp->plat_data, connector);