Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3653593pxb; Mon, 24 Jan 2022 14:31:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTThP2BYE3lqUr5UL/LDAANyGChuw4bMrenXHYZ2tkY/Jpd1s8traOe8BzUl9MxbRD6HY7 X-Received: by 2002:a63:8641:: with SMTP id x62mr8001510pgd.511.1643063488019; Mon, 24 Jan 2022 14:31:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063488; cv=none; d=google.com; s=arc-20160816; b=mSSV2LmPXFxCSFVHp+iJ6IsQaKM/6m/jgooIhBQP4ORglKFAoa6r26/cAPMEayomoZ uL0Iwd+nolX860Eg1lf6y129IRsaCjldnCgbOOP3hlyWsVoBk31O/tR2aZZ8Lt89W5Xj LV6/rJBGFBE7uITpXB31FjW5J0WpvAWR+5bLFaxTPZN/fTFq6TCVZ4XwDKRQp+k0Uixj DfJsIlE/mu7qsijNjJhgzhSp0eklfStLJ0TRdQwMK1GQxTVFYAmvFIs+Jqdl5u+KeVxX OGz9pZ3bQRUq1OnYLuFn3SzHgY9VgKLOL7SgKc+jaRbr8tVEzygPWYtoJB3hqpggJy1p BLhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M6U+jGaf3Pp5v1jdldZHvCHZm3N1x50oHlCH2wCz+Fk=; b=Uw1aVAx1UT2AkuitEnAsM78nH1YCgMhKZe+rU5+RitixeWcmUx3Paewpudtji7Dlbw MF8zc9vg5SkOPXOvFxgSpfwXERRz295WjUmhhOuJ6l17gqb+dJvEl94BEkuS6bC1WnhQ S01GwKn1xaehXtgkUHoX8MintMVztL6LF0r1IxtcSiac6qyEKHnY3lbSh/ELyCxR6DOV 6eSHx70Ss+A/NUfevCpJOE57g4SiYq0z7oDySdW5CYnU0tbFC8JiuzkKGk2BkIsirp0o cvjXM0nqF2dfWBojLZen3Da5QzSxz9kZUN/dMBB8rCP64HYFlZ0saEcswmm1yX+rii8G OCSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ONeBL5Gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si492448pjp.69.2022.01.24.14.31.15; Mon, 24 Jan 2022 14:31:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ONeBL5Gs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1587305AbiAXW2E (ORCPT + 99 others); Mon, 24 Jan 2022 17:28:04 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:45900 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1454866AbiAXVeB (ORCPT ); Mon, 24 Jan 2022 16:34:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E870AB8123A; Mon, 24 Jan 2022 21:33:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B60EC340E4; Mon, 24 Jan 2022 21:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060038; bh=R8/1XpnUCRmWuxRq57W415mmpgzGhzNlkkynV5S82N0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ONeBL5Gsat1wRL+yUfAG109shpgcP7hJC1dKEo5TaVH6BXZ34Iq22qnkggFbS53/k 56YAn1J814O525y6s2MK4XfXDQWHqLphJS5p0xGuLt9Qi9TC7ij2+aKbniRyjw/o53 QLi5oWqapXKdvmk4lyWexFlihdCmelatJdiBxa5I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Paul , Rob Clark , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , Liu Ying , Sasha Levin Subject: [PATCH 5.16 0818/1039] drm/atomic: Check new_crtc_state->active to determine if CRTC needs disable in self refresh mode Date: Mon, 24 Jan 2022 19:43:27 +0100 Message-Id: <20220124184152.800331782@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Ying [ Upstream commit 69e630016ef4e4a1745310c446f204dc6243e907 ] Actual hardware state of CRTC is controlled by the member 'active' in struct drm_crtc_state instead of the member 'enable', according to the kernel doc of the member 'enable'. In fact, the drm client modeset and atomic helpers are using the member 'active' to do the control. Referencing the member 'enable' of new_crtc_state, the function crtc_needs_disable() may fail to reflect if CRTC needs disable in self refresh mode, e.g., when the framebuffer emulation will be blanked through the client modeset helper with the next commit, the member 'enable' of new_crtc_state is still true while the member 'active' is false, hence the relevant potential encoder and bridges won't be disabled. So, let's check new_crtc_state->active to determine if CRTC needs disable in self refresh mode instead of new_crtc_state->enable. Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh mode in drivers") Cc: Sean Paul Cc: Rob Clark Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: Liu Ying Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211230040626.646807-1-victor.liu@nxp.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 2c0c6ec928200..ff2bc9a118011 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1001,7 +1001,7 @@ crtc_needs_disable(struct drm_crtc_state *old_state, * it's in self refresh mode and needs to be fully disabled. */ return old_state->active || - (old_state->self_refresh_active && !new_state->enable) || + (old_state->self_refresh_active && !new_state->active) || new_state->self_refresh_active; } -- 2.34.1