Merge remote branch 'origin/mesa_7_6_branch'
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_common.h
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(GLcontext *ctx, GLuint mask);
9 void radeonRecalcScissorRects(radeonContextPtr radeon);
10 void radeonSetCliprects(radeonContextPtr radeon);
11 void radeonUpdateScissor( GLcontext *ctx );
12 void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
13 void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask );
14
15 void radeonWaitForIdleLocked(radeonContextPtr radeon);
16 extern uint32_t radeonGetAge(radeonContextPtr radeon);
17 void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
18 const drm_clip_rect_t *rect);
19 void radeonSwapBuffers(__DRIdrawablePrivate * dPriv);
20 void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv,
21 int x, int y, int w, int h );
22
23 void radeonUpdatePageFlipping(radeonContextPtr rmesa);
24
25 void radeonFlush(GLcontext *ctx);
26 void radeonFinish(GLcontext * ctx);
27 void radeonEmitState(radeonContextPtr radeon);
28 GLuint radeonCountStateEmitSize(radeonContextPtr radeon);
29
30 void radeon_clear_tris(GLcontext *ctx, GLbitfield mask);
31
32 void radeon_window_moved(radeonContextPtr radeon);
33 void radeon_draw_buffer(GLcontext *ctx, struct gl_framebuffer *fb);
34 void radeonDrawBuffer( GLcontext *ctx, GLenum mode );
35 void radeonReadBuffer( GLcontext *ctx, GLenum mode );
36 void radeon_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height);
37 void radeon_get_cliprects(radeonContextPtr radeon,
38 struct drm_clip_rect **cliprects,
39 unsigned int *num_cliprects,
40 int *x_off, int *y_off);
41 void radeon_fbo_init(struct radeon_context *radeon);
42 void
43 radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
44 struct radeon_bo *bo);
45 struct radeon_renderbuffer *
46 radeon_create_renderbuffer(gl_format format, __DRIdrawablePrivate *driDrawPriv);
47 static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb)
48 {
49 struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb;
50 if (rrb && rrb->base.ClassID == RADEON_RB_CLASS)
51 return rrb;
52 else
53 return NULL;
54 }
55
56 static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index)
57 {
58 if (att_index >= 0)
59 return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer);
60 else
61 return NULL;
62 }
63
64 static inline struct radeon_renderbuffer *radeon_get_depthbuffer(radeonContextPtr rmesa)
65 {
66 struct radeon_renderbuffer *rrb;
67 rrb = radeon_renderbuffer(rmesa->state.depth.rb);
68 if (!rrb)
69 return NULL;
70
71 return rrb;
72 }
73
74 static inline struct radeon_renderbuffer *radeon_get_colorbuffer(radeonContextPtr rmesa)
75 {
76 struct radeon_renderbuffer *rrb;
77
78 rrb = radeon_renderbuffer(rmesa->state.color.rb);
79 if (!rrb)
80 return NULL;
81 return rrb;
82 }
83
84 #include "radeon_cmdbuf.h"
85
86
87 #endif