From: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
To: dri-devel@lists.freedesktop.org
Cc: bcm-kernel-feedback-list@broadcom.com, ian.forbes@broadcom.com,
zack.rusin@broadcom.com,
Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Subject: [PATCH v2 3/5] drm/vmwgfx: Reserve ttm object before resv usage
Date: Mon, 11 May 2026 17:27:50 -0700 [thread overview]
Message-ID: <20260512002752.2826685-4-maaz.mombasawala@broadcom.com> (raw)
In-Reply-To: <20260512002752.2826685-1-maaz.mombasawala@broadcom.com>
We hit dma_resv_assert_held warnings in several places, reserve the ttm
base object when it's being used to avoid them.
Signed-off-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 ++
drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
index 9c7a73c0b0dc..6817e0b8ce99 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
@@ -55,7 +55,9 @@ static void vmw_bo_free(struct ttm_buffer_object *bo)
/* Reserve and switch the backing mob. */
mutex_lock(&res->dev_priv->cmdbuf_mutex);
(void)vmw_resource_reserve(res, false, true);
+ ttm_bo_reserve(bo, false, false, NULL);
vmw_resource_mob_detach(res);
+ ttm_bo_unreserve(bo);
if (res->dirty)
res->func->dirty_free(res);
if (res->coherent)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
index 5abd7f5ad2db..21cdfc6a1641 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
@@ -131,6 +131,7 @@ crc_generate_worker(struct work_struct *work)
spin_unlock_irq(&du->vkms.crc_state_lock);
if (surf) {
+ int ret;
if (vmw_surface_sync(vmw, surf)) {
drm_warn(
crtc->dev,
@@ -138,7 +139,18 @@ crc_generate_worker(struct work_struct *work)
return;
}
+ ret = ttm_bo_reserve(&surf->res.guest_memory_bo->tbo, false, false, NULL);
+ if (ret != 0) {
+ drm_warn(&vmw->drm, "%s: failed reserve\n", __func__);
+ goto done;
+ }
+
compute_crc(crtc, surf, &crc32);
+
+ ttm_bo_unreserve(&surf->res.guest_memory_bo->tbo);
+
+done:
+
vmw_surface_unreference(&surf);
}
--
2.54.0
next prev parent reply other threads:[~2026-05-12 0:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 0:27 [PATCH v2 0/5] Fix some issues from igt runs Maaz Mombasawala
2026-05-12 0:27 ` [PATCH v2 1/5] drm/vmwgfx: Add some checks to vmw_cursor_plane_atomic_update Maaz Mombasawala
2026-05-16 4:26 ` Claude review: " Claude Code Review Bot
2026-05-12 0:27 ` [PATCH v2 2/5] drm/vmwgfx: Check vrefresh in drm_mode_setcrtc Maaz Mombasawala
2026-05-16 4:26 ` Claude review: " Claude Code Review Bot
2026-05-12 0:27 ` Maaz Mombasawala [this message]
2026-05-16 4:26 ` Claude review: drm/vmwgfx: Reserve ttm object before resv usage Claude Code Review Bot
2026-05-12 0:27 ` [PATCH v2 4/5] drm/vmwgfx: Change ttm refs for dumb buffers Maaz Mombasawala
2026-05-16 4:26 ` Claude review: " Claude Code Review Bot
2026-05-12 0:27 ` [PATCH v2 5/5] drm/vmwgfx: Remove duplicates in vmwgfx_bo.h Maaz Mombasawala
2026-05-16 4:26 ` Claude review: " Claude Code Review Bot
2026-05-16 4:26 ` Claude review: Fix some issues from igt runs Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512002752.2826685-4-maaz.mombasawala@broadcom.com \
--to=maaz.mombasawala@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.forbes@broadcom.com \
--cc=zack.rusin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox