All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm: add a self-import PRIME dma-buf helper and use it in Xe
@ 2026-10-12 18:05 Niranjana Vishwanathapura
  2026-10-12 18:05 ` [PATCH 1/2] drm/gem: add helper to detect self-imported PRIME dma-bufs Niranjana Vishwanathapura
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Niranjana Vishwanathapura @ 2026-10-12 18:05 UTC (permalink / raw)
  To: dri-devel, intel-xe

Detecting that a PRIME dma-buf being imported was exported by the same
DRM device is a common pattern currently open-coded in drivers. This
series factors it into a generic helper and converts Xe to use it.

Patch 1 adds drm_gem_prime_self_import(): when the dma-buf originates
from the importing device and uses the expected dma-buf ops, it returns
the backing GEM object with an extra reference, letting drivers short-
circuit the generic PRIME import path and skip the extra dma-buf file
reference.

Patch 2 replaces Xe's driver-specific self-import detection with the new
helper, exposed within Xe as xe_dma_buf_to_gem() for future use.

No intended functional change.

Assisted-by: GitHub-Copilot:claude-opus-4.8
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>

Farah Kassabri (2):
  drm/gem: add helper to detect self-imported PRIME dma-bufs
  drm/xe/dma-buf: Use drm helper to detect dma-buf self-import

 drivers/gpu/drm/drm_prime.c     | 48 +++++++++++++++++++++++++++------
 drivers/gpu/drm/xe/xe_dma_buf.c | 23 +++++++++-------
 drivers/gpu/drm/xe/xe_dma_buf.h |  2 ++
 include/drm/drm_prime.h         |  4 +++
 4 files changed, 59 insertions(+), 18 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-13  8:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 18:05 [PATCH 0/2] drm: add a self-import PRIME dma-buf helper and use it in Xe Niranjana Vishwanathapura
2026-10-12 18:05 ` [PATCH 1/2] drm/gem: add helper to detect self-imported PRIME dma-bufs Niranjana Vishwanathapura
2026-10-12 21:58   ` Matthew Brost
2026-10-12 18:05 ` [PATCH 2/2] drm/xe/dma-buf: Use drm helper to detect dma-buf self-import Niranjana Vishwanathapura
2026-10-12 21:59   ` Matthew Brost
2026-10-12 20:47 ` ✓ CI.KUnit: success for drm: add a self-import PRIME dma-buf helper and use it in Xe Patchwork
2026-10-13  0:40 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-13  8:22 ` ✓ Xe.CI.FULL: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.