]> git.hungrycats.org Git - linux/commit
drm/xe/display: skip FORCE_WC and vm_bound check for external dma-bufs
authorMatthew Auld <matthew.auld@intel.com>
Fri, 12 Jun 2026 17:05:02 +0000 (18:05 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Fri, 26 Jun 2026 12:34:43 +0000 (13:34 +0100)
commit3e493f88c84088ccd7b53cdd23ac5c875c9a60dd
treec3682e46e666423463520c43a83af6d7d59d254e
parentc4508edb2c723de93717272488ea65b165637eac
drm/xe/display: skip FORCE_WC and vm_bound check for external dma-bufs

Currently, xe_display_bo_framebuffer_init() unconditionally attempts to
apply XE_BO_FLAG_FORCE_WC to the buffer and rejects the FB creation with
-EINVAL if the BO is already VM_BINDed.

However, for imported dma-bufs (ttm_bo_type_sg), this check doesn't seem
to make much sense since CPU caching policy is entirely controlled by
the exporter. Plus there is no place to set this flag, in the first
place. Also this is not rejected if not yet vm_binded, but that seems
arbitrary since setting or not setting FORCE_WC should a noop either
way, at this stage, and whether it is currently VM_BINDed makes no
difference.

Currently if we run an app and offload rendering to an external dGPU,
like NV or another xe device, the dma-buf passed back to the compositor
(igpu) will be an actual external import from xe pov, and it will be
missing FORCE_WC, and if the compositor side did a VM_BIND before
turning into it into an fb the whole thing gets rejected.

So it looks like we either need to reject outright, no matter what, or
this usecase is valid and we need to loosen the restriction for sg
buffers.  Proposing here to loosen the restriction.

Assisted-by: Gemini:gemini-3.1-pro-preview
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7919
Fixes: 44e694958b95 ("drm/xe/display: Implement display support")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Maarten Lankhorst <dev@lankhorst.se>
Cc: <stable@vger.kernel.org> # v6.12+
Reviewed-by: Maarten Lankhorst <dev@lankhorst.se>
Link: https://patch.msgid.link/20260612170501.550816-2-matthew.auld@intel.com
drivers/gpu/drm/xe/display/xe_display_bo.c
drivers/gpu/drm/xe/display/xe_fb_pin.c