00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _PSB_BUFMGR_H_
00034 #define _PSB_BUFMGR_H_
00035 #include <xf86mm.h>
00036 #include "i915_drm.h"
00037 #include "ws_dri_fencemgr.h"
00038
00039 typedef struct _drmBONode
00040 {
00041 drmMMListHead head;
00042 drmBO *buf;
00043 struct drm_i915_op_arg bo_arg;
00044 uint64_t arg0;
00045 uint64_t arg1;
00046 } drmBONode;
00047
00048 typedef struct _drmBOList {
00049 unsigned numTarget;
00050 unsigned numCurrent;
00051 unsigned numOnList;
00052 drmMMListHead list;
00053 drmMMListHead free;
00054 } drmBOList;
00055
00056
00057 struct _DriFenceObject;
00058 struct _DriBufferObject;
00059 struct _DriBufferPool;
00060 struct _DriBufferList;
00061
00062
00063
00064
00065
00066
00067 extern drmBO *driBOKernel(struct _DriBufferObject *buf);
00068 extern void *driBOMap(struct _DriBufferObject *buf, unsigned flags,
00069 unsigned hint);
00070 extern void driBOUnmap(struct _DriBufferObject *buf);
00071 extern unsigned long driBOOffset(struct _DriBufferObject *buf);
00072 extern unsigned long driBOPoolOffset(struct _DriBufferObject *buf);
00073
00074 extern uint64_t driBOFlags(struct _DriBufferObject *buf);
00075 extern struct _DriBufferObject *driBOReference(struct _DriBufferObject *buf);
00076 extern void driBOUnReference(struct _DriBufferObject *buf);
00077
00078 extern int driBOData(struct _DriBufferObject *r_buf,
00079 unsigned size, const void *data,
00080 struct _DriBufferPool *pool, uint64_t flags);
00081
00082 extern void driBOSubData(struct _DriBufferObject *buf,
00083 unsigned long offset, unsigned long size,
00084 const void *data);
00085 extern void driBOGetSubData(struct _DriBufferObject *buf,
00086 unsigned long offset, unsigned long size,
00087 void *data);
00088 extern int driGenBuffers(struct _DriBufferPool *pool,
00089 const char *name,
00090 unsigned n,
00091 struct _DriBufferObject *buffers[],
00092 unsigned alignment, uint64_t flags, unsigned hint);
00093 extern void driGenUserBuffer(struct _DriBufferPool *pool,
00094 const char *name,
00095 struct _DriBufferObject *buffers[],
00096 void *ptr, unsigned bytes);
00097 extern void driDeleteBuffers(unsigned n, struct _DriBufferObject *buffers[]);
00098 extern void driInitBufMgr(int fd);
00099 extern struct _DriBufferList *driBOCreateList(int target);
00100 extern int driBOResetList(struct _DriBufferList * list);
00101 extern void driBOAddListItem(struct _DriBufferList * list,
00102 struct _DriBufferObject *buf,
00103 uint64_t flags, uint64_t mask, int *itemLoc,
00104 struct _drmBONode **node);
00105
00106 extern void driBOValidateList(int fd, struct _DriBufferList * list);
00107 extern void driBOFreeList(struct _DriBufferList * list);
00108 extern struct _DriFenceObject *driBOFenceUserList(struct _DriFenceMgr *mgr,
00109 struct _DriBufferList *list,
00110 const char *name,
00111 drmFence *kFence);
00112 extern void driBOUnrefUserList(struct _DriBufferList *list);
00113 extern void driBOValidateUserList(struct _DriBufferList * list);
00114 extern drmBOList *driGetdrmBOList(struct _DriBufferList *list);
00115 extern void driPutdrmBOList(struct _DriBufferList *list);
00116
00117 extern void driBOFence(struct _DriBufferObject *buf,
00118 struct _DriFenceObject *fence);
00119
00120 extern void driPoolTakeDown(struct _DriBufferPool *pool);
00121 extern void driBOSetReferenced(struct _DriBufferObject *buf,
00122 unsigned long handle);
00123 unsigned long driBOSize(struct _DriBufferObject *buf);
00124 extern void driBOWaitIdle(struct _DriBufferObject *buf, int lazy);
00125 extern void driPoolTakeDown(struct _DriBufferPool *pool);
00126
00127 extern void driReadLockKernelBO(void);
00128 extern void driReadUnlockKernelBO(void);
00129 extern void driWriteLockKernelBO(void);
00130 extern void driWriteUnlockKernelBO(void);
00131
00132
00133
00134
00135
00136 extern drmBOList *driBOGetDRMBuffers(struct _DriBufferList *list);
00137 extern drmBOList *driBOGetDRIBuffers(struct _DriBufferList *list);
00138 #endif