get rid of chip_object struct
This commit is contained in:
@@ -63,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "r600_emit.h"
|
||||
#include "radeon_bocs_wrapper.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_state.h"
|
||||
#include "r700_ioctl.h"
|
||||
|
||||
@@ -369,9 +368,6 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual,
|
||||
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
|
||||
}
|
||||
|
||||
r600->disable_lowimpact_fallback =
|
||||
driQueryOptionb(&r600->radeon.optionCache,
|
||||
"disable_lowimpact_fallback");
|
||||
radeon_fbo_init(&r600->radeon);
|
||||
radeonInitSpanFuncs( ctx );
|
||||
|
||||
@@ -410,7 +406,7 @@ r600DestroyContext (__DRIcontextPrivate * driContextPriv)
|
||||
context_t *context = ctx ? R700_CONTEXT(ctx) : NULL;
|
||||
|
||||
if (context)
|
||||
(context->chipobj.DestroyChipObj)(context->chipobj.pvChipObj);
|
||||
FREE(context->hw.pStateList);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -48,6 +48,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "main/mtypes.h"
|
||||
#include "main/colormac.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
|
||||
struct r600_context;
|
||||
typedef struct r600_context context_t;
|
||||
|
||||
@@ -127,15 +129,6 @@ typedef struct offset_modifiers
|
||||
GLuint mask;
|
||||
} offset_modifiers;
|
||||
|
||||
typedef struct chip_object
|
||||
{
|
||||
void *pvChipObj;
|
||||
|
||||
/* ------------ OUT ------------------- */
|
||||
GLboolean (*DestroyChipObj)(GLcontext * ctx);
|
||||
|
||||
} chip_object;
|
||||
|
||||
/**
|
||||
* \brief R600 context structure.
|
||||
*/
|
||||
@@ -143,16 +136,13 @@ struct r600_context {
|
||||
struct radeon_context radeon; /* parent class, must be first */
|
||||
|
||||
/* ------ */
|
||||
chip_object chipobj;
|
||||
R700_CHIP_CONTEXT hw;
|
||||
|
||||
/* Vertex buffers
|
||||
*/
|
||||
GLvector4f dummy_attrib[_TNL_ATTRIB_MAX];
|
||||
GLvector4f *temp_attrib[_TNL_ATTRIB_MAX];
|
||||
|
||||
GLboolean disable_lowimpact_fallback;
|
||||
|
||||
GLboolean vap_flush_needed;
|
||||
};
|
||||
|
||||
#define R700_CONTEXT(ctx) ((context_t *)(ctx->DriverCtx))
|
||||
@@ -163,6 +153,18 @@ extern GLboolean r600CreateContext(const __GLcontextModes * glVisual,
|
||||
__DRIcontextPrivate * driContextPriv,
|
||||
void *sharedContextPrivate);
|
||||
|
||||
#define R700_CONTEXT_STATES(context) ((R700_CHIP_CONTEXT *)(&context->hw))
|
||||
|
||||
extern GLboolean r700InitChipObject(context_t *context);
|
||||
extern GLboolean r700SendContextStates(context_t *context);
|
||||
extern int r700SetupStreams(GLcontext * ctx);
|
||||
extern void r700SetupVTXConstants(GLcontext * ctx,
|
||||
unsigned int nStreamID,
|
||||
void * pAos,
|
||||
unsigned int size, /* number of elements in vector */
|
||||
unsigned int stride,
|
||||
unsigned int Count); /* number of vectors in stream */
|
||||
|
||||
#define RADEON_D_CAPTURE 0
|
||||
#define RADEON_D_PLAYBACK 1
|
||||
#define RADEON_D_PLAYBACK_RAW 2
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include "main/imports.h"
|
||||
|
||||
#include "r600_context.h"
|
||||
#include "r700_chip.h"
|
||||
#include "r700_debug.h"
|
||||
|
||||
#include "r700_assembler.h"
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "r600_context.h"
|
||||
#include "r600_cmdbuf.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_state.h"
|
||||
#include "r700_tex.h"
|
||||
#include "r700_oglprog.h"
|
||||
@@ -39,25 +38,6 @@
|
||||
#include "r700_vertprog.h"
|
||||
#include "r700_ioctl.h"
|
||||
|
||||
static GLboolean r700DestroyChipObj(GLcontext * ctx)
|
||||
{
|
||||
context_t * context = R700_CONTEXT(ctx);
|
||||
R700_CHIP_CONTEXT *r700;
|
||||
|
||||
if(NULL == context->chipobj.pvChipObj)
|
||||
{
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
r700 = (R700_CHIP_CONTEXT *)(context->chipobj.pvChipObj);
|
||||
|
||||
FREE(r700->pStateList);
|
||||
|
||||
FREE(r700);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
#define LINK_STATES(reg) \
|
||||
do \
|
||||
{ \
|
||||
@@ -71,11 +51,7 @@ GLboolean r700InitChipObject(context_t *context)
|
||||
{
|
||||
ContextState * pStateListWork;
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = CALLOC( sizeof(R700_CHIP_CONTEXT) );
|
||||
|
||||
context->chipobj.pvChipObj = (void*)r700;
|
||||
|
||||
context->chipobj.DestroyChipObj = r700DestroyChipObj;
|
||||
R700_CHIP_CONTEXT *r700 = &context->hw;
|
||||
|
||||
/* init state list */
|
||||
r700->pStateList = (ContextState*) MALLOC (sizeof(ContextState)*sizeof(R700_CHIP_CONTEXT)/sizeof(unsigned int));
|
||||
|
@@ -451,17 +451,5 @@ typedef struct _R700_CHIP_CONTEXT
|
||||
|
||||
} R700_CHIP_CONTEXT;
|
||||
|
||||
#define R700_CONTEXT_STATES(context) ((R700_CHIP_CONTEXT *)(context->chipobj.pvChipObj))
|
||||
|
||||
extern GLboolean r700InitChipObject(context_t *context);
|
||||
extern GLboolean r700SendContextStates(context_t *context);
|
||||
extern int r700SetupStreams(GLcontext * ctx);
|
||||
extern void r700SetupVTXConstants(GLcontext * ctx,
|
||||
unsigned int nStreamID,
|
||||
void * pAos,
|
||||
unsigned int size, /* number of elements in vector */
|
||||
unsigned int stride,
|
||||
unsigned int Count); /* number of vectors in stream */
|
||||
|
||||
#endif /* _R700_CHIP_H_ */
|
||||
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#include "main/enums.h"
|
||||
|
||||
#include "r600_context.h"
|
||||
#include "r700_chip.h"
|
||||
|
||||
#include "r700_shaderinst.h"
|
||||
#include "r600_emit.h"
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include "r600_context.h"
|
||||
#include "r600_cmdbuf.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_fragprog.h"
|
||||
|
||||
#include "r700_debug.h"
|
||||
@@ -259,7 +258,7 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx)
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
BATCH_LOCALS(&context->radeon);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
struct r700_fragment_program *fp = (struct r700_fragment_program *)
|
||||
(ctx->FragmentProgram._Current);
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include "radeon_lock.h"
|
||||
#include "r600_context.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_ioctl.h"
|
||||
#include "r700_clear.h"
|
||||
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "r600_context.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_oglprog.h"
|
||||
#include "r700_fragprog.h"
|
||||
#include "r700_vertprog.h"
|
||||
|
@@ -47,7 +47,6 @@
|
||||
#include "r600_context.h"
|
||||
#include "r600_cmdbuf.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_tex.h"
|
||||
|
||||
#include "r700_vertprog.h"
|
||||
@@ -109,7 +108,7 @@ static GLboolean r700SetupShaders(GLcontext * ctx)
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
GLuint exportCount;
|
||||
|
||||
@@ -133,7 +132,7 @@ GLboolean r700SendTextureState(context_t *context)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
#if 0 /* to be enabled */
|
||||
for(i=0; i<R700_TEXTURE_NUMBERUNITS; i++)
|
||||
{
|
||||
@@ -238,7 +237,7 @@ static GLboolean r700RunRender(GLcontext * ctx,
|
||||
struct tnl_pipeline_stage *stage)
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
#if 1
|
||||
BATCH_LOCALS(&context->radeon);
|
||||
|
||||
|
@@ -35,7 +35,6 @@
|
||||
#include "main/glheader.h"
|
||||
|
||||
#include "r600_context.h"
|
||||
#include "r700_chip.h"
|
||||
#include "r700_debug.h"
|
||||
|
||||
#include "r700_shader.h"
|
||||
|
@@ -49,7 +49,6 @@
|
||||
|
||||
#include "r600_context.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_state.h"
|
||||
|
||||
#include "r700_fragprog.h"
|
||||
@@ -190,7 +189,7 @@ static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //-----------
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
_swrast_InvalidateState(ctx, new_state);
|
||||
_swsetup_InvalidateState(ctx, new_state);
|
||||
@@ -239,7 +238,7 @@ static void r700SetDepthState(GLcontext * ctx)
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
if (ctx->Depth.Test)
|
||||
{
|
||||
@@ -322,7 +321,7 @@ static void r700BlendFuncSeparate(GLcontext * ctx,
|
||||
|
||||
static void r700UpdateCulling(GLcontext * ctx)
|
||||
{
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(R700_CONTEXT(ctx)->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&R700_CONTEXT(ctx)->hw);
|
||||
|
||||
CLEARbit(r700->PA_SU_SC_MODE_CNTL.u32All, FACE_bit);
|
||||
CLEARbit(r700->PA_SU_SC_MODE_CNTL.u32All, CULL_FRONT_bit);
|
||||
@@ -490,7 +489,7 @@ static void r700Viewport(GLcontext * ctx,
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
__DRIdrawablePrivate *dPriv = context->radeon.dri.drawable;
|
||||
|
||||
@@ -524,12 +523,7 @@ static void r700Viewport(GLcontext * ctx,
|
||||
tz = v[MAT_TZ] * scale;
|
||||
|
||||
/* TODO : Need DMA flush as well. */
|
||||
#if 0 /* to be enabled */
|
||||
if(context->cmdbuf.count_used > 0)
|
||||
{
|
||||
(context->chipobj.FlushCmdBuffer)(context);
|
||||
}
|
||||
#endif /* to be enabled */
|
||||
|
||||
r700->PA_CL_VPORT_XSCALE.u32All = *((unsigned int*)(&sx));
|
||||
r700->PA_CL_VPORT_XOFFSET.u32All = *((unsigned int*)(&tx));
|
||||
|
||||
@@ -591,7 +585,7 @@ static void r700Scissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
|
||||
void r700SetRenderTarget(context_t *context)
|
||||
{
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
struct radeon_renderbuffer *rrb;
|
||||
unsigned int nPitchInPixel;
|
||||
@@ -774,7 +768,7 @@ void r700InitState(GLcontext * ctx) //-------------------
|
||||
{
|
||||
context_t *context = R700_CONTEXT(ctx);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
/* Turn off vgt reuse */
|
||||
r700->VGT_REUSE_OFF.u32All = 0;
|
||||
|
@@ -40,7 +40,6 @@
|
||||
#include "radeon_common.h"
|
||||
|
||||
#include "r600_context.h"
|
||||
#include "r700_chip.h"
|
||||
|
||||
#include "r700_state.h"
|
||||
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#include "r600_context.h"
|
||||
#include "r600_cmdbuf.h"
|
||||
|
||||
#include "r700_chip.h"
|
||||
#include "r700_debug.h"
|
||||
#include "r700_vertprog.h"
|
||||
|
||||
@@ -339,7 +338,7 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx)
|
||||
|
||||
BATCH_LOCALS(&context->radeon);
|
||||
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context->chipobj.pvChipObj);
|
||||
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
|
||||
|
||||
struct r700_vertex_program *vp
|
||||
= (struct r700_vertex_program *)ctx->VertexProgram._Current;
|
||||
|
Reference in New Issue
Block a user