Browse Source

fixup mach64 for newer build/types

tags/R300_DRIVER_0
Dave Airlie 21 years ago
parent
commit
54f4f44843

+ 2
- 2
src/mesa/drivers/dri/mach64/mach64_context.c View File

@@ -143,8 +143,8 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual,
driParseConfigFiles (&mmesa->optionCache, &mach64Screen->optionCache,
mach64Screen->driScreen->myNum, "mach64");

mmesa->sarea = (ATISAREAPrivPtr)((char *)driScreen->pSAREA +
sizeof(drm_sarea_t));
mmesa->sarea = (drm_mach64_sarea_t *)((char *)driScreen->pSAREA +
sizeof(drm_mach64_sarea_t));

mmesa->CurrentTexObj[0] = NULL;
mmesa->CurrentTexObj[1] = NULL;

+ 3
- 5
src/mesa/drivers/dri/mach64/mach64_context.h View File

@@ -36,11 +36,9 @@

#include "dri_util.h"
#include "drm.h"
#include "xf86drm.h"
#include "mach64_common.h"
#include "mach64_drm.h"

#include "mtypes.h"
#include "mm.h"

#include "mach64_reg.h"

@@ -227,7 +225,7 @@ struct mach64_context {
*/
GLuint new_state;
GLuint dirty; /* Hardware state to be updated */
mach64_context_regs_t setup;
drm_mach64_context_regs_t setup;

GLuint NewGLState;
GLuint Fallback;
@@ -310,7 +308,7 @@ struct mach64_context {
int driFd;

mach64ScreenPtr mach64Screen; /* Screen private DRI data */
ATISAREAPrivPtr sarea; /* Private SAREA data */
drm_mach64_sarea_t *sarea; /* Private SAREA data */

GLuint hardwareWentIdle;


+ 19
- 19
src/mesa/drivers/dri/mach64/mach64_ioctl.c View File

@@ -104,7 +104,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
int count = mmesa->vert_used;
int prim = mmesa->hw_primitive;
int fd = mmesa->driScreen->fd;
drmMach64Vertex vertex;
drm_mach64_vertex_t vertex;
int i, ret;

mmesa->num_verts = 0;
@@ -133,7 +133,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
vertex.buf = buffer;
vertex.used = count;
vertex.discard = 1;
ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drmMach64Vertex) );
ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
@@ -164,7 +164,7 @@ void mach64FlushVerticesLocked( mach64ContextPtr mmesa )
vertex.buf = buffer;
vertex.used = count;
vertex.discard = discard;
ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drmMach64Vertex) );
ret = drmCommandWrite( fd, DRM_MACH64_VERTEX, &vertex, sizeof(drm_mach64_vertex_t) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
fprintf( stderr, "Error flushing vertex buffer: return = %d\n", ret );
@@ -184,7 +184,7 @@ void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height )
{
drmMach64Blit blit;
drm_mach64_blit_t blit;
GLint ret;

blit.idx = buffer->idx;
@@ -197,7 +197,7 @@ void mach64FireBlitLocked( mach64ContextPtr mmesa, drmBufPtr buffer,
blit.height = height;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
&blit, sizeof(drmMach64Blit) );
&blit, sizeof(drm_mach64_blit_t) );

if ( ret ) {
UNLOCK_HARDWARE( mmesa );
@@ -229,7 +229,7 @@ static int mach64WaitForFrameCompletion( mach64ContextPtr mmesa )
int frames;

while ( 1 ) {
drmMach64GetParam gp;
drm_mach64_getparam_t gp;
int ret;

if ( mmesa->sarea->frames_queued < MACH64_MAX_QUEUED_FRAMES ) {
@@ -388,7 +388,7 @@ void mach64PerformanceCounters( mach64ContextPtr mmesa )
void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
{
GLint ret;
drmMach64Clear clear;
drm_mach64_clear_t clear;
GLint x, y, w, h;
GLuint color;
GLint nbox;
@@ -427,7 +427,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -452,7 +452,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -481,7 +481,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -506,7 +506,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -532,7 +532,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -565,7 +565,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -595,7 +595,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -627,7 +627,7 @@ void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
clear.clear_color = color;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if (ret < 0) {
UNLOCK_HARDWARE( mmesa );
@@ -656,7 +656,7 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
drmMach64Clear clear;
drm_mach64_clear_t clear;
GLuint flags = 0;
GLint i;
GLint ret;
@@ -771,7 +771,7 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
clear.clear_depth = mmesa->ClearDepth;

ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_CLEAR,
&clear, sizeof(drmMach64Clear) );
&clear, sizeof(drm_mach64_clear_t) );

if ( ret ) {
UNLOCK_HARDWARE( mmesa );
@@ -831,9 +831,9 @@ void mach64FlushDMALocked( mach64ContextPtr mmesa )
/* For client-side state emits - currently unused */
void mach64UploadHwStateLocked( mach64ContextPtr mmesa )
{
ATISAREAPrivPtr sarea = mmesa->sarea;
drm_mach64_sarea_t *sarea = mmesa->sarea;
mach64_context_regs_t *regs = &sarea->ContextState;
drm_mach64_context_regs_t *regs = &sarea->context_state;
unsigned int dirty = sarea->dirty;
CARD32 offset = ((regs->tex_size_pitch & 0xf0) >> 2);


+ 0
- 3
src/mesa/drivers/dri/mach64/mach64_ioctl.h View File

@@ -38,9 +38,6 @@
#include "mach64_reg.h"
#include "mach64_lock.h"

#include "xf86drm.h"
#include "mach64_common.h"

#define MACH64_BUFFER_MAX_DWORDS (MACH64_BUFFER_SIZE / sizeof(CARD32))



+ 4
- 4
src/mesa/drivers/dri/mach64/mach64_lock.c View File

@@ -52,7 +52,7 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags )
{
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
__DRIscreenPrivate *sPriv = mmesa->driScreen;
ATISAREAPrivPtr sarea = mmesa->sarea;
drm_mach64_sarea_t *sarea = mmesa->sarea;
int i;

drmGetLock( mmesa->driFd, mmesa->hHWContext, flags );
@@ -80,13 +80,13 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags )
| MACH64_UPLOAD_MISC
| MACH64_UPLOAD_CLIPRECTS);

if ( sarea->ctxOwner != mmesa->hHWContext ) {
sarea->ctxOwner = mmesa->hHWContext;
if ( sarea->ctx_owner != mmesa->hHWContext ) {
sarea->ctx_owner = mmesa->hHWContext;
mmesa->dirty = MACH64_UPLOAD_ALL;
}

for ( i = mmesa->firstTexHeap ; i < mmesa->lastTexHeap ; i++ ) {
if ( mmesa->texHeap[i] && (sarea->texAge[i] != mmesa->lastTexAge[i]) ) {
if ( mmesa->texHeap[i] && (sarea->tex_age[i] != mmesa->lastTexAge[i]) ) {
mach64AgeTextures( mmesa, i );
}
}

+ 1
- 1
src/mesa/drivers/dri/mach64/mach64_screen.c View File

@@ -230,7 +230,7 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv )
mach64Screen->IsPCI = serverInfo->IsPCI;

{
drmMach64GetParam gp;
drm_mach64_getparam_t gp;
int ret;

gp.param = MACH64_PARAM_IRQ_NR;

+ 0
- 2
src/mesa/drivers/dri/mach64/mach64_screen.h View File

@@ -34,8 +34,6 @@

#ifdef GLX_DIRECT_RENDERING

#include "mach64_sarea.h"
#include "drm_sarea.h"
#include "xmlconfig.h"

typedef struct {

+ 3
- 3
src/mesa/drivers/dri/mach64/mach64_state.c View File

@@ -916,8 +916,8 @@ static void mach64DDPrintDirty( const char *msg, GLuint state )
*/
void mach64EmitHwStateLocked( mach64ContextPtr mmesa )
{
ATISAREAPrivPtr sarea = mmesa->sarea;
mach64_context_regs_t *regs = &(mmesa->setup);
drm_mach64_sarea_t *sarea = mmesa->sarea;
drm_mach64_context_regs_t *regs = &(mmesa->setup);
mach64TexObjPtr t0 = mmesa->CurrentTexObj[0];
mach64TexObjPtr t1 = mmesa->CurrentTexObj[1];

@@ -940,7 +940,7 @@ void mach64EmitHwStateLocked( mach64ContextPtr mmesa )
}

if ( mmesa->dirty & (MACH64_UPLOAD_CONTEXT | MACH64_UPLOAD_MISC) ) {
memcpy( &sarea->ContextState, regs,
memcpy( &sarea->context_state, regs,
MACH64_NR_CONTEXT_REGS * sizeof(GLuint) );
}


+ 3
- 3
src/mesa/drivers/dri/mach64/mach64_tex.c View File

@@ -379,8 +379,8 @@ void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
mach64TexObjPtr t0,
mach64TexObjPtr t1 )
{
ATISAREAPrivPtr sarea = mmesa->sarea;
mach64_context_regs_t *regs = &(mmesa->setup);
drm_mach64_sarea_t *sarea = mmesa->sarea;
drm_mach64_context_regs_t *regs = &(mmesa->setup);

/* for multitex, both textures must be local or AGP */
if ( t0 && t1 )
@@ -405,7 +405,7 @@ void mach64EmitTexStateLocked( mach64ContextPtr mmesa,
mmesa->setup.secondary_tex_off = t1->offset;
}

memcpy( &sarea->ContextState.tex_size_pitch, &regs->tex_size_pitch,
memcpy( &sarea->context_state.tex_size_pitch, &regs->tex_size_pitch,
MACH64_NR_TEXTURE_REGS * sizeof(GLuint) );
}


+ 16
- 16
src/mesa/drivers/dri/mach64/mach64_texmem.c View File

@@ -60,13 +60,13 @@ void mach64DestroyTexObj( mach64ContextPtr mmesa, mach64TexObjPtr t )
if ( t->tObj && t->memBlock && mmesa ) {
/* not a placeholder, so release from global LRU if necessary */
int heap = t->heap;
drmTextureRegion *list = mmesa->sarea->texList[heap];
drmTextureRegion *list = mmesa->sarea->tex_list[heap];
int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
int start = t->memBlock->ofs >> log2sz;
int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
int i;

mmesa->lastTexAge[heap] = ++mmesa->sarea->texAge[heap];
mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];

/* Update the global LRU */
for ( i = start ; i <= end ; i++ ) {
@@ -114,13 +114,13 @@ void mach64SwapOutTexObj( mach64ContextPtr mmesa,
if ( t->tObj && t->memBlock && mmesa ) {
/* not a placeholder, so release from global LRU if necessary */
int heap = t->heap;
drmTextureRegion *list = mmesa->sarea->texList[heap];
drmTextureRegion *list = mmesa->sarea->tex_list[heap];
int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
int start = t->memBlock->ofs >> log2sz;
int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
int i;

mmesa->lastTexAge[heap] = ++mmesa->sarea->texAge[heap];
mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];

/* Update the global LRU */
for ( i = start ; i <= end ; i++ ) {
@@ -174,7 +174,7 @@ void mach64PrintLocalLRU( mach64ContextPtr mmesa, int heap )

void mach64PrintGlobalLRU( mach64ContextPtr mmesa, int heap )
{
drmTextureRegion *list = mmesa->sarea->texList[heap];
drmTextureRegion *list = mmesa->sarea->tex_list[heap];
int i, j;

fprintf( stderr, "\nGlobal LRU, heap %d list %p:\n", heap, list );
@@ -202,7 +202,7 @@ void mach64PrintGlobalLRU( mach64ContextPtr mmesa, int heap )
/* NOTE: This function is only called while holding the hardware lock */
static void mach64ResetGlobalLRU( mach64ContextPtr mmesa, int heap )
{
drmTextureRegion *list = mmesa->sarea->texList[heap];
drmTextureRegion *list = mmesa->sarea->tex_list[heap];
int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
int i;

@@ -224,7 +224,7 @@ static void mach64ResetGlobalLRU( mach64ContextPtr mmesa, int heap )
list[i].next = MACH64_NR_TEX_REGIONS;
list[MACH64_NR_TEX_REGIONS].prev = i;
list[MACH64_NR_TEX_REGIONS].next = 0;
mmesa->sarea->texAge[heap] = 0;
mmesa->sarea->tex_age[heap] = 0;
}

/* Update the local and global texture LRUs.
@@ -234,13 +234,13 @@ void mach64UpdateTexLRU( mach64ContextPtr mmesa,
mach64TexObjPtr t )
{
int heap = t->heap;
drmTextureRegion *list = mmesa->sarea->texList[heap];
drmTextureRegion *list = mmesa->sarea->tex_list[heap];
int log2sz = mmesa->mach64Screen->logTexGranularity[heap];
int start = t->memBlock->ofs >> log2sz;
int end = (t->memBlock->ofs + t->memBlock->size - 1) >> log2sz;
int i;

mmesa->lastTexAge[heap] = ++mmesa->sarea->texAge[heap];
mmesa->lastTexAge[heap] = ++mmesa->sarea->tex_age[heap];

if ( !t->memBlock ) {
fprintf( stderr, "no memblock\n\n" );
@@ -328,9 +328,9 @@ static void mach64TexturesGone( mach64ContextPtr mmesa, int heap,
*/
void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
{
ATISAREAPrivPtr sarea = mmesa->sarea;
drm_mach64_sarea_t *sarea = mmesa->sarea;

if ( sarea->texAge[heap] != mmesa->lastTexAge[heap] ) {
if ( sarea->tex_age[heap] != mmesa->lastTexAge[heap] ) {
int sz = 1 << mmesa->mach64Screen->logTexGranularity[heap];
int nr = 0;
int idx;
@@ -338,9 +338,9 @@ void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
/* Have to go right round from the back to ensure stuff ends up
* LRU in our local list... Fix with a cursor pointer.
*/
for ( idx = sarea->texList[heap][MACH64_NR_TEX_REGIONS].prev ;
for ( idx = sarea->tex_list[heap][MACH64_NR_TEX_REGIONS].prev ;
idx != MACH64_NR_TEX_REGIONS && nr < MACH64_NR_TEX_REGIONS ;
idx = sarea->texList[heap][idx].prev, nr++ )
idx = sarea->tex_list[heap][idx].prev, nr++ )
{
/* If switching texturing schemes, then the SAREA might not
* have been properly cleared, so we need to reset the
@@ -351,9 +351,9 @@ void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
break;
}

if ( sarea->texList[heap][idx].age > mmesa->lastTexAge[heap] ) {
if ( sarea->tex_list[heap][idx].age > mmesa->lastTexAge[heap] ) {
mach64TexturesGone( mmesa, heap, idx * sz, sz,
sarea->texList[heap][idx].in_use );
sarea->tex_list[heap][idx].in_use );
}
}

@@ -375,7 +375,7 @@ void mach64AgeTextures( mach64ContextPtr mmesa, int heap )
mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
MACH64_UPLOAD_TEX0IMAGE |
MACH64_UPLOAD_TEX1IMAGE);
mmesa->lastTexAge[heap] = sarea->texAge[heap];
mmesa->lastTexAge[heap] = sarea->tex_age[heap];
}
}


Loading…
Cancel
Save