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 476A215958B; Mon, 29 Jan 2024 17:10:25 +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=1706548225; cv=none; b=RwKWJCtfd0eA44Qwhv8dAunnyxwIvGP3XsB8zv4vWHnBjQP0eTy9esFzbBi92iFLZqTDZj5tlI2AslaR+hAfwn7hFFKoIK1x2+tUU/Yrtq/zqtMal6CDC+hmOMhGGETQlDyVmtNMt7OH/cpQVxKdCArTAHIRqXT5db7on4oBEL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706548225; c=relaxed/simple; bh=U6o4GeNTq92S6/US8We+m4WfkA0VVzDdHz+iQPHoEf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I1KqWRX3GomnX9HzAvq6u3e2d5NcpdylFH26+zq4x875HG4zy8Z4UlBh/VHMytKncfcQ+2zAI+nZQ1jlM+HFI11U0LIRHqXd2dW3HRtNdliEmxdBV38+sdnJl2OPOAYw3tJcFoSkhR4j2vhAwW/IUCXTcEaGhr6R6+o9ZACmRDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O7VO84dd; 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="O7VO84dd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C98DC433F1; Mon, 29 Jan 2024 17:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706548225; bh=U6o4GeNTq92S6/US8We+m4WfkA0VVzDdHz+iQPHoEf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O7VO84ddYDoDDParvznk1S8Sxdppi9FjHcnQuqEpfCYuNCUB/9iqmPGALL8/gF6iq H/NQEqI/xDbuilyMHq9ctPuQ5SRtmvIlsf3Iy74COfQagceGT8dN2U3/C1EGzy1zuT JaKDgkMtaiBpUYv+pVSThdurChi6gYpRX73svBMM= 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.7 254/346] drm/virtio: Disable damage clipping if FB changed since last page-flip Date: Mon, 29 Jan 2024 09:04:45 -0800 Message-ID: <20240129170023.876417834@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129170016.356158639@linuxfoundation.org> References: <20240129170016.356158639@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-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(+) --- 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_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 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))