summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/unichrome
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/unichrome')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c56
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tex.c4
3 files changed, 31 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index bbb198bf0e..d9b4f2d112 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -679,46 +679,48 @@ void
viaDestroyContext(__DRIcontextPrivate *driContextPriv)
{
GET_CURRENT_CONTEXT(ctx);
- struct via_context *vmesa =
+ struct via_context *vmesa =
(struct via_context *)driContextPriv->driverPrivate;
struct via_context *current = ctx ? VIA_CONTEXT(ctx) : NULL;
+
assert(vmesa); /* should never be null */
+ if (vmesa->driDrawable) {
+ viaWaitIdle(vmesa, GL_FALSE);
+
+ if (vmesa->doPageFlip) {
+ LOCK_HARDWARE(vmesa);
+ if (vmesa->pfCurrentOffset != 0) {
+ fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
+ viaResetPageFlippingLocked(vmesa);
+ }
+ UNLOCK_HARDWARE(vmesa);
+ }
+ }
+
/* check if we're deleting the currently bound context */
if (vmesa == current) {
VIA_FLUSH_DMA(vmesa);
_mesa_make_current(NULL, NULL, NULL);
}
- if (vmesa) {
- viaWaitIdle(vmesa, GL_FALSE);
- if (vmesa->doPageFlip) {
- LOCK_HARDWARE(vmesa);
- if (vmesa->pfCurrentOffset != 0) {
- fprintf(stderr, "%s - reset pf\n", __FUNCTION__);
- viaResetPageFlippingLocked(vmesa);
- }
- UNLOCK_HARDWARE(vmesa);
- }
-
- _swsetup_DestroyContext(vmesa->glCtx);
- _tnl_DestroyContext(vmesa->glCtx);
- _vbo_DestroyContext(vmesa->glCtx);
- _swrast_DestroyContext(vmesa->glCtx);
- /* free the Mesa context */
- _mesa_destroy_context(vmesa->glCtx);
- /* release our data */
- FreeBuffer(vmesa);
+ _swsetup_DestroyContext(vmesa->glCtx);
+ _tnl_DestroyContext(vmesa->glCtx);
+ _vbo_DestroyContext(vmesa->glCtx);
+ _swrast_DestroyContext(vmesa->glCtx);
+ /* free the Mesa context */
+ _mesa_destroy_context(vmesa->glCtx);
+ /* release our data */
+ FreeBuffer(vmesa);
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]));
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]));
- assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
- assert (is_empty_list(&vmesa->freed_tex_buffers));
+ assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_AGP]));
+ assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_VIDEO]));
+ assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
+ assert (is_empty_list(&vmesa->freed_tex_buffers));
- driDestroyOptionCache(&vmesa->optionCache);
+ driDestroyOptionCache(&vmesa->optionCache);
- FREE(vmesa);
- }
+ FREE(vmesa);
}
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index ca193bfa53..3648710533 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -24,8 +24,8 @@
#include <stdio.h>
-#include "utils.h"
#include "dri_util.h"
+#include "utils.h"
#include "glheader.h"
#include "context.h"
#include "framebuffer.h"
diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c
index 0261a3ff17..15f15a89a6 100644
--- a/src/mesa/drivers/dri/unichrome/via_tex.c
+++ b/src/mesa/drivers/dri/unichrome/via_tex.c
@@ -820,9 +820,7 @@ static void viaTexImage(GLcontext *ctx,
/* GL_SGIS_generate_mipmap */
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, target,
- &ctx->Texture.Unit[ctx->Texture.CurrentUnit],
- texObj);
+ _mesa_generate_mipmap(ctx, target, texObj);
}
_mesa_unmap_teximage_pbo(ctx, packing);