1 #ifndef COMMON_MISC_H
2 #define COMMON_MISC_H
3
4 #include "radeon_common_context.h"
5 #include "radeon_dma.h"
6 #include "radeon_texture.h"
7
8 void radeonUserClear(struct gl_context *ctx, GLuint mask);
9 void radeonSetCliprects(radeonContextPtr radeon);
10 void radeonUpdateScissor( struct gl_context *ctx );
11 void radeonScissor(struct gl_context *ctx);
12
13 extern uint32_t radeonGetAge(radeonContextPtr radeon);
14
15 void radeonFlush(struct gl_context *ctx);
16 void radeonFinish(struct gl_context * ctx);
17 void radeonEmitState(radeonContextPtr radeon);
18 GLuint radeonCountStateEmitSize(radeonContextPtr radeon);
19
20 void radeon_clear_tris(struct gl_context *ctx, GLbitfield mask);
21
22 void radeon_window_moved(radeonContextPtr radeon);
23 void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb);
24 void radeonDrawBuffer( struct gl_context *ctx, GLenum mode );
25 void radeonReadBuffer( struct gl_context *ctx, GLenum mode );
26 void radeon_viewport(struct gl_context *ctx);
27 void radeon_fbo_init(struct radeon_context *radeon);
28 void
29 radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
30 struct radeon_bo *bo);
31 struct radeon_renderbuffer *
32 radeon_create_renderbuffer(mesa_format format, __DRIdrawable *driDrawPriv);
33
34 void
35 radeonReadPixels(struct gl_context * ctx,
36 GLint x, GLint y, GLsizei width, GLsizei height,
37 GLenum format, GLenum type,
38 const struct gl_pixelstore_attrib *pack, GLvoid * pixels);
39
40 void radeon_check_front_buffer_rendering(struct gl_context *ctx);
radeon_renderbuffer(struct gl_renderbuffer * rb)41 static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb)
42 {
43 struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb;
44 radeon_print(RADEON_MEMORY, RADEON_TRACE,
45 "%s(rb %p)\n",
46 __func__, (void *) rb);
47 if (rrb && rrb->base.Base.ClassID == RADEON_RB_CLASS)
48 return rrb;
49 else
50 return NULL;
51 }
52
radeon_get_renderbuffer(struct gl_framebuffer * fb,int att_index)53 static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index)
54 {
55 radeon_print(RADEON_MEMORY, RADEON_TRACE,
56 "%s(fb %p, index %d)\n",
57 __func__, (void *) fb, att_index);
58
59 if (att_index >= 0)
60 return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer);
61 else
62 return NULL;
63 }
64
radeon_get_depthbuffer(radeonContextPtr rmesa)65 static inline struct radeon_renderbuffer *radeon_get_depthbuffer(radeonContextPtr rmesa)
66 {
67 struct radeon_renderbuffer *rrb;
68 rrb = radeon_renderbuffer(rmesa->state.depth.rb);
69 if (!rrb)
70 return NULL;
71
72 return rrb;
73 }
74
radeon_get_colorbuffer(radeonContextPtr rmesa)75 static inline struct radeon_renderbuffer *radeon_get_colorbuffer(radeonContextPtr rmesa)
76 {
77 struct radeon_renderbuffer *rrb;
78
79 rrb = radeon_renderbuffer(rmesa->state.color.rb);
80 if (!rrb)
81 return NULL;
82 return rrb;
83 }
84
85 #include "radeon_cmdbuf.h"
86
87
88 #endif
89