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