1 #ifndef __NOUVEAU_BUFFEROBJ_H__
2 #define __NOUVEAU_BUFFEROBJ_H__
5 #include "nouveau_buffers.h"
7 #define NOUVEAU_BO_VRAM_OK (NOUVEAU_MEM_FB | NOUVEAU_MEM_FB_ACCEPTABLE)
8 #define NOUVEAU_BO_GART_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE)
10 typedef struct nouveau_bufferobj_region_t
{
13 } nouveau_bufferobj_region
;
15 typedef struct nouveau_bufferobj_dirty_t
{
16 nouveau_bufferobj_region
*dirty
;
18 } nouveau_bufferobj_dirty
;
20 typedef struct nouveau_buffer_object_t
{
21 /* Base class, must be first */
22 struct gl_buffer_object mesa
;
27 /* Memory used for GPU access to the buffer*/
29 nouveau_mem
* gpu_mem
;
30 nouveau_bufferobj_dirty gpu_dirty
;
32 /* Memory used for CPU access to the buffer */
34 nouveau_mem
* cpu_mem
;
36 nouveau_bufferobj_dirty cpu_dirty
;
37 } nouveau_buffer_object
;
40 nouveau_bo_init_storage(GLcontext
*ctx
, GLuint valid_gpu_access
,
41 GLsizeiptrARB size
, const GLvoid
*data
, GLenum usage
,
42 struct gl_buffer_object
*bo
);
45 nouveau_bo_move_in(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
48 nouveau_bo_move_out(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
51 nouveau_bo_map(GLcontext
*ctx
, GLenum usage
, struct gl_buffer_object
*bo
);
54 nouveau_bo_unmap(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
57 nouveau_bo_gpu_ref(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
60 nouveau_bo_dirty_linear(GLcontext
*ctx
, GLboolean on_card
,
61 uint32_t offset
, uint32_t size
,
62 struct gl_buffer_object
*bo
);
65 nouveau_bo_dirty_all(GLcontext
*ctx
, GLboolean on_card
,
66 struct gl_buffer_object
*bo
);
69 nouveau_bo_upload_dirty(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
72 nouveau_bo_download_dirty(GLcontext
*ctx
, struct gl_buffer_object
*bo
);
75 nouveauInitBufferObjects(GLcontext
*ctx
);