X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=intel%2Fintel_bufmgr_priv.h;h=59ebd18605cca9d2d605fba5bad2cfb1ffab0442;hb=c09dcbc736afb2e6a05d4cfc5c3d878ace43e2ba;hp=475c402fbaeb4bb540497bf6b0550b087bd9c5dd;hpb=4f57abfe66091281c9f59c14e6ea27b524b55d5b;p=platform%2Fupstream%2Flibdrm.git diff --git a/intel/intel_bufmgr_priv.h b/intel/intel_bufmgr_priv.h index 475c402..59ebd18 100644 --- a/intel/intel_bufmgr_priv.h +++ b/intel/intel_bufmgr_priv.h @@ -62,6 +62,18 @@ struct _drm_intel_bufmgr { unsigned int alignment); /** + * Allocate a buffer object from an existing user accessible + * address malloc'd with the provided size. + * Alignment is used when mapping to the gtt. + * Flags may be I915_VMAP_READ_ONLY or I915_USERPTR_UNSYNCHRONIZED + */ + drm_intel_bo *(*bo_alloc_userptr)(drm_intel_bufmgr *bufmgr, + const char *name, void *addr, + uint32_t tiling_mode, uint32_t stride, + unsigned long size, + unsigned long flags); + + /** * Allocate a tiled buffer object. * * Alignment for tiled objects is set automatically; the 'flags' @@ -162,12 +174,24 @@ struct _drm_intel_bufmgr { int (*bo_emit_reloc) (drm_intel_bo *bo, uint32_t offset, drm_intel_bo *target_bo, uint32_t target_offset, uint32_t read_domains, uint32_t write_domain); + int (*bo_emit_reloc_fence)(drm_intel_bo *bo, uint32_t offset, + drm_intel_bo *target_bo, + uint32_t target_offset, + uint32_t read_domains, + uint32_t write_domain); /** Executes the command buffer pointed to by bo. */ int (*bo_exec) (drm_intel_bo *bo, int used, drm_clip_rect_t *cliprects, int num_cliprects, int DR4); + /** Executes the command buffer pointed to by bo on the selected + * ring buffer + */ + int (*bo_mrb_exec) (drm_intel_bo *bo, int used, + drm_clip_rect_t *cliprects, int num_cliprects, + int DR4, unsigned flags); + /** * Pin a buffer to the aperture and fix the offset until unpinned * @@ -216,6 +240,20 @@ struct _drm_intel_bufmgr { */ int (*bo_busy) (drm_intel_bo *bo); + /** + * Specify the volatility of the buffer. + * \param bo Buffer to create a name for + * \param madv The purgeable status + * + * Use I915_MADV_DONTNEED to mark the buffer as purgeable, and it will be + * reclaimed under memory pressure. If you subsequently require the buffer, + * then you must pass I915_MADV_WILLNEED to mark the buffer as required. + * + * Returns 1 if the buffer was retained, or 0 if it was discarded whilst + * marked as I915_MADV_DONTNEED. + */ + int (*bo_madvise) (drm_intel_bo *bo, int madv); + int (*check_aperture_space) (drm_intel_bo ** bo_array, int count); /** @@ -228,6 +266,13 @@ struct _drm_intel_bufmgr { int (*bo_disable_reuse) (drm_intel_bo *bo); /** + * Query whether a buffer is reusable. + * + * \param bo Buffer to query + */ + int (*bo_is_reusable) (drm_intel_bo *bo); + + /** * * Return the pipe associated with a crtc_id so that vblank * synchronization can use the correct data in the request. @@ -247,6 +292,11 @@ struct _drm_intel_bufmgr { int debug; }; +struct _drm_intel_context { + unsigned int ctx_id; + struct _drm_intel_bufmgr *bufmgr; +}; + #define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) #define ROUND_UP_TO(x, y) (((x) + (y) - 1) / (y) * (y)) #define ROUND_UP_TO_MB(x) ROUND_UP_TO((x), 1024*1024)