mirror of
https://github.com/torvalds/linux.git
synced 2026-07-05 20:51:37 +02:00
Instead of reimplementing all of the dma_buf functionality in every driver,
create helpers drm_prime_import and drm_prime_export that implement them in
terms of new, lower-level hook functions:
gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT
gem_prime_get_sg_table: convert a drm_gem_object to an sg_table for export
gem_prime_import_sg_table: convert an sg_table into a drm_gem_object
gem_prime_vmap, gem_prime_vunmap: map and unmap an object
These hooks are optional; drivers can opt in by using drm_gem_prime_import and
drm_gem_prime_export as the .gem_prime_import and .gem_prime_export fields of
struct drm_driver.
v2:
- Drop .begin_cpu_access. None of the drivers this code replaces implemented
it. Having it here was a leftover from when I was trying to include i915 in
this rework.
- Use mutex_lock instead of mutex_lock_interruptible, as these three drivers
did. This patch series shouldn't change that behavior.
- Rename helpers to gem_prime_get_sg_table and gem_prime_import_sg_table.
Rename struct sg_table* variables to 'sgt' for clarity.
- Update drm.tmpl for these new hooks.
v3:
- Pass the vaddr down to the driver. This lets drivers that just call vunmap on
the pointer avoid having to store the pointer in their GEM private structures.
- Move documentation into a /** DOC */ comment in drm_prime.c and include it in
drm.tmpl with a !P line. I tried to use !F lines to include documentation of
the individual functions from drmP.h, but the docproc / kernel-doc scripts
barf on that file, so hopefully this is good enough for now.
- apply refcount fix from commit
|
||
|---|---|---|
| .. | ||
| i2c | ||
| ttm | ||
| drm_buffer.h | ||
| drm_cache.h | ||
| drm_core.h | ||
| drm_crtc_helper.h | ||
| drm_crtc.h | ||
| drm_dp_helper.h | ||
| drm_edid.h | ||
| drm_encoder_slave.h | ||
| drm_fb_cma_helper.h | ||
| drm_fb_helper.h | ||
| drm_fixed.h | ||
| drm_gem_cma_helper.h | ||
| drm_global.h | ||
| drm_hashtab.h | ||
| drm_mem_util.h | ||
| drm_memory.h | ||
| drm_mm.h | ||
| drm_os_linux.h | ||
| drm_pciids.h | ||
| drm_sysfs.h | ||
| drm_usb.h | ||
| drmP.h | ||
| exynos_drm.h | ||
| gma_drm.h | ||
| i915_drm.h | ||
| intel-gtt.h | ||