From 4c9042d21dca0be75f196f952a687675c140aac2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Sep 2012 08:47:55 -0600 Subject: [PATCH] radeon/r200: remove use of gl_context::DriverCtx field --- src/mesa/drivers/dri/r200/r200_context.h | 7 ++++++- src/mesa/drivers/dri/radeon/radeon_common_context.c | 5 ----- src/mesa/drivers/dri/radeon/radeon_common_context.h | 5 ++++- src/mesa/drivers/dri/radeon/radeon_context.h | 7 ++++++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 778934d0fd5..fb25dceb992 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -623,7 +623,12 @@ struct r200_context { struct ati_fragment_shader *afs_loaded; }; -#define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx)) + +static inline r200ContextPtr +R200_CONTEXT(struct gl_context *ctx) +{ + return (r200ContextPtr) ctx; +} extern void r200DestroyContext( __DRIcontext *driContextPriv ); diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index a56d72a6d1d..9fbcf74d7c2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -248,11 +248,6 @@ void radeonDestroyContext(__DRIcontext *driContextPriv ) /* free the Mesa context data */ _mesa_free_context_data(&radeon->glCtx); - /* _mesa_destroy_context() might result in calls to functions that - * depend on the DriverCtx, so don't set it to NULL before. - * - * radeon->glCtx->DriverCtx = NULL; - */ /* free the option cache */ driDestroyOptionCache(&radeon->optionCache); diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index 6149fcc48fb..8437f34b5b7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -499,7 +499,10 @@ struct radeon_context { } vtbl; }; -#define RADEON_CONTEXT(glctx) ((radeonContextPtr)(ctx->DriverCtx)) +static inline radeonContextPtr RADEON_CONTEXT(struct gl_context *ctx) +{ + return (radeonContextPtr) ctx; +} static inline __DRIdrawable* radeon_get_drawable(radeonContextPtr radeon) { diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index cb036cd6570..6ad1d4d48ad 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -442,7 +442,12 @@ struct r100_context { }; -#define R100_CONTEXT(ctx) ((r100ContextPtr)(ctx->DriverCtx)) +static inline r100ContextPtr +R100_CONTEXT(struct gl_context *ctx) +{ + return (r100ContextPtr) ctx; +} + #define RADEON_OLD_PACKETS 1 -- 2.30.2