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;
#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"
*/
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;
int driFd;
mach64ScreenPtr mach64Screen; /* Screen private DRI data */
- ATISAREAPrivPtr sarea; /* Private SAREA data */
+ drm_mach64_sarea_t *sarea; /* Private SAREA data */
GLuint hardwareWentIdle;
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;
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 );
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 );
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;
blit.height = height;
ret = drmCommandWrite( mmesa->driFd, DRM_MACH64_BLIT,
- &blit, sizeof(drmMach64Blit) );
+ &blit, sizeof(drm_mach64_blit_t) );
if ( ret ) {
UNLOCK_HARDWARE( mmesa );
int frames;
while ( 1 ) {
- drmMach64GetParam gp;
+ drm_mach64_getparam_t gp;
int ret;
if ( mmesa->sarea->frames_queued < MACH64_MAX_QUEUED_FRAMES ) {
void mach64PerformanceBoxesLocked( mach64ContextPtr mmesa )
{
GLint ret;
- drmMach64Clear clear;
+ drm_mach64_clear_t clear;
GLint x, y, w, h;
GLuint color;
GLint nbox;
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
__DRIdrawablePrivate *dPriv = mmesa->driDrawable;
- drmMach64Clear clear;
+ drm_mach64_clear_t clear;
GLuint flags = 0;
GLint i;
GLint ret;
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 );
/* 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);
#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))
{
__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 );
| 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 );
}
}
mach64Screen->IsPCI = serverInfo->IsPCI;
{
- drmMach64GetParam gp;
+ drm_mach64_getparam_t gp;
int ret;
gp.param = MACH64_PARAM_IRQ_NR;
#ifdef GLX_DIRECT_RENDERING
-#include "mach64_sarea.h"
-#include "drm_sarea.h"
#include "xmlconfig.h"
typedef struct {
*/
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];
}
if ( mmesa->dirty & (MACH64_UPLOAD_CONTEXT | MACH64_UPLOAD_MISC) ) {
- memcpy( &sarea->ContextState, regs,
+ memcpy( &sarea->context_state, regs,
MACH64_NR_CONTEXT_REGS * sizeof(GLuint) );
}
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 )
mmesa->setup.secondary_tex_off = t1->offset;
}
- memcpy( &sarea->ContextState.tex_size_pitch, ®s->tex_size_pitch,
+ memcpy( &sarea->context_state.tex_size_pitch, ®s->tex_size_pitch,
MACH64_NR_TEXTURE_REGS * sizeof(GLuint) );
}
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++ ) {
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++ ) {
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 );
/* 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;
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.
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" );
*/
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;
/* 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
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 );
}
}
mmesa->dirty |= (MACH64_UPLOAD_CONTEXT |
MACH64_UPLOAD_TEX0IMAGE |
MACH64_UPLOAD_TEX1IMAGE);
- mmesa->lastTexAge[heap] = sarea->texAge[heap];
+ mmesa->lastTexAge[heap] = sarea->tex_age[heap];
}
}