Skip to contentSkip to conversation

intel: add prime interface for getting/setting a prime bo. (v4)

PATCH In review Dave Airlie 2 participants 2 messages Jul 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel: add prime interface for getting/setting a prime bo. (v4)

This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle.

v2: use Chris's suggested naming (well from at least for consistency)
v3: git commit --amend fail
v4: fix as per Chris's suggestions, group assignments, add get tiling

---
 intel/intel_bufmgr.h     |    4 +++
 intel/intel_bufmgr_gem.c |   63 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
intel/intel_bufmgr.h +4 -0
index 9b3a483..2167e43 100644
@@ -192,6 +192,10 @@ void drm_intel_gem_context_destroy(drm_intel_context *ctx);
 int drm_intel_gem_bo_context_exec(drm_intel_bo *bo, drm_intel_context *ctx,
 				  int used, unsigned int flags);
 
+int drm_intel_bo_gem_export_to_prime(drm_intel_bo *bo, int *prime_fd);
+drm_intel_bo *drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr,
+						int prime_fd, int size);
+
 /* drm_intel_bufmgr_fake.c */
 drm_intel_bufmgr *drm_intel_bufmgr_fake_init(int fd,
 					     unsigned long low_offset,
intel/intel_bufmgr_gem.c +63 -0

69 lines not on this page · raw message

Signature · 1 line
1.7.10.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dave Airlie

This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle.

v2: use Chris's suggested naming (well from at least for consistency)
v3: git commit --amend fail
v4: fix as per Chris's suggestions, group assignments, add get tiling

The next person to add another create routine gets to refactor the common initialisation functions. :)

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre