Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3133285pxm; Mon, 28 Feb 2022 12:45:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5E4YxDx5m/WYL5PcTXnEs3bHjZBwxFUWUz4q49BP6N00cXifUfFwK4h/fUHK1aN3xBZqA X-Received: by 2002:a17:902:700b:b0:148:ee33:70fe with SMTP id y11-20020a170902700b00b00148ee3370femr22680251plk.38.1646081144487; Mon, 28 Feb 2022 12:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646081144; cv=none; d=google.com; s=arc-20160816; b=XIvT35jp/Pa7vNDXWkc7kuoeSUww73wDlPF1mex64l8F3a6ba61wOU0nBc3bU4RvyE vHlzF1mWHSGBJAgaC8WouVqddcx7RXIlE6KJDNIQ0QgcTwG6GbB9GX9q7S3VIxBLYU6A cLLRNLKero1XTr9kzS8iSelHFRMLPZ0lEzvo9pl5Q+lDPRQUdMf2mfTVWBvs4mEmJL4p vQjVlpFyV41YcncuwF72FfCDObwWGilruPtobvJggVO1FL3U3ui+jNmqCZgizQaE3w7G QxHgy0Qo7EfI1S1LnLX2kveoKuKbExLRlh0Z5Q9p5hdRAT08Gs/XGrWshhZGdgAt16Gn ApAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+3/hnEGttHw+ykEYwuEW4fvQITLLLeGWeScAdvHl/KA=; b=bRZJhk0LIq4444f75jHDjjbJtli2suRZ3cPlC27KV1rgNvx7bjVbZdepP11BdCTfAy Hs8EzBgfQ+a4lOzalVRvAkZsZpbbckZJYIyLA0uid/yTsbjIOZD1GtmJPtcq5aTvA8vd v3hPe2j7m1uENbQhQqLc3CXvLnDSCIUTWjVxXDlxc11LAHbu7B8fgS2vKQamvheYyomn 4wPXwNHrAMYduKCmfyZ1Gz/qWTvcwgRkjGz8KLCzrLdzk2IL5EpcUik4kMdVXnS2dA68 etJm38dVk0U4xWCa1TFdsHtaRvn6VfF/ClkhrCrCZ7tctZlbSpwQq1SAHIUJeXG4d+FQ cqQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gma3fcbT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 5-20020a630905000000b00374388c5454si10420669pgj.591.2022.02.28.12.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:45:44 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gma3fcbT; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8D874F47C; Mon, 28 Feb 2022 12:07:15 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbiB1UHx (ORCPT + 99 others); Mon, 28 Feb 2022 15:07:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbiB1UHs (ORCPT ); Mon, 28 Feb 2022 15:07:48 -0500 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E334F454 for ; Mon, 28 Feb 2022 12:07:08 -0800 (PST) Received: by mail-oi1-x22d.google.com with SMTP id q5so14277492oij.6 for ; Mon, 28 Feb 2022 12:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+3/hnEGttHw+ykEYwuEW4fvQITLLLeGWeScAdvHl/KA=; b=gma3fcbTcxZs3ntTjPMhGnHZHMQhmpr/uq9NeQaA/FpHt4PaWcWXyyH8LNzrSfx0a6 hWWWhBwmCCtiQdtL9EGlRtEH8eX0XZkWrQPYviWFPnRfcZ58Bo9uYvkT9gadQpsFyn4l OGvWJt25QD5DNWSKVbQC9N8mNXyRpjj5T5esY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+3/hnEGttHw+ykEYwuEW4fvQITLLLeGWeScAdvHl/KA=; b=ECIBdhIx6G5ckwIUjEF+X127dWFZIXiig1eeWxxM6+uZ0QsttnT115jLOWQQWrm8sa GUyATT5iKq4o4Q5BQsAFC7jhV8nSnm/vYm1ZkIygb23lr9zV6ft7BWko0UcS2tL8DBOq u0cf9PmmYmeWQgUjk/xu8n+NGmpCtXGYLwTBUhEoPEHapZ+NXRf84dMrHsNTLZVSfRuo B0xLY90asJOgkoqQk3/N06XGV8ZPPJQTHMOh9PE1oubJ/6GB2eVxZTu87abJLLxDX75Z HH2e3bTgueZffu28opc8HuAp/QDw7UMPITpofVH5PWXCc5hbbhfA5p2uFEgf+t7j5MLt n9cg== X-Gm-Message-State: AOAM5308XN7U+knopbkUYPbOqErfY5roKMbS9lI76o94kYY1vluFBA8x P2pcW23abPkNs1HBNWr/quIV12qiON0GXw== X-Received: by 2002:a05:6808:f93:b0:2d4:f855:aadd with SMTP id o19-20020a0568080f9300b002d4f855aaddmr9989240oiw.21.1646078827617; Mon, 28 Feb 2022 12:07:07 -0800 (PST) Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id u15-20020a056870700f00b000d180722f8dsm4839242oae.36.2022.02.28.12.07.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Feb 2022 12:07:07 -0800 (PST) Received: by mail-oo1-f47.google.com with SMTP id x6-20020a4a4106000000b003193022319cso20085058ooa.4 for ; Mon, 28 Feb 2022 12:07:07 -0800 (PST) X-Received: by 2002:aca:5e86:0:b0:2ce:de77:5256 with SMTP id s128-20020aca5e86000000b002cede775256mr12030360oib.117.1646078402626; Mon, 28 Feb 2022 12:00:02 -0800 (PST) MIME-Version: 1.0 References: <20220215235420.1284208-1-briannorris@chromium.org> <20220215155417.2.Ic15a2ef69c540aee8732703103e2cff51fb9c399@changeid> <6344d1828760d4d8625a87243fcc5f5b1096b9d4.camel@oss.nxp.com> In-Reply-To: <6344d1828760d4d8625a87243fcc5f5b1096b9d4.camel@oss.nxp.com> From: Brian Norris Date: Mon, 28 Feb 2022 11:59:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] drm/atomic: Force bridge self-refresh-exit on CRTC switch To: Liu Ying Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jonas Karlman , Linux Kernel , dri-devel , Sean Paul , Jernej Skrabec , stable , Sean Paul , Laurent Pinchart Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Liu, On Mon, Feb 28, 2022 at 1:02 AM Liu Ying wrote: > On Tue, 2022-02-15 at 15:54 -0800, Brian Norris wrote: > > --- a/drivers/gpu/drm/drm_atomic_helper.c > > +++ b/drivers/gpu/drm/drm_atomic_helper.c > > @@ -1011,9 +1011,19 @@ crtc_needs_disable(struct drm_crtc_state *old_state, > > return drm_atomic_crtc_effectively_active(old_state); > > > > /* > > - * We need to run through the crtc_funcs->disable() function if the CRTC > > - * is currently on, if it's transitioning to self refresh mode, or if > > - * it's in self refresh mode and needs to be fully disabled. > > + * We need to disable bridge(s) and CRTC if we're transitioning out of > > + * self-refresh and changing CRTCs at the same time, because the > > + * bridge tracks self-refresh status via CRTC state. > > + */ > > + if (old_state->self_refresh_active && new_state->enable && > > + old_state->crtc != new_state->crtc) > > + return true; > > I think 'new_state->enable' should be changed to 'new_state->active', > because 'active' is the one to enable/disable the CRTC while 'enable' > reflects whether a mode blob is set to CRTC state. The overall logic > added above is ok to me. Let's see if others have any comments. Thanks for the review, and good catch. This actually shows that most of my development was before commit 69e630016ef4 ("drm/atomic: Check new_crtc_state->active to determine if CRTC needs disable in self refresh mode"). In fact, the "state->enable" condition was included here mostly as a complement to the "!state->enable" condition that was present previously, and I didn't adapt it properly upon rebase. In practice, this portion of the condition is not needed at all; we really want to exit PSR on CRTC-switch regardless of the new-CRTC state. So rather than change "enable" to "active", I plan to remove it entirely. I'll give it some local tests and send v2 eventually. Thanks, Brian