summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nouveau_buffers.h
blob: f0987d2aa7dedcfd880ffc659021f9b7b717ad03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __NOUVEAU_BUFFERS_H__
#define __NOUVEAU_BUFFERS_H__

#include <stdint.h>
#include "mtypes.h"
#include "utils.h"
#include "renderbuffer.h"

typedef struct nouveau_mem_t {
	int type;
	uint64_t offset;
	uint64_t size;
	void *map;
} nouveau_mem;

extern nouveau_mem *nouveau_mem_alloc(GLcontext *, uint32_t flags,
				      GLuint size, GLuint align);
extern void nouveau_mem_free(GLcontext *, nouveau_mem *);
extern uint32_t nouveau_mem_gpu_offset_get(GLcontext *, nouveau_mem *);

extern GLboolean nouveau_memformat_flat_emit(GLcontext *,
					     nouveau_mem *dst,
					     nouveau_mem *src,
					     GLuint dst_offset,
					     GLuint src_offset,
					     GLuint size);

typedef struct nouveau_renderbuffer_t {
	struct gl_renderbuffer mesa;	/* must be first! */
	__DRIdrawablePrivate *dPriv;

	nouveau_mem *mem;
	void *map;

	int cpp;
	uint32_t offset;
	uint32_t pitch;
} nouveau_renderbuffer;

extern nouveau_renderbuffer *nouveau_renderbuffer_new(GLenum internalFormat,
						      GLvoid *map,
						      GLuint offset,
						      GLuint pitch,
						      __DRIdrawablePrivate *);
extern void nouveau_window_moved(GLcontext *);
extern GLboolean nouveau_build_framebuffer(GLcontext *,
					   struct gl_framebuffer *);
extern nouveau_renderbuffer *nouveau_current_draw_buffer(GLcontext *);

extern void nouveauInitBufferFuncs(struct dd_function_table *);

#endif