diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-04 16:01:21 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-04 16:01:21 +0000 |
commit | fd076122ee1256ee925ccbea7b526c913c4ff089 (patch) | |
tree | c89b3fbb5ef98f3a4d619451ecad4efdd4767301 /driver/xf86-video-ati/src/radeon_vbo.h | |
parent | 737151a789a0028daa367ded1f192d5fb9fb108d (diff) |
Re-update xf86-video-ati to 6.14.3.
Because of ati.c revision 1.5, it will not be selected by
autoconfiguration code, so people who want to run this version of the
driver on their radeon cards need an explicit "Device" section in
xorg.conf.
Diffstat (limited to 'driver/xf86-video-ati/src/radeon_vbo.h')
-rw-r--r-- | driver/xf86-video-ati/src/radeon_vbo.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/driver/xf86-video-ati/src/radeon_vbo.h b/driver/xf86-video-ati/src/radeon_vbo.h new file mode 100644 index 000000000..583f2626f --- /dev/null +++ b/driver/xf86-video-ati/src/radeon_vbo.h @@ -0,0 +1,53 @@ + +#ifndef RADEON_VBO_H +#define RADEON_VBO_H + +extern void radeon_vb_no_space(ScrnInfoPtr pScrn, struct radeon_vbo_object *vbo, int vert_size); +extern void radeon_vbo_init_lists(ScrnInfoPtr pScrn); +extern void radeon_vbo_free_lists(ScrnInfoPtr pScrn); +extern void radeon_vbo_flush_bos(ScrnInfoPtr pScrn); +extern void radeon_vbo_get(ScrnInfoPtr pScrn, struct radeon_vbo_object *vbo); +extern void radeon_vbo_put(ScrnInfoPtr pScrn, struct radeon_vbo_object *vbo); + +static inline void radeon_vbo_check(ScrnInfoPtr pScrn, + struct radeon_vbo_object *vbo, + int vert_size) +{ + + if ((vbo->vb_offset + (vbo->verts_per_op * vert_size)) > vbo->vb_total) { + radeon_vb_no_space(pScrn, vbo, vert_size); + } +} + +static inline void * +radeon_vbo_space(ScrnInfoPtr pScrn, + struct radeon_vbo_object *vbo, + int vert_size) +{ +#if defined(XF86DRM_MODE) + RADEONInfoPtr info = RADEONPTR(pScrn); +#endif + void *vb; + + /* we've ran out of space in the vertex buffer - need to get a + new one */ + radeon_vbo_check(pScrn, vbo, vert_size); + + vbo->vb_op_vert_size = vert_size; +#if defined(XF86DRM_MODE) + if (info->cs) + vb = (pointer)((char *)vbo->vb_bo->ptr + vbo->vb_offset); + else +#endif + vb = (pointer)((char *)vbo->vb_ptr + vbo->vb_offset); + return vb; +} + +static inline void radeon_vbo_commit(ScrnInfoPtr pScrn, + struct radeon_vbo_object *vbo) +{ + + vbo->vb_offset += vbo->verts_per_op * vbo->vb_op_vert_size; +} + +#endif |