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: 9348191 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 340A9607F2 for ; Fri, 23 Sep 2016 14:07:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24C4F2AB7E for ; Fri, 23 Sep 2016 14:07:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 197FC2AB8D; Fri, 23 Sep 2016 14:07:22 +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 CECBF2AB7E for ; Fri, 23 Sep 2016 14:07:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD3496EA8C; Fri, 23 Sep 2016 14:07:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E27C6EA95 for ; Fri, 23 Sep 2016 14:07:17 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id l132so2992640wmf.1 for ; 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=WmZbEU63CqH0N7ZnLCWNgFW7QSSoYcJ94ZYX7YKrLybRuNwMSoSYVtAQFH44hYVGcK wu5lNNk/923nRzt8BP/ry2Y5dsLYc1Rpz5CDhBKiSfAaPqFP0k9E2srWehXEfyAyi5vR ua+arlKxc6O4Wj5kbTnu6vqPDIloqCKghXnmSBLPlLdNP/bVcALYVhHlF3dLH8NwnIoF ofyJiXU27qG1GqxF18XtBq5BQ/dq22utLbEsu7Rrp6lGZTE4uQMvMzr59HuE01ZUhAgB Aeyks5KLqfrir/UUA7XCI8Mg+DZy0ZkiYuB80TCDzrZQGEd/8PIGmVgN7SeRKGyrwPnP TEPw== X-Gm-Message-State: AA6/9Rkt68O3v4d0ImZn90iq+VxhBO5EGodEVP85HdJmtnb9sIp6ExcvI4cCXGTaijodfA== 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> Cc: Tomeu Vizoso , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.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-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);