From patchwork Wed Apr 5 08:16:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 13201354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEEDCC76188 for ; Wed, 5 Apr 2023 08:16:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4522A10E879; Wed, 5 Apr 2023 08:16:58 +0000 (UTC) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by gabe.freedesktop.org (Postfix) with ESMTPS id E417610E878 for ; Wed, 5 Apr 2023 08:16:55 +0000 (UTC) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-4fd1f2a0f82so7207a12.1 for ; Wed, 05 Apr 2023 01:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1680682614; x=1683274614; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qP3CRuOXtd0j8FH60pKDaapzSWilH3ybWh3D2BA2OVg=; b=GjLl3ua24l4Ov2GQ+uRq2bGA8FFfCelF7z+YR0ZN0ez6Tb4K/TAjDMG+xwe6+xxnVB zDKECAoNBIqH/aGbAtpyUXhaguJpZGG0JAO+CKxjhC0A6uMVAxvdMKJLve7rhnouoiMz MgVPIGv0iQKsnn1XemqCEGw2vg0Ipw9iOiJkk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680682614; x=1683274614; 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=qP3CRuOXtd0j8FH60pKDaapzSWilH3ybWh3D2BA2OVg=; b=hpkVfurCFqXYcR+EJwRs/kUY4uXt+kVE4yf5nX/NVEhUekEEK00nSqtyCf5Icmusfn txjzSntF86NOsfvqFB44o5YlaYM3ptn09huvlTVBip4Dn55Lo/oOiYF5TehHoN2wPh2v myIhG7kzxZMoknu57jgZDEYVYqeKDPS+UV65OHbH1lMhEo1MAuvYDYtsF2RJrxIYcOeq SpAssdrWYgua6N8CVa6mgxUjjQDUHLYl1nYN3tfSt/S4nEvt8TMz5sJwxhAzd9XL+fLa 99yZujbNo6Uz4K3hAwWybFmwe/MBBFt6RyeAhmrBGpFqOmcs9y0tlyy3cHfqfjvwpNrN gwog== X-Gm-Message-State: AAQBX9faCKzqnvOR5+ofPpsLrNSk0lKSfevO9KwT5hRxb9+AQBdXoFH5 OKisUxJMmo2RqHWsRvlyHYWhXg== X-Google-Smtp-Source: AKy350ZYz7OQVeF14jLM9v6G4L5hAkxBt0za08VJNASxD8vm5spaVp2Ou8H/3c31A0MGkaLzR96a3g== X-Received: by 2002:a05:6402:524e:b0:4fd:2978:d80 with SMTP id t14-20020a056402524e00b004fd29780d80mr1086176edd.1.1680682614011; Wed, 05 Apr 2023 01:16:54 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-33.fiber7.init7.net. [212.51.149.33]) by smtp.gmail.com with ESMTPSA id sz22-20020a1709078b1600b00948da767832sm2748474ejc.152.2023.04.05.01.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 01:16:53 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 5 Apr 2023 10:16:50 +0200 Message-Id: <20230405081650.797972-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/atomic-helper: Don't set deadline for modesets X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Clark , Daniel Vetter , Intel Graphics Development , Maxime Ripard , Thomas Zimmermann , Dmitry Baryshkov , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" If the crtc is being switched on or off then the semantics of computing the timestampe of the next vblank is somewhat ill-defined. And indeed, the code splats with a warning in the timestamp computation code. Specifically it hits the check to make sure that atomic drivers have full set up the timing constants in the drm_vblank structure, and that's just not the case before the crtc is actually on. For robustness it seems best to just not set deadlines for modesets. Link: https://lore.kernel.org/dri-devel/dfc21f18-7e1e-48f0-c05a-d659b9c90b91@linaro.org/ Fixes: d39e48ca80c0 ("drm/atomic-helper: Set fence deadline for vblank") Cc: Rob Clark Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Reported-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov # test patch only Cc: Dmitry Baryshkov Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index f21b5a74176c..6640d80d84f3 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -1528,6 +1528,9 @@ static void set_fence_deadline(struct drm_device *dev, for_each_new_crtc_in_state (state, crtc, new_crtc_state, i) { ktime_t v; + if (drm_atomic_crtc_needs_modeset(new_crtc_state)) + continue; + if (drm_crtc_next_vblank_start(crtc, &v)) continue;