On Sun, 15 Jul 2012 10:22:46 +1000, Dave Airlie airlied@gmail.com wrote:
This adds interfaces for the X driver to use to create a prime handle from a buffer, and create a bo from a handle.
Signed-off-by: Dave Airlie airlied@redhat.com
intel/intel_bufmgr.h | 4 ++++ intel/intel_bufmgr_gem.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+)
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index 9b3a483..bf9ad5c 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -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_bufmgr_gem_set_bo_prime(drm_intel_bo *bo, int *prime_fd); +drm_intel_bo *drm_intel_bufmgr_gem_get_bo_prime(drm_intel_bufmgr *bufmgr,
int prime_fd, int size);
I think
drm_intel_bo_gem_create_for_prime(drm_intel_bufmgr *, int prime_fd, int size); drm_intel_bo_gem_export_to_prime(drm_intel_bo *, int *prime_fd);
are more consistent names (with an alias for drm_intel_gem_bo_flink to drm_intel_bo_gem_export_to_name). Or possibly from_prime to be more in keeping with from_name, except the 'from' has the semantics of taking a copy and 'for' has the semantics of wrapping/proxying. At least in comparable API. However we are probably stuck with the existing semantics derived from drm_intel_bo_gem_create_from_name(). -Chris