All of lore.kernel.org
 help / color / mirror / Atom feed
* locking&resource refcounting for ttm_bo_kmap/dma_buf_vmap
@ 2019-11-20 11:47 Daniel Vetter
  2019-11-20 12:02 ` Christian König
  2019-11-21  7:59 ` Thomas Zimmermann
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Vetter @ 2019-11-20 11:47 UTC (permalink / raw)
  To: dri-devel, Christian König, Thomas Hellstrom,
	Thomas Zimmermann, airlied, Gerd Hoffmann

Hi all,

I've been looking at dma_buf_v(un)map, with a goal to standardize
locking for at least dynamic dma-buf exporters/importers, most likely
by requiring dma_resv_lock. And I got questions around how this is
supposed to work, since a big chunk of drivers seem to entirely lack
locking around ttm_bo_kmap. Two big ones:

- ttm_bo_kmap looks at bo->mem to figure out what/where to kmap to get
at that buffer. bo->mem is supposed to be protected with
dma_resv_lock, but at least amgpu/nouveau/radeon/qxl don't grab that
in their prime vmap function.

- between the vmap and vunmap something needs to make sure the backing
storage doesn't move around. I didn't find that either anywhere,
ttm_bo_kmap simply seems to set up the mapping, leaving locking and
refcounting to callers.

- vram helpers have at least locking, but I'm still missing the
refcounting. vmwgfx doesn't bother with vmap.

What am I missing?

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-11-21  8:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 11:47 locking&resource refcounting for ttm_bo_kmap/dma_buf_vmap Daniel Vetter
2019-11-20 12:02 ` Christian König
2019-11-20 12:09   ` Daniel Vetter
2019-11-20 12:19     ` Daniel Vetter
2019-11-20 12:24       ` Christian König
2019-11-20 12:40         ` Daniel Vetter
2019-11-20 13:36         ` Thomas Hellstrom
2019-11-21  7:59 ` Thomas Zimmermann
2019-11-21  8:43   ` Daniel Vetter

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.