From patchwork Wed Sep 7 11:23:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9319043 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 AC94C6077F for ; Wed, 7 Sep 2016 11:23:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F33928729 for ; Wed, 7 Sep 2016 11:23:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 835C9291CF; Wed, 7 Sep 2016 11:23:25 +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 0359128729 for ; Wed, 7 Sep 2016 11:23:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 983576E9CC; Wed, 7 Sep 2016 11:23:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8B256E9CC for ; Wed, 7 Sep 2016 11:23:21 +0000 (UTC) Received: by mail-qk0-x22f.google.com with SMTP id m184so5552273qkb.1 for ; Wed, 07 Sep 2016 04:23:21 -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=Z0Eapzn1MrdjIwAIfpV/26OOFWtwYaycR28Uc2Irjvs=; b=lh244dHUaN44fpiQpBhUJ2viuLlZqGUyYLc85Kgb+P/SK/8WW8piMA7Iy58+YqXKQH jkfQyJ8VsFyPw5Xm6x7jS4y1nO87gcQ/PSnoSU221t2m3zcqkmWe6AjRDlV6DzeH+dTo 3fViHmXJ7VuCeWdcW28UlS9wLXgrS2GTwMyv4= 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=Z0Eapzn1MrdjIwAIfpV/26OOFWtwYaycR28Uc2Irjvs=; b=lEjzGvHK1vVxL0aO+mbQZi3jh4akD+r6qdbqOv3XgBJkBSH7aq4dj6drhwIEccCAJR JCq71M53ur9pRyJtr4Inz5XUDXvkVpKiFOohlCFgJ+emeWD7WE/bpEQMAQnnqHAoT5NT MBanSV6s5G/I6MqJWrl+077fEmUl2E4finCtrO8aU22tgxKabU8+T7ZP1Xi5FGZe27eO Gs/iNKr9ad5F0bRHgBbwWrB7yIb00wd6nyVlw5xhKBW3BXm+he97qVT+L6LZ/JpdBwK4 n/YSZBvMXkqdhPtJE94EaPtsvyVPkBSrmi/QlqEt28IGzhy2O0m9hWmhSQTzof1SBM0r aKRg== X-Gm-Message-State: AE9vXwPWzhDZMPZBkHzlgF7HFR1OjsoL3Kj2ywib4dRBi0vTyT9UUmHHXvwR0RRzYerZoydq X-Received: by 10.55.161.202 with SMTP id k193mr20653733qke.105.1473247401082; Wed, 07 Sep 2016 04:23:21 -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 r48sm11871840qtc.22.2016.09.07.04.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 04:23:20 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, architt@codeaurora.org Subject: [PATCH] drm/bridge: analogix_dp: Improve panel on time Date: Wed, 7 Sep 2016 07:23:15 -0400 Message-Id: <1473247395-38489-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 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 In order to reduce the time required to turn on the panel, this patch makes 2 assumptions: 1- In detect(): if there's a panel, we're connected. 2- In get_modes(): if there's a panel, let the panel driver decide if it should prepare/unprepare in order to get the modes. The first is straightforward, and shouldn't need further explanation. The second should eliminate the prepare/unprepare delays from get_modes() in most cases, since panels generally hardcode their modes in the driver as opposed to reading EDID. If a panel does need to read EDID, it should be responsible for ensuring it's in a state in which it can. Signed-off-by: Sean Paul --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index e9c9aeb..18f622a 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -924,15 +924,15 @@ int analogix_dp_get_modes(struct drm_connector *connector) struct edid *edid; int ret, num_modes = 0; - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return 0; - } - if (dp->plat_data->panel) { num_modes += drm_panel_get_modes(dp->plat_data->panel); } else { + ret = analogix_dp_prepare_panel(dp, true, false); + if (ret) { + DRM_ERROR("Failed to prepare panel (%d)\n", ret); + return 0; + } + edid = drm_get_edid(connector, &dp->aux.ddc); if (edid) { drm_mode_connector_update_edid_property(&dp->connector, @@ -940,15 +940,15 @@ int analogix_dp_get_modes(struct drm_connector *connector) num_modes += drm_add_edid_modes(&dp->connector, edid); kfree(edid); } + + ret = analogix_dp_prepare_panel(dp, false, false); + if (ret) + DRM_ERROR("Failed to unprepare panel (%d)\n", ret); } if (dp->plat_data->get_modes) num_modes += dp->plat_data->get_modes(dp->plat_data, connector); - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); - return num_modes; } @@ -972,6 +972,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force) enum drm_connector_status status = connector_status_disconnected; int ret; + if (dp->plat_data->panel) + return connector_status_connected; + ret = analogix_dp_prepare_panel(dp, true, false); if (ret) { DRM_ERROR("Failed to prepare panel (%d)\n", ret);