From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 248F8755F1; Mon, 29 Jan 2024 17:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706548599; cv=none; b=Et/9L9krZjXoStlnFpijOZfT83TW/SmxGQOhto+tmswLBo1QjWT4dgSIqgB5m9xCjKnqx57g9uIE+WjQSU9VC3JhC+217F7uxGgtu1bQm+6glofzfbeondwRMrNL7uVWu2yij6EfipdUCgJzKPRJPafBnGaO4S90aNYq2Nm2I5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706548599; c=relaxed/simple; bh=iNFrxNfVKFZJ6HhXRKnLssqZ+FX5sfnTAKP/Us06rs8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WJcBDszwlGRjEfxGIe5U7xvuQ4wUjASBWeBHoKXXhcq5BjTSlK7jvbtNqFmI0TS8hUwxIAcKb2/UBXvR7guM7yylOcOySECk40/Tpd3iFVOmOYiAhkn0IZFX1U4nA84YRDV1an+uhI7f2mr/Cp1YAJlYnEgj4OtInGIg1TGRq4A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nHW0R1bB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nHW0R1bB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2EBAC433C7; Mon, 29 Jan 2024 17:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706548599; bh=iNFrxNfVKFZJ6HhXRKnLssqZ+FX5sfnTAKP/Us06rs8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nHW0R1bBCh3pbfwq7GGjv38WpRVwzzSAbTquRewNmVAUmEIwJnG6EWhuwQyhNpPfu nBZZD9dlzB7Zphi0i2tSiiIMf4uZu7Ar9oGL9ATGO9o9IqJmZUo9xINpcVoAhfOlOn sPA5bCLbBPNvWEXU9vsezrklDMKzb5lTBhvQN5JE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, nerdopolis , Sima Vetter , Javier Martinez Canillas , Thomas Zimmermann , Zack Rusin Subject: [PATCH 6.6 260/331] drm/virtio: Disable damage clipping if FB changed since last page-flip Date: Mon, 29 Jan 2024 09:05:24 -0800 Message-ID: <20240129170022.489276047@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129170014.969142961@linuxfoundation.org> References: <20240129170014.969142961@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Javier Martinez Canillas commit 0240db231dfe5ee5b7a3a03cba96f0844b7a673d upstream. The driver does per-buffer uploads and needs to force a full plane update if the plane's attached framebuffer has change since the last page-flip. Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane") Cc: # v6.4+ Reported-by: nerdopolis Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115 Suggested-by: Sima Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Zack Rusin Acked-by: Sima Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-3-javierm@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 20de599658c1..a72a2dbda031 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -79,6 +79,8 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); + struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, + plane); bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR; struct drm_crtc_state *crtc_state; int ret; @@ -86,6 +88,14 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane, if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc)) return 0; + /* + * Ignore damage clips if the framebuffer attached to the plane's state + * has changed since the last plane update (page-flip). In this case, a + * full plane update should happen because uploads are done per-buffer. + */ + if (old_plane_state->fb != new_plane_state->fb) + new_plane_state->ignore_damage_clips = true; + crtc_state = drm_atomic_get_crtc_state(state, new_plane_state->crtc); if (IS_ERR(crtc_state)) -- 2.43.0