From patchwork Fri Sep 23 14:06:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9348197 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 713A3601C2 for ; Fri, 23 Sep 2016 14:09:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 620322AB8F for ; Fri, 23 Sep 2016 14:09:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56A812ABA0; Fri, 23 Sep 2016 14:09:19 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E5892AB8F for ; Fri, 23 Sep 2016 14:09:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bnR8j-0007Dg-4R; Fri, 23 Sep 2016 14:07:45 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bnR8b-00076L-PZ; Fri, 23 Sep 2016 14:07:39 +0000 Received: by mail-wm0-x244.google.com with SMTP id 133so2998784wmq.2; Fri, 23 Sep 2016 07:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ossIG/sJXkBbdT9BWYpYEsu2w50V1LgU6Fdf8H22JS0=; b=Zen8kk1bPMdq1oab4x6CMw+2q5Vj9J39uEy+KgciWEcBD/nnihDCdi5qtiow/uonMw fCO8ltVUJS/kjNFFIXiTmkiUxf1EBD2ywRHuvJrE3DbVvMJDP9kpntXFLsvGdjE4J6aL ABILpKV2JEiUvzkNVAhmJ4bQc8pxCW4VoNv3VDVqUSz+kusGfEJLSEsOh3Snjn20wXtC TKh0ScfU8gieyiOWNr5Om13cK8GMX4/8od1J3U0iqG9WP7l53PSiQX2be6FRsXwevoFJ yEoKO1bsFZetqL7qbQu+xWh1dP5O88RHFNbxeAIZbidvTRvpBMm97qwr7YR7U55yy4/W 6nUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ossIG/sJXkBbdT9BWYpYEsu2w50V1LgU6Fdf8H22JS0=; b=NGHsoy4QtjUQwzHDaW0IAf4RCAaS+YHHRn6vhhkBj9YaduYSYknZ3Hcs6xBiuEXfIe ynzjOvLpL8EuAGKIak2dc/otx54WjX/vBv2cLYYE8jFlbQ+NiBWlcXfjuwhnYlwy68LD 7fK52wyiMAj3dFMOZFTJKJuNr8bykIG0bKhmo5b4SlGDZ+o76cHuaQ7SxpSlyzA9PKSB yt2vri0RA2hYcCY7lQJLMI/GE9mPwPrEBYRostergTmcH26WkKlZkm3KAuXoZb413Vzx frjvv9qmZ1sJFnNg4WcZWre66TsGXa9ChNOIhyv4mRduAvZ12eeGGzk4ldUczKmKGQPI YfvQ== X-Gm-Message-State: AA6/9RmsFeGIsj23z//sXF350vVAwO6I0hSJqFKrIj35kLf6XaT3eQEHBv6cXGN8SHHT7A== X-Received: by 10.28.109.86 with SMTP id i83mr2922815wmc.104.1474639635588; Fri, 23 Sep 2016 07:07:15 -0700 (PDT) Received: from cizrna.lan ([109.72.12.156]) by smtp.gmail.com with ESMTPSA id ya1sm7443117wjb.23.2016.09.23.07.07.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Sep 2016 07:07:14 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] drm/rockchip: analogix_dp: Refuse to enable PSR if panel doesn't support it Date: Fri, 23 Sep 2016 16:06:40 +0200 Message-Id: <1474639600-30090-2-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474639600-30090-1-git-send-email-tomeu.vizoso@collabora.com> References: <1474639600-30090-1-git-send-email-tomeu.vizoso@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160923_070738_128377_00089B51 X-CRM114-Status: UNSURE ( 9.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Archit Taneja , Heiko Stuebner , Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Sean Paul , Yakir Yang , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There's no point in enabling PSR when the panel doesn't support it. This also avoids a problem when PSR gets enabled when a CRTC is being disabled, because sometimes in that situation the DSP_HOLD_VALID_INTR interrupt on which we wait will never arrive. This was observed on RK3288 with a panel without PSR (veyron-jaq Chromebook). It's very easy to reproduce by running the kms_rmfb test in IGT a few times. Signed-off-by: Tomeu Vizoso Cc: Sean Paul Cc: Yakir Yang Cc: Archit Taneja Reviewed-by: Sean Paul --- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index e83be157cc2a..8548e8271639 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -85,6 +85,9 @@ static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled) struct rockchip_dp_device *dp = to_dp(encoder); unsigned long flags; + if (!analogix_dp_psr_supported(dp->dev)) + return; + dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit"); spin_lock_irqsave(&dp->psr_lock, flags);