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 E82A8CA0EFB for ; Fri, 30 Aug 2024 10:37:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D8F210EA72; Fri, 30 Aug 2024 10:37:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="s+/G7YDy"; dkim-atps=neutral Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F11510EA6D for ; Fri, 30 Aug 2024 10:37:42 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 85422CE1D42; Fri, 30 Aug 2024 10:37:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FE87C4CEC2; Fri, 30 Aug 2024 10:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725014259; bh=H3fftaY4wMqgKMItiqBDa0nJRVcTmYSiol+K7hz+0cY=; h=Subject:To:Cc:From:Date:From; b=s+/G7YDyyO18mVuLC74k9f05VQ2PTUpozDEMidFvmOKwfE+Pv5rgQDiIGuxL3XyWz EzHNwBWgQ1P+7gOjF/lDkfWMC23zdxxm93+UvFt/eo8Sv/5PaC7N/4agxKtYF6r3wE jpMTAX4lnSXVFZvE6hKzAtSLQfkyewsKCUO/Qpug= Subject: Patch "drm/vmwgfx: Disable coherent dumb buffers without 3d" has been added to the 6.10-stable tree To: bcm-kernel-feedback-list@broadcom.com, bcodding@redhat.com, christian@heusel.eu, dri-devel@lists.freedesktop.org, gregkh@linuxfoundation.org, maaz.mombasawala@broadcom.com, martin.krastev@broadcom.com, zack.rusin@broadcom.com Cc: From: Date: Fri, 30 Aug 2024 12:37:08 +0200 Message-ID: <2024083007-comfy-tapered-36f6@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a note to let you know that I've just added the patch titled drm/vmwgfx: Disable coherent dumb buffers without 3d to the 6.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-vmwgfx-disable-coherent-dumb-buffers-without-3d.patch and it can be found in the queue-6.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From e9fd436bb8fb9b9d31fdf07bbcdba6d30290c5e4 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 16 Aug 2024 14:32:07 -0400 Subject: drm/vmwgfx: Disable coherent dumb buffers without 3d From: Zack Rusin commit e9fd436bb8fb9b9d31fdf07bbcdba6d30290c5e4 upstream. Coherent surfaces make only sense if the host renders to them using accelerated apis. Without 3d the entire content of dumb buffers stays in the guest making all of the extra work they're doing to synchronize between guest and host useless. Configurations without 3d also tend to run with very low graphics memory limits. The pinned console fb, mob cursors and graphical login manager tend to run out of 16MB graphics memory that those guests use. Fix it by making sure the coherent dumb buffers are only used on configs with 3d enabled. Signed-off-by: Zack Rusin Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Reported-by: Christian Heusel Closes: https://lore.kernel.org/all/0d0330f3-2ac0-4cd5-8075-7f1cbaf72a8e@heusel.eu Cc: Broadcom internal kernel review list Cc: dri-devel@lists.freedesktop.org Cc: # v6.9+ Link: https://patchwork.freedesktop.org/patch/msgid/20240816183332.31961-4-zack.rusin@broadcom.com Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Tested-by: Benjamin Coddington Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -2283,9 +2283,11 @@ int vmw_dumb_create(struct drm_file *fil /* * Without mob support we're just going to use raw memory buffer * because we wouldn't be able to support full surface coherency - * without mobs + * without mobs. There also no reason to support surface coherency + * without 3d (i.e. gpu usage on the host) because then all the + * contents is going to be rendered guest side. */ - if (!dev_priv->has_mob) { + if (!dev_priv->has_mob || !vmw_supports_3d(dev_priv)) { int cpp = DIV_ROUND_UP(args->bpp, 8); switch (cpp) { Patches currently in stable-queue which might be from zack.rusin@broadcom.com are queue-6.10/drm-vmwgfx-prevent-unmapping-active-read-buffers.patch queue-6.10/drm-vmwgfx-disable-coherent-dumb-buffers-without-3d.patch queue-6.10/drm-vmwgfx-fix-prime-with-external-buffers.patch