<div dir="ltr">Hi Daniel, sorry for being late.<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/16 Daniel Vetter <span dir="ltr"><<a href="mailto:daniel.vetter@ffwll.ch" target="_blank">daniel.vetter@ffwll.ch</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
This patch series is my 2nd real stab at fixing up the locking issues around our<br>
two buffer sharing mechanisms in gem: flink and prime.<br>
<br>
I think the approach taken here is much better than my first stab, and it also<br>
seems to no longer leak buffers ;-) There some assorted cleanup and prep work<br>
(and one i915 fix) thrown into the mix, it's all stuff I've stumbled over while<br>
digging through the code.<br>
<br>
Open issues left in prime-land after these patches:<br>
- exynos probably wants a similar patch to "drm/i915: explicit store base gem<br>
  object in dma_buf->priv". The current code should be correct, but it's a bit<br></blockquote><div><br></div><div>How about using stuffs of drm_prime instead of specific ones? Seem like that we could replace specific dmabuf stuffs with common ones of drm_prime, at least in case of Exynos: i.e. each driver can export a gem to a dmabuf through drm_gem_prime_export function of drm_prime instead of specific one. By doing so, I think we could remove duplicated codes of drivers, specific dmabuf stuffs. I'm not sure but it seems like that there is any reason you try to use existing stuffs with a little change: maybe the stuffs of drm_prime couldn't be used for all drm drivers commonly.<br>
<br></div><div>Thanks,<br>Inki Dae<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  tricky. I've opted not to do that since last time around I've touched exynos a <br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  bit it broke horribly ;-) <br></blockquote><div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- The prime core should now no longer depend upon obj->import_attach being set<br>
  by drivers in their prime_import callback. This should allos us to fix udl<br>
  which really doesn't need (nor want, it confuses swiotlb among other things)<br>
  a device attachment. Didn't write that patch since my displaylink seems to<br>
  have died.<br>
- There's still the issue Inki's team pointed out where if you import a foreign<br>
  object on different fds you'll get different gem objects. So we need some form<br>
  of a per-device import cache (on top of the per-file-priv dma-buf cache we<br>
  already have). Didn't do this yet since I want to have good test coverage<br>
  (already started a bit), it looks like a bit more work and I'm not sure about<br>
  the exact design of the code yet.<br>
<br>
Review and testing highly welcome.<br>
<br>
Cheers, Daniel<br>
<br>
Daniel Vetter (20):<br>
  drm: use common drm_gem_dmabuf_release in i915/exynos drivers<br>
  drm/i915: unpin backing storage in dmabuf_unmap<br>
  drm/i915: explicit store base gem object in dma_buf->priv<br>
  drm/prime: add a bit of documentation about gem_obj->import_attach<br>
  drm/gem: remove drm_gem_object_handle_unreference<br>
  drm/gem: inline drm_gem_object_handle_reference<br>
  drm/gem: move drm_gem_object_handle_unreference_unlocked into<br>
    drm_gem.c<br>
  drm/gem: remove bogus NULL check from<br>
    drm_gem_object_handle_unreference_unlocked<br>
  drm/gem: WARN about unbalanced handle refcounts<br>
  drm/gem: fix up flink name create race<br>
  drm/prime: fix error path in drm_gem_prime_fd_to_handle<br>
  drm/gem: make drm_gem_object_handle_unreference_unlocked static<br>
  drm/gem: create drm_gem_dumb_destroy<br>
  drm/prime: use proper pointer in drm_gem_prime_handle_to_fd<br>
  drm/prime: shrink critical section protected by prime lock<br>
  drm/prime: clarify logic a bit in drm_gem_prime_fd_to_handle<br>
  drm/gem: switch dev->object_name_lock to a mutex<br>
  drm/gem: completely close gem_open vs. gem_close races<br>
  drm/prime: proper locking+refcounting for obj->dma_buf link<br>
  drm/prime: Simplify drm_gem_remove_prime_handles<br>
<br>
 drivers/gpu/drm/ast/ast_drv.c              |   2 +-<br>
 drivers/gpu/drm/ast/ast_drv.h              |   3 -<br>
 drivers/gpu/drm/ast/ast_main.c             |   7 --<br>
 drivers/gpu/drm/cirrus/cirrus_drv.c        |   2 +-<br>
 drivers/gpu/drm/cirrus/cirrus_drv.h        |   3 -<br>
 drivers/gpu/drm/cirrus/cirrus_main.c       |   7 --<br>
 drivers/gpu/drm/drm_fops.c                 |   1 +<br>
 drivers/gpu/drm/drm_gem.c                  | 192 ++++++++++++++++++++---------<br>
 drivers/gpu/drm/drm_gem_cma_helper.c       |  10 --<br>
 drivers/gpu/drm/drm_info.c                 |   2 +-<br>
 drivers/gpu/drm/drm_prime.c                |  96 ++++++++++-----<br>
 drivers/gpu/drm/exynos/exynos_drm_dmabuf.c |  23 +---<br>
 drivers/gpu/drm/exynos/exynos_drm_drv.c    |   2 +-<br>
 drivers/gpu/drm/exynos/exynos_drm_gem.c    |  22 +---<br>
 drivers/gpu/drm/exynos/exynos_drm_gem.h    |   9 --<br>
 drivers/gpu/drm/gma500/gem.c               |  17 ---<br>
 drivers/gpu/drm/gma500/psb_drv.c           |   2 +-<br>
 drivers/gpu/drm/gma500/psb_drv.h           |   2 -<br>
 drivers/gpu/drm/i915/i915_drv.c            |   2 +-<br>
 drivers/gpu/drm/i915/i915_drv.h            |   2 -<br>
 drivers/gpu/drm/i915/i915_gem.c            |   7 --<br>
 drivers/gpu/drm/i915/i915_gem_dmabuf.c     |  34 +++--<br>
 drivers/gpu/drm/mgag200/mgag200_drv.c      |   2 +-<br>
 drivers/gpu/drm/mgag200/mgag200_drv.h      |   3 -<br>
 drivers/gpu/drm/mgag200/mgag200_main.c     |   7 --<br>
 drivers/gpu/drm/nouveau/nouveau_display.c  |   7 --<br>
 drivers/gpu/drm/nouveau/nouveau_display.h  |   2 -<br>
 drivers/gpu/drm/nouveau/nouveau_drm.c      |   2 +-<br>
 drivers/gpu/drm/omapdrm/omap_drv.c         |   2 +-<br>
 drivers/gpu/drm/omapdrm/omap_drv.h         |   2 -<br>
 drivers/gpu/drm/omapdrm/omap_gem.c         |  15 ---<br>
 drivers/gpu/drm/qxl/qxl_drv.c              |   2 +-<br>
 drivers/gpu/drm/qxl/qxl_drv.h              |   3 -<br>
 drivers/gpu/drm/qxl/qxl_dumb.c             |   7 --<br>
 drivers/gpu/drm/radeon/radeon.h            |   3 -<br>
 drivers/gpu/drm/radeon/radeon_drv.c        |   5 +-<br>
 drivers/gpu/drm/radeon/radeon_gem.c        |   7 --<br>
 drivers/gpu/drm/rcar-du/rcar_du_drv.c      |   2 +-<br>
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   |   2 +-<br>
 drivers/gpu/drm/tilcdc/tilcdc_drv.c        |   2 +-<br>
 drivers/gpu/drm/udl/udl_drv.c              |   2 +-<br>
 drivers/gpu/drm/udl/udl_drv.h              |   2 -<br>
 drivers/gpu/drm/udl/udl_gem.c              |   6 -<br>
 drivers/gpu/host1x/drm/drm.c               |   2 +-<br>
 drivers/gpu/host1x/drm/gem.c               |   6 -<br>
 drivers/gpu/host1x/drm/gem.h               |   2 -<br>
 drivers/staging/imx-drm/imx-drm-core.c     |   2 +-<br>
 include/drm/drmP.h                         |  94 +++++++-------<br>
 include/drm/drm_gem_cma_helper.h           |   8 --<br>
 49 files changed, 279 insertions(+), 367 deletions(-)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br></div></div></div>