Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1665223rwl; Thu, 5 Jan 2023 17:45:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXvB5VIzEJleI/qjgVRrOeLiqLexsT4Vf+fx5lcMOsBJHJ6fcF30D+eC/iMd9rOowwOV35cA X-Received: by 2002:a05:6a00:1d1f:b0:581:ad48:d480 with SMTP id a31-20020a056a001d1f00b00581ad48d480mr28825055pfx.34.1672969520727; Thu, 05 Jan 2023 17:45:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672969520; cv=none; d=google.com; s=arc-20160816; b=M+vf9ajpAVaSP1j0UK04R33e8rzJqW7+4mvlWSevpRbDHkbD8OhObqdGTVN6DDH8ik CHlG+vG0HtjcMmsoV57eR/GWVBsx5rImVsdLhopsWXOqyRcbnZKDlKrfy1AI7NSM8vBQ sG/jQZLZ5IuC/tdSRt66a+85fW00caijsPvHfL29ByZwWPa+2D8XMlbTeECXKKv97spf M401cR4XcWPFpudO0i+s3p/VoMIm+85TEXI6gbPJMfrpzWuqcAOCzDybjpF48Eda/Gb9 9HxThBHeCzlJ9wHysllC97y2WRfd6CH2njZvZXZG+wWW3mbZK1IUT7UwsErx+3ua6mEB RD+A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Vd1mAgVVTT449fHfx2SSArigVZjhQAUUxQLxBkWmUZY=; b=B0MkNcd1LwSyBOaARIZ1SAXyCYI9PbO6ELEGqo9BFJ/gl8SNH6xfSpENBbwiP+KJTR HQ4KOt78lrJdZhGgupFZItSwl0DIWbcCg4bCHpK1QYrUMOy08VR+p1ATmTRfKbt8Lj8S DFkxMaoeoqoLIlb66eyRnptXOAxi+yWK/W6JGcznexY2BCywNY7lBmyQQBrHLKyUAQIJ ZU/9Epf2FV1z5UtbEt9MkQM9La2gJer4W5cU2WHkXPbK6+Chh4JQv5PWkph9y+xGN7ad ipyN39C99hINwWBJxQVIlL9N0+loEjF0vqWWYaOURxlsdXgTMEh0Z64zZuF8So3tgq3O W6xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DPHGui8Q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s29-20020a056a00179d00b00565a581ecc0si9986389pfg.11.2023.01.05.17.45.13; Thu, 05 Jan 2023 17:45:20 -0800 (PST) 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=@chromium.org header.s=google header.b=DPHGui8Q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230182AbjAFBkc (ORCPT + 55 others); Thu, 5 Jan 2023 20:40:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjAFBk2 (ORCPT ); Thu, 5 Jan 2023 20:40:28 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4CFB3227F for ; Thu, 5 Jan 2023 17:40:27 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id cl14so119010pjb.2 for ; Thu, 05 Jan 2023 17:40:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Vd1mAgVVTT449fHfx2SSArigVZjhQAUUxQLxBkWmUZY=; b=DPHGui8QRmvaHU3DjCknrlpCldx/5v2OWyAyXICYBob9XLXk8DRWNug04ad+L+D6QF yQtKJe2REavJ/0MCusreMlT5MSx/4G0eq24SxO0ufeBTun+1XdP7BTN6KqtS2fV34YPD cvqScEg2/NatNc3sAr34tTgsDmpFnKUJ2dcqQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Vd1mAgVVTT449fHfx2SSArigVZjhQAUUxQLxBkWmUZY=; b=muC7MHnrlj62OtnGQSwg7xVlYjUyWfXH1WaCoVp6nB/hYC3UKdiwm6faK7es/Mr43u B+9FKVsMri9iaLftCDaRovYw7qJxeeAD34P8i1YCAd5GBhwpORBcaSGPtBJvp0b0giA/ waWnATcdoCvUTB0wW2h+wTAPf9hXT5NrDgfD6563olIGvNd3LVJMif8P/1QNGVOq0k1m rvxmyg/P44379q+SA/vduQmMN0N747FC+YkizRlp+0CAJp4yQHa9NFNYvMwKI0SI+Y7t i3FuPtLRfBdMYFiCeJLodAqMx9IbSN55f0n+U3mFuSza7T4+ExPEoHBLmvT9hYjfmhgi v3Jw== X-Gm-Message-State: AFqh2kpNOx0/0RURJqO/x8TmloRfNjaUToMLMHjxoTHPOuSIGzyNdFHf yMs4fl0eJHHmE4tGHUawVS3umQ== X-Received: by 2002:a05:6a20:429f:b0:ad:bd55:6dcf with SMTP id o31-20020a056a20429f00b000adbd556dcfmr79280084pzj.28.1672969227205; Thu, 05 Jan 2023 17:40:27 -0800 (PST) Received: from localhost ([2620:15c:9d:2:5567:fb20:aa4f:352]) by smtp.gmail.com with UTF8SMTPSA id i1-20020a6551c1000000b00478f87eaa44sm22461638pgq.35.2023.01.05.17.40.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Jan 2023 17:40:26 -0800 (PST) From: Brian Norris To: =?UTF-8?q?Heiko=20St=C3=BCbner?= , Sean Paul Cc: Sandy Huang , =?UTF-8?q?Michel=20D=C3=A4nzer?= , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org, Brian Norris , stable@vger.kernel.org Subject: [PATCH 1/2] drm/atomic: Allow vblank-enabled + self-refresh "disable" Date: Thu, 5 Jan 2023 17:40:17 -0800 Message-Id: <20230105174001.1.I3904f697863649eb1be540ecca147a66e42bfad7@changeid> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 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 here. Add a new exception, such that we allow CRTCs to be "disabled" (with self-refresh active) with vblank interrupts still enabled. Cc: # dependency for subsequent patch Signed-off-by: Brian Norris --- drivers/gpu/drm/drm_atomic_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index d579fd8f7cb8..7b5eddadebd5 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1207,6 +1207,12 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) if (!drm_dev_has_vblank(dev)) continue; + /* + * Self-refresh is not a true "disable"; let vblank remain + * enabled. + */ + if (new_crtc_state->self_refresh_active) + continue; ret = drm_crtc_vblank_get(crtc); WARN_ONCE(ret != -EINVAL, "driver forgot to call drm_crtc_vblank_off()\n"); -- 2.39.0.314.g84b9a713c41-goog