diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-04-24 13:36:09 +0100 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-04-26 00:40:17 +0100 |
commit | ea6a52a1f8e7fd72b5506218c31e58088131f1f5 (patch) | |
tree | d0eb24768f229a2ffe6b3cca4eb0ef356369d736 /src/gallium/state_trackers/dri/common/dri_st_api.c | |
parent | ab12d4f647702f0063c41dd090cef762aa95a0f9 (diff) |
st/dri: Add hooks for framebuffer functions
Diffstat (limited to 'src/gallium/state_trackers/dri/common/dri_st_api.c')
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_st_api.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_st_api.c b/src/gallium/state_trackers/dri/common/dri_st_api.c index cbcb149b0a..9702acea5c 100644 --- a/src/gallium/state_trackers/dri/common/dri_st_api.c +++ b/src/gallium/state_trackers/dri/common/dri_st_api.c @@ -36,12 +36,6 @@ #include "dri_context.h" #include "dri_drawable.h" #include "dri_st_api.h" -#ifndef __NOT_HAVE_DRM_H -#include "dri1.h" -#include "dri2.h" -#else -#include "drisw.h" -#endif static boolean dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, @@ -51,6 +45,7 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, { struct dri_drawable *drawable = (struct dri_drawable *) stfbi->st_manager_private; + struct dri_screen *screen = dri_screen(drawable->sPriv); unsigned statt_mask, new_mask; boolean new_stamp; int i; @@ -70,20 +65,10 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp); if (new_stamp || new_mask) { + if (new_stamp && screen->update_drawable_info) + screen->update_drawable_info(drawable); -#ifndef __NOT_HAVE_DRM_H - if (__dri1_api_hooks) { - dri1_allocate_textures(drawable, statt_mask); - } - else { - dri2_allocate_textures(drawable, statts, count); - } -#else - if (new_stamp) - drisw_update_drawable_info(drawable); - - drisw_allocate_textures(drawable, statt_mask); -#endif + screen->allocate_textures(drawable, statts, count); /* add existing textures */ for (i = 0; i < ST_ATTACHMENT_COUNT; i++) { @@ -112,17 +97,10 @@ dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi, { struct dri_drawable *drawable = (struct dri_drawable *) stfbi->st_manager_private; + struct dri_screen *screen = dri_screen(drawable->sPriv); -#ifndef __NOT_HAVE_DRM_H - if (__dri1_api_hooks) { - dri1_flush_frontbuffer(drawable, statt); - } - else { - dri2_flush_frontbuffer(drawable, statt); - } -#else - drisw_flush_frontbuffer(drawable, statt); -#endif + /* XXX remove this and just set the correct one on the framebuffer */ + screen->flush_frontbuffer(drawable, statt); return TRUE; } |