Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1310815rwr; Fri, 5 May 2023 12:05:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6icNkKyg7/QPwPutJ7hIJQd268HivXD1ob3QfFFoSqidMAIVz7JBPTvq6TGe0qHj+kQC03 X-Received: by 2002:a05:6a00:244e:b0:634:7ba3:d142 with SMTP id d14-20020a056a00244e00b006347ba3d142mr3751158pfj.10.1683313507884; Fri, 05 May 2023 12:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683313507; cv=none; d=google.com; s=arc-20160816; b=nzDloZdhjeX2qi+Jj9Pl1OrtLtO71tsOAjfwsqKNRJ2R9v9CZzGJZfWPcDTXCiByX7 0ohgrUP9JgulmD41GcOcm8c1EyfV1WU6mdv8TsAXem72C4Tjg0AUfwoHsVbZkcjP1RHE 590KbJG8L70RNyGQ0tlscBzKqP1Yb9UHDV+RFgKG6y4IcoUsmfsB8j3mNPmvknqvNyml XJ3GV1tpabbO2jZQCEgnJJXFjq2quBAphXKErWgKXc2Dwa+YE4iBSi6JWBbMUmfMBAqJ VdKoarEB91W0kyakzKwOKT8EnQJ69kII3Kqn975pzjWSmbx7HgCaBPkwUuT9O5Ez9VRW gaBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EhmbhDCRzak/t11wXpwMu2NOC9pgAHH93PKpbCf1qtA=; b=F+73bSBoaKAramXaR+Q0juiDMqwNnRr8NjYuLnG9iwASWPZ9buprVwr6IeKXzYDXjZ SmKgYOoSzrjlXSm/kwqcDdhINsNUYDM/sWw3TBrQ/tUWiodCIbZ/UkEFMP841ZgJFHhk WwD0IxmKCAcahpJ2CKvOQzaPtL0eWPw6GFVR4e8fsOzn2/8lWV+Fx5vQlUS3sZCiFIxj PkC0ebM9JNnL7RszMZYLDvIVxpBwTKSncQtWPGS1rXLWy0qxOjoEUcohvOBa5fXlebG/ NoXpbQyi+0M/UUyZLG/12ZpLCF4OWPQOT/INmUemjN85MyeEicxvtV22+MNCrdfBUoLB 0u8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=G4QDfdGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020aa79465000000b0063b7bbeb33esi2675457pfq.137.2023.05.05.12.04.52; Fri, 05 May 2023 12:05:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=G4QDfdGT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233288AbjEESqO (ORCPT + 99 others); Fri, 5 May 2023 14:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbjEESqN (ORCPT ); Fri, 5 May 2023 14:46:13 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D0D3C10 for ; Fri, 5 May 2023 11:46:06 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-3ef5bea20caso9646691cf.3 for ; Fri, 05 May 2023 11:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; t=1683312366; x=1685904366; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EhmbhDCRzak/t11wXpwMu2NOC9pgAHH93PKpbCf1qtA=; b=G4QDfdGTzO4rSstvF9JULH2agg39wZYGm0nZVPkuB63FSC18U3tIHgh/MgE122WMBH p/twjplPNfl+1E0E9Z1UrteFrIythH94J7d/AWSuxJLPTHdli5pkwaMD/wXE7UdE+Q1Q FyT1xfPSDRgD7KkOR2w802JXOiQ5nSwAJiRS45fHgz+GyOap8dVYLryiN2EE+zTNsRIR CIrD9UQljXXNAqfHwziSmDhh7++2JjQzEsexVdaeS9WoZhSCE+HfHEaANeIIKYv75fFz jfHGxvzY3fnhKhdycwH/5pNZHbyPZkutgwzSDevR80rIETpfhoeIdtjwzgD9sagW7LSp s9tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683312366; x=1685904366; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EhmbhDCRzak/t11wXpwMu2NOC9pgAHH93PKpbCf1qtA=; b=a8n6939NLGRzwcCNEfW/GkdLrYj9iWZp6/FVxWdx5M9LJKls2SCVp8urPvyqSm8tfa HVsFaIyW5wL/YuqiwtohmQckTZ5QLSNUYiVWA2gOqmW8MdBKp92p8CBTrzJeG/1w6bvE DkuSgMGGpg3LVUIvRcJs/Q4Sh9BXfLc6KMN1+eq737WoXyRsILRBlU4PFAXN7vg75XM0 2lEMRDCif4rFWxQP9Qbjye4PlckIh0eVTOcL5mAWj8kKsW0PNk181TGB+pFqrF+TXdyX cHEDKj8xAdzopO7LA/NUCaZ3lRVC18ByV1Mps028rQytHQ0K/hiEUSwhKEXjoE8B/DuV ewMA== X-Gm-Message-State: AC+VfDy4cl+P/sAQHvlTuFNnuy4/aZFg0T1evD5rE8gGuwU4NaXpOsy8 Ya596u2BIA5cE1kG1EYXEgyh3w== X-Received: by 2002:a05:622a:1999:b0:3e6:4fab:478e with SMTP id u25-20020a05622a199900b003e64fab478emr4806484qtc.33.1683312365928; Fri, 05 May 2023 11:46:05 -0700 (PDT) Received: from localhost (164.146.150.34.bc.googleusercontent.com. [34.150.146.164]) by smtp.gmail.com with ESMTPSA id i2-20020ac80042000000b003ef28a76a11sm59598qtg.68.2023.05.05.11.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 11:46:04 -0700 (PDT) Date: Fri, 5 May 2023 18:46:04 +0000 From: Sean Paul To: Brian Norris Cc: Heiko =?iso-8859-1?Q?St=FCbner?= , Daniel Vetter , Sean Paul , Michel =?iso-8859-1?Q?D=E4nzer?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sandy Huang , linux-rockchip@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH v3 1/2] drm/atomic: Allow vblank-enabled + self-refresh "disable" Message-ID: References: <20230109171809.v3.1.I3904f697863649eb1be540ecca147a66e42bfad7@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230109171809.v3.1.I3904f697863649eb1be540ecca147a66e42bfad7@changeid> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR autolearn=ham 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 On Mon, Jan 09, 2023 at 05:18:16PM -0800, Brian Norris wrote: > The self-refresh helper framework overloads "disable" to sometimes mean > "go into self-refresh mode," and this mode activates automatically > (e.g., after some period of unchanging display output). In such cases, > the display pipe is still considered "on", and user-space is not aware > that we went into self-refresh mode. Thus, users may expect that > vblank-related features (such as DRM_IOCTL_WAIT_VBLANK) still work > properly. > > However, we trigger the WARN_ONCE() here if a CRTC driver tries to leave > vblank enabled. > > Add a different expectation: that CRTCs *should* leave vblank enabled > when going into self-refresh. > > This patch is preparation for another patch -- "drm/rockchip: vop: Leave > vblank enabled in self-refresh" -- which resolves conflicts between the > above self-refresh behavior and the API tests in IGT's kms_vblank test > module. > > == Some alternatives discussed: == > > It's likely that on many display controllers, vblank interrupts will > turn off when the CRTC is disabled, and so in some cases, self-refresh > may not support vblank. To support such cases, we might consider > additions to the generic helpers such that we fire vblank events based > on a timer. > > However, there is currently only one driver using the common > self-refresh helpers (i.e., rockchip), and at least as of commit > bed030a49f3e ("drm/rockchip: Don't fully disable vop on self refresh"), > the CRTC hardware is powered enough to continue to generate vblank > interrupts. > > So we chose the simpler option of leaving vblank interrupts enabled. We > can reevaluate this decision and perhaps augment the helpers if/when we > gain a second driver that has different requirements. > > v3: > * include discussion summary > > v2: > * add 'ret != 0' warning case for self-refresh > * describe failing test case and relation to drm/rockchip patch better > > Cc: # dependency for "drm/rockchip: vop: Leave > # vblank enabled in self-refresh" > Signed-off-by: Brian Norris Pushed both patches to drm-misc-next, thanks Brian > --- > drivers/gpu/drm/drm_atomic_helper.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c > index d579fd8f7cb8..a22485e3e924 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -1209,7 +1209,16 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) > continue; > > ret = drm_crtc_vblank_get(crtc); > - WARN_ONCE(ret != -EINVAL, "driver forgot to call drm_crtc_vblank_off()\n"); > + /* > + * Self-refresh is not a true "disable"; ensure vblank remains > + * enabled. > + */ > + if (new_crtc_state->self_refresh_active) > + WARN_ONCE(ret != 0, > + "driver disabled vblank in self-refresh\n"); > + else > + WARN_ONCE(ret != -EINVAL, > + "driver forgot to call drm_crtc_vblank_off()\n"); > if (ret == 0) > drm_crtc_vblank_put(crtc); > } > -- > 2.39.0.314.g84b9a713c41-goog > -- Sean Paul, Software Engineer, Google / Chromium OS