and r128_sarea.h since they are redundant now.
driParseConfigFiles (&rmesa->optionCache, &r128scrn->optionCache,
r128scrn->driScreen->myNum, "r128");
- rmesa->sarea = (R128SAREAPrivPtr)((char *)sPriv->pSAREA +
+ rmesa->sarea = (drm_r128_sarea_t *)((char *)sPriv->pSAREA +
r128scrn->sarea_priv_offset);
rmesa->CurrentTexObj[0] = NULL;
r128scrn->texSize[i],
12,
R128_NR_TEX_REGIONS,
- rmesa->sarea->texList[i],
- & rmesa->sarea->texAge[i],
- & rmesa->swapped,
+ (drmTextureRegionPtr)rmesa->sarea->tex_list[i],
+ &rmesa->sarea->tex_age[i],
+ &rmesa->swapped,
sizeof( r128TexObj ),
(destroy_texture_object_t *) r128DestroyTexObj );
#ifdef GLX_DIRECT_RENDERING
#include "dri_util.h"
-
-#include "xf86drm.h"
-#include "r128_common.h"
+#include "drm.h"
+#include "r128_drm.h"
#include "mtypes.h"
*/
GLuint new_state;
GLuint dirty; /* Hardware state to be updated */
- r128_context_regs_t setup;
+ drm_r128_context_regs_t setup;
GLuint NewGLState;
GLuint Fallback;
int driFd;
r128ScreenPtr r128Screen; /* Screen private DRI data */
- R128SAREAPrivPtr sarea; /* Private SAREA data */
+ drm_r128_sarea_t *sarea; /* Private SAREA data */
/* Performance counters
*/
int count = rmesa->num_verts;
int prim = rmesa->hw_primitive;
int fd = rmesa->driScreen->fd;
- drmR128Vertex vertex;
+ drm_r128_vertex_t vertex;
int i;
rmesa->num_verts = 0;
vertex.idx = buffer->idx;
vertex.count = count;
vertex.discard = 1;
- drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(drmR128Vertex) );
+ drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(vertex) );
}
else
{
vertex.idx = buffer->idx;
vertex.count = count;
vertex.discard = discard;
- drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(drmR128Vertex) );
+ drmCommandWrite( fd, DRM_R128_VERTEX, &vertex, sizeof(vertex) );
}
}
GLint offset, GLint pitch, GLint format,
GLint x, GLint y, GLint width, GLint height )
{
- drmR128Blit blit;
+ drm_r128_blit_t blit;
GLint ret;
blit.idx = buffer->idx;
blit.height = height;
ret = drmCommandWrite( rmesa->driFd, DRM_R128_BLIT,
- &blit, sizeof(drmR128Blit) );
+ &blit, sizeof(blit) );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
- drmR128Clear clear;
+ drm_r128_clear_t clear;
GLuint flags = 0;
GLint i;
GLint ret;
}
if ( mask & DD_FRONT_LEFT_BIT ) {
- flags |= DRM_R128_FRONT_BUFFER;
+ flags |= R128_FRONT;
mask &= ~DD_FRONT_LEFT_BIT;
}
if ( mask & DD_BACK_LEFT_BIT ) {
- flags |= DRM_R128_BACK_BUFFER;
+ flags |= R128_BACK;
mask &= ~DD_BACK_LEFT_BIT;
}
if ( ( mask & DD_DEPTH_BIT ) && ctx->Depth.Mask ) {
- flags |= DRM_R128_DEPTH_BUFFER;
+ flags |= R128_DEPTH;
mask &= ~DD_DEPTH_BIT;
}
#if 0
clear.depth_mask = ~0;
ret = drmCommandWrite( rmesa->driFd, DRM_R128_CLEAR,
- &clear, sizeof(drmR128Clear) );
+ &clear, sizeof(clear) );
if ( ret ) {
UNLOCK_HARDWARE( rmesa );
const GLubyte mask[] )
{
drm_clip_rect_t *pbox = rmesa->pClipRects;
- drmR128Depth d;
+ drm_r128_depth_t d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
rmesa->sarea->nbox = nbox;
}
- d.func = DRM_R128_WRITE_SPAN;
+ d.func = R128_WRITE_SPAN;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = (unsigned int *)depth;
d.mask = (unsigned char *)mask;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
else
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- d.func = DRM_R128_WRITE_SPAN;
+ d.func = R128_WRITE_SPAN;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = (unsigned int *)depth;
d.mask = (unsigned char *)mask;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
}
const GLubyte mask[] )
{
drm_clip_rect_t *pbox = rmesa->pClipRects;
- drmR128Depth d;
+ drm_r128_depth_t d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
rmesa->sarea->nbox = nbox;
}
- d.func = DRM_R128_WRITE_PIXELS;
+ d.func = R128_WRITE_PIXELS;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = (unsigned int *)depth;
d.mask = (unsigned char *)mask;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
else
{
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- d.func = DRM_R128_WRITE_PIXELS;
+ d.func = R128_WRITE_PIXELS;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = (unsigned int *)depth;
d.mask = (unsigned char *)mask;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
}
GLuint n, GLint x, GLint y )
{
drm_clip_rect_t *pbox = rmesa->pClipRects;
- drmR128Depth d;
+ drm_r128_depth_t d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
rmesa->sarea->nbox = nbox;
}
- d.func = DRM_R128_READ_SPAN;
+ d.func = R128_READ_SPAN;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = NULL;
d.mask = NULL;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
else
{
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- d.func = DRM_R128_READ_SPAN;
+ d.func = R128_READ_SPAN;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = NULL;
d.mask = NULL;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
}
const GLint x[], const GLint y[] )
{
drm_clip_rect_t *pbox = rmesa->pClipRects;
- drmR128Depth d;
+ drm_r128_depth_t d;
int nbox = rmesa->numClipRects;
int fd = rmesa->driScreen->fd;
int i;
rmesa->sarea->nbox = nbox;
}
- d.func = DRM_R128_READ_PIXELS;
+ d.func = R128_READ_PIXELS;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = NULL;
d.mask = NULL;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
else
{
rmesa->sarea->dirty |= R128_UPLOAD_CLIPRECTS;
- d.func = DRM_R128_READ_PIXELS;
+ d.func = R128_READ_PIXELS;
d.n = n;
d.x = (int*)&x;
d.y = (int*)&y;
d.buffer = NULL;
d.mask = NULL;
- drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(drmR128Depth));
+ drmCommandWrite( fd, DRM_R128_DEPTH, &d, sizeof(d));
}
}
#include "r128_reg.h"
#include "r128_lock.h"
-#include "xf86drm.h"
-#include "r128_common.h"
-
#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(CARD32))
{
__DRIdrawablePrivate *dPriv = rmesa->driDrawable;
__DRIscreenPrivate *sPriv = rmesa->driScreen;
- R128SAREAPrivPtr sarea = rmesa->sarea;
+ drm_r128_sarea_t *sarea = rmesa->sarea;
int i;
drmGetLock( rmesa->driFd, rmesa->hHWContext, flags );
rmesa->numClipRects = dPriv->numClipRects;
rmesa->pClipRects = dPriv->pClipRects;
- if ( sarea->ctxOwner != rmesa->hHWContext ) {
- sarea->ctxOwner = rmesa->hHWContext;
+ if ( sarea->ctx_owner != rmesa->hHWContext ) {
+ sarea->ctx_owner = rmesa->hHWContext;
rmesa->dirty = R128_UPLOAD_ALL;
}
r128Screen->sarea_priv_offset = r128DRIPriv->sarea_priv_offset;
if (sPriv->drmMinor >= 3) {
- drmR128GetParam gp;
+ drm_r128_getparam_t gp;
int ret;
gp.param = R128_PARAM_IRQ_NR;
r128Screen->depthPitch = r128DRIPriv->depthPitch;
r128Screen->spanOffset = r128DRIPriv->spanOffset;
- r128Screen->texOffset[R128_CARD_HEAP] = r128DRIPriv->textureOffset;
- r128Screen->texSize[R128_CARD_HEAP] = r128DRIPriv->textureSize;
- r128Screen->logTexGranularity[R128_CARD_HEAP] = r128DRIPriv->log2TexGran;
+ r128Screen->texOffset[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureOffset;
+ r128Screen->texSize[R128_LOCAL_TEX_HEAP] = r128DRIPriv->textureSize;
+ r128Screen->logTexGranularity[R128_LOCAL_TEX_HEAP] = r128DRIPriv->log2TexGran;
if ( r128Screen->IsPCI ) {
r128Screen->numTexHeaps = R128_NR_TEX_HEAPS - 1;
- r128Screen->texOffset[R128_AGP_HEAP] = 0;
- r128Screen->texSize[R128_AGP_HEAP] = 0;
- r128Screen->logTexGranularity[R128_AGP_HEAP] = 0;
+ r128Screen->texOffset[R128_AGP_TEX_HEAP] = 0;
+ r128Screen->texSize[R128_AGP_TEX_HEAP] = 0;
+ r128Screen->logTexGranularity[R128_AGP_TEX_HEAP] = 0;
} else {
r128Screen->numTexHeaps = R128_NR_TEX_HEAPS;
- r128Screen->texOffset[R128_AGP_HEAP] =
+ r128Screen->texOffset[R128_AGP_TEX_HEAP] =
r128DRIPriv->agpTexOffset + R128_AGP_TEX_OFFSET;
- r128Screen->texSize[R128_AGP_HEAP] = r128DRIPriv->agpTexMapSize;
- r128Screen->logTexGranularity[R128_AGP_HEAP] =
+ r128Screen->texSize[R128_AGP_TEX_HEAP] = r128DRIPriv->agpTexMapSize;
+ r128Screen->logTexGranularity[R128_AGP_TEX_HEAP] =
r128DRIPriv->log2AGPTexGran;
}
#ifdef GLX_DIRECT_RENDERING
-#include "r128_sarea.h"
#include "xmlconfig.h"
typedef struct {
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
GLuint stipple[32], i;
- drmR128Stipple stippleRec;
+ drm_r128_stipple_t stippleRec;
for (i = 0; i < 32; i++) {
stipple[31 - i] = ((mask[i*4+0] << 24) |
stippleRec.mask = stipple;
drmCommandWrite( rmesa->driFd, DRM_R128_STIPPLE,
- &stippleRec, sizeof(drmR128Stipple) );
+ &stippleRec, sizeof(stippleRec) );
UNLOCK_HARDWARE( rmesa );
*/
void r128EmitHwStateLocked( r128ContextPtr rmesa )
{
- R128SAREAPrivPtr sarea = rmesa->sarea;
- r128_context_regs_t *regs = &(rmesa->setup);
+ drm_r128_sarea_t *sarea = rmesa->sarea;
+ drm_r128_context_regs_t *regs = &(rmesa->setup);
const r128TexObjPtr t0 = rmesa->CurrentTexObj[0];
const r128TexObjPtr t1 = rmesa->CurrentTexObj[1];
R128_UPLOAD_MASKS |
R128_UPLOAD_WINDOW |
R128_UPLOAD_CORE) ) {
- memcpy( &sarea->ContextState, regs, sizeof(sarea->ContextState) );
+ memcpy( &sarea->context_state, regs, sizeof(sarea->context_state) );
}
if ( (rmesa->dirty & R128_UPLOAD_TEX0) && t0 ) {
- r128_texture_regs_t *tex = &sarea->TexState[0];
+ drm_r128_texture_regs_t *tex = &sarea->tex_state[0];
tex->tex_cntl = t0->setup.tex_cntl;
tex->tex_combine_cntl = rmesa->tex_combine[0];
}
if ( (rmesa->dirty & R128_UPLOAD_TEX1) && t1 ) {
- r128_texture_regs_t *tex = &sarea->TexState[1];
+ drm_r128_texture_regs_t *tex = &sarea->tex_state[1];
tex->tex_cntl = t1->setup.tex_cntl;
tex->tex_combine_cntl = rmesa->tex_combine[1];
#ifndef _R128_TEXOBJ_H_
#define _R128_TEXOBJ_H_
-#include "r128_sarea.h"
#include "mm.h"
/* Individual texture image information.
CARD32 textureFormat; /* Actual hardware format */
- r128_texture_regs_t setup; /* Setup regs for texture */
+ drm_r128_texture_regs_t setup; /* Setup regs for texture */
};
#endif /* _R128_TEXOBJ_H_ */
+++ /dev/null
-/* r128_common.h -- common header definitions for R128 2D/3D/DRM suite
- * Created: Sun Apr 9 18:16:28 2000 by kevin@precisioninsight.com
- *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
- * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author:
- * Gareth Hughes <gareth@valinux.com>
- * Kevin E. Martin <martin@valinux.com>
- *
- * Converted to common header format:
- * Jens Owen <jens@tungstengraphics.com>
- *
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.11 2001/04/16 15:02:13 tsi Exp $
- *
- */
-
-#ifndef _R128_COMMON_H_
-#define _R128_COMMON_H_
-
-/*
- * WARNING: If you change any of these defines, make sure to change
- * the kernel include file as well (r128_drm.h)
- */
-
-/* Driver specific DRM command indices
- * NOTE: these are not OS specific, but they are driver specific
- */
-#define DRM_R128_INIT 0x00
-#define DRM_R128_CCE_START 0x01
-#define DRM_R128_CCE_STOP 0x02
-#define DRM_R128_CCE_RESET 0x03
-#define DRM_R128_CCE_IDLE 0x04
-#define DRM_R128_UNDEFINED1 0x05
-#define DRM_R128_RESET 0x06
-#define DRM_R128_SWAP 0x07
-#define DRM_R128_CLEAR 0x08
-#define DRM_R128_VERTEX 0x09
-#define DRM_R128_INDICES 0x0a
-#define DRM_R128_BLIT 0x0b
-#define DRM_R128_DEPTH 0x0c
-#define DRM_R128_STIPPLE 0x0d
-#define DRM_R128_UNDEFINED2 0x0e
-#define DRM_R128_INDIRECT 0x0f
-#define DRM_R128_FULLSCREEN 0x10
-#define DRM_R128_CLEAR2 0x11
-#define DRM_R128_GETPARAM 0x12
-#define DRM_R128_FLIP 0x13
-
-#define DRM_R128_FRONT_BUFFER 0x1
-#define DRM_R128_BACK_BUFFER 0x2
-#define DRM_R128_DEPTH_BUFFER 0x4
-
-typedef struct {
- enum {
- DRM_R128_INIT_CCE = 0x01,
- DRM_R128_CLEANUP_CCE = 0x02
- } func;
- unsigned long sarea_priv_offset;
- int is_pci;
- int cce_mode;
- int cce_secure; /* FIXME: Deprecated, we should remove this */
- int ring_size;
- int usec_timeout;
-
- unsigned int fb_bpp;
- unsigned int front_offset, front_pitch;
- unsigned int back_offset, back_pitch;
- unsigned int depth_bpp;
- unsigned int depth_offset, depth_pitch;
- unsigned int span_offset;
-
- unsigned long fb_offset;
- unsigned long mmio_offset;
- unsigned long ring_offset;
- unsigned long ring_rptr_offset;
- unsigned long buffers_offset;
- unsigned long agp_textures_offset;
-} drmR128Init;
-
-typedef struct {
- int flush;
- int idle;
-} drmR128CCEStop;
-
-typedef struct {
- int idx;
- int start;
- int end;
- int discard;
-} drmR128Indirect;
-
-typedef struct {
- int idx;
- int pitch;
- int offset;
- int format;
- unsigned short x, y;
- unsigned short width, height;
-} drmR128Blit;
-
-typedef struct {
- enum {
- DRM_R128_WRITE_SPAN = 0x01,
- DRM_R128_WRITE_PIXELS = 0x02,
- DRM_R128_READ_SPAN = 0x03,
- DRM_R128_READ_PIXELS = 0x04
- } func;
- int n;
- int *x;
- int *y;
- unsigned int *buffer;
- unsigned char *mask;
-} drmR128Depth;
-
-typedef struct {
- int prim;
- int idx; /* Index of vertex buffer */
- int count; /* Number of vertices in buffer */
- int discard; /* Client finished with buffer? */
-} drmR128Vertex;
-
-typedef struct {
- unsigned int *mask;
-} drmR128Stipple;
-
-typedef struct {
- unsigned int flags;
- unsigned int clear_color;
- unsigned int clear_depth;
- unsigned int color_mask;
- unsigned int depth_mask;
-} drmR128Clear;
-
-typedef struct {
- enum {
- DRM_R128_INIT_FULLSCREEN = 0x01,
- DRM_R128_CLEANUP_FULLSCREEN = 0x02
- } func;
-} drmR128Fullscreen;
-
-typedef struct drm_r128_getparam {
- int param;
- void *value;
-} drmR128GetParam;
-
-#define R128_PARAM_IRQ_NR 1
-
-#endif
#include "r128_dri.h"
#include "r128_macros.h"
#include "r128_reg.h"
-#include "r128_sarea.h"
#include "r128_version.h"
+#include "r128_drm.h"
/* ?? HACK - for now, put this here... */
static int R128DRIKernelInit(const DRIDriverContext *ctx)
{
R128InfoPtr info = ctx->driverPrivate;
- drmR128Init drmInfo;
+ drm_r128_init_t drmInfo;
- memset( &drmInfo, 0, sizeof(drmR128Init) );
+ memset( &drmInfo, 0, sizeof(&drmInfo) );
- drmInfo.func = DRM_R128_INIT_CCE;
+ drmInfo.func = R128_INIT_CCE;
drmInfo.sarea_priv_offset = sizeof(drm_sarea_t);
drmInfo.is_pci = info->IsPCI;
drmInfo.cce_mode = info->CCEMode;
drmInfo.agp_textures_offset = info->agpTexHandle;
if (drmCommandWrite(ctx->drmFD, DRM_R128_INIT,
- &drmInfo, sizeof(drmR128Init)) < 0)
+ &drmInfo, sizeof(drmInfo)) < 0)
return GL_FALSE;
return GL_TRUE;
static int R128CCEStop(const DRIDriverContext *ctx)
{
R128InfoPtr info = ctx->driverPrivate;
- drmR128CCEStop stop;
+ drm_r128_cce_stop_t stop;
int ret, i;
stop.flush = 1;
stop.idle = 1;
ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(drmR128CCEStop) );
+ &stop, sizeof(stop) );
if ( ret == 0 ) {
return 0;
i = 0;
do {
ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(drmR128CCEStop) );
+ &stop, sizeof(stop) );
} while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY );
if ( ret == 0 ) {
stop.idle = 0;
if ( drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP,
- &stop, sizeof(drmR128CCEStop) )) {
+ &stop, sizeof(stop) )) {
return -errno;
} else {
return 0;
0,
info->backPitch * ctx->cpp * ctx->shared.virtualHeight );
- R128SAREAPrivPtr pSAREAPriv;
- pSAREAPriv = (R128SAREAPrivPtr)(((char*)ctx->pSAREA) +
+ drm_r128_sarea_t *pSAREAPriv;
+ pSAREAPriv = (drm_r128_sarea_t *)(((char*)ctx->pSAREA) +
sizeof(drm_sarea_t));
memset(pSAREAPriv, 0, sizeof(*pSAREAPriv));
void R128DRICloseScreen(const DRIDriverContext *ctx)
{
R128InfoPtr info = ctx->driverPrivate;
- drmR128Init drmInfo;
+ drm_r128_init_t drmInfo;
/* Stop the CCE if it is still in use */
R128CCE_STOP(ctx, info);
}
/* De-allocate all kernel resources */
- memset(&drmInfo, 0, sizeof(drmR128Init));
- drmInfo.func = DRM_R128_CLEANUP_CCE;
+ memset(&drmInfo, 0, sizeof(drmInfo));
+ drmInfo.func = R128_CLEANUP_CCE;
drmCommandWrite(ctx->drmFD, DRM_R128_INIT,
- &drmInfo, sizeof(drmR128Init));
+ &drmInfo, sizeof(drmInfo));
/* De-allocate all AGP resources */
if (info->agpTex) {
#define _R128_DRI_
#include "xf86drm.h"
-#include "r128_common.h"
/* DRI Driver defaults */
#define R128_DEFAULT_CCE_PIO_MODE R128_PM4_64PIO_64VCBM_64INDBM
+++ /dev/null
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.7 2002/02/16 21:26:35 herrb Exp $ */
-/*
- * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario,
- * Precision Insight, Inc., Cedar Park, Texas, and
- * VA Linux Systems Inc., Fremont, California.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, PRECISION INSIGHT, VA LINUX
- * SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Gareth Hughes <gareth@valinux.com>
- *
- */
-
-#ifndef _R128_SAREA_H_
-#define _R128_SAREA_H_
-
-/* WARNING: If you change any of these defines, make sure to change the
- * defines in the kernel file (r128_drm.h)
- */
-#ifndef __R128_SAREA_DEFINES__
-#define __R128_SAREA_DEFINES__
-
-/* What needs to be changed for the current vertex buffer?
- */
-#define R128_UPLOAD_CONTEXT 0x001
-#define R128_UPLOAD_SETUP 0x002
-#define R128_UPLOAD_TEX0 0x004
-#define R128_UPLOAD_TEX1 0x008
-#define R128_UPLOAD_TEX0IMAGES 0x010
-#define R128_UPLOAD_TEX1IMAGES 0x020
-#define R128_UPLOAD_CORE 0x040
-#define R128_UPLOAD_MASKS 0x080
-#define R128_UPLOAD_WINDOW 0x100
-#define R128_UPLOAD_CLIPRECTS 0x200 /* handled client-side */
-#define R128_REQUIRE_QUIESCENCE 0x400
-#define R128_UPLOAD_ALL 0x7ff
-
-#define R128_FRONT 0x1
-#define R128_BACK 0x2
-#define R128_DEPTH 0x4
-
-/* Primitive types
- */
-#define R128_POINTS 0x1
-#define R128_LINES 0x2
-#define R128_LINE_STRIP 0x3
-#define R128_TRIANGLES 0x4
-#define R128_TRIANGLE_FAN 0x5
-#define R128_TRIANGLE_STRIP 0x6
-
-/* Vertex/indirect buffer size
- */
-#define R128_BUFFER_SIZE 16384
-
-/* Byte offsets for indirect buffer data
- */
-#define R128_INDEX_PRIM_OFFSET 20
-#define R128_HOSTDATA_BLIT_OFFSET 32
-
-/* Keep these small for testing
- */
-#define R128_NR_SAREA_CLIPRECTS 12
-
-/* There are 2 heaps (local/AGP). Each region within a heap is a
- * minimum of 64k, and there are at most 64 of them per heap.
- */
-#define R128_CARD_HEAP 0
-#define R128_AGP_HEAP 1
-#define R128_NR_TEX_HEAPS 2
-#define R128_NR_TEX_REGIONS 64
-#define R128_LOG_TEX_GRANULARITY 16
-
-#define R128_NR_CONTEXT_REGS 12
-
-#define R128_MAX_TEXTURE_LEVELS 11
-#define R128_MAX_TEXTURE_UNITS 2
-
-#endif /* __R128_SAREA_DEFINES__ */
-
-typedef struct {
- /* Context state - can be written in one large chunk */
- unsigned int dst_pitch_offset_c;
- unsigned int dp_gui_master_cntl_c;
- unsigned int sc_top_left_c;
- unsigned int sc_bottom_right_c;
- unsigned int z_offset_c;
- unsigned int z_pitch_c;
- unsigned int z_sten_cntl_c;
- unsigned int tex_cntl_c;
- unsigned int misc_3d_state_cntl_reg;
- unsigned int texture_clr_cmp_clr_c;
- unsigned int texture_clr_cmp_msk_c;
- unsigned int fog_color_c;
-
- /* Texture state */
- unsigned int tex_size_pitch_c;
- unsigned int constant_color_c;
-
- /* Setup state */
- unsigned int pm4_vc_fpu_setup;
- unsigned int setup_cntl;
-
- /* Mask state */
- unsigned int dp_write_mask;
- unsigned int sten_ref_mask_c;
- unsigned int plane_3d_mask_c;
-
- /* Window state */
- unsigned int window_xy_offset;
-
- /* Core state */
- unsigned int scale_3d_cntl;
-} r128_context_regs_t;
-
-/* Setup registers for each texture unit
- */
-typedef struct {
- unsigned int tex_cntl;
- unsigned int tex_combine_cntl;
- unsigned int tex_size_pitch;
- unsigned int tex_offset[R128_MAX_TEXTURE_LEVELS];
- unsigned int tex_border_color;
-} r128_texture_regs_t;
-
-typedef struct {
- /* The channel for communication of state information to the kernel
- * on firing a vertex buffer.
- */
- r128_context_regs_t ContextState;
- r128_texture_regs_t TexState[R128_MAX_TEXTURE_UNITS];
- unsigned int dirty;
- unsigned int vertsize;
- unsigned int vc_format;
-
-#if defined(XF86DRI) | defined(_SOLO)
- /* The current cliprects, or a subset thereof.
- */
- drm_clip_rect_t boxes[R128_NR_SAREA_CLIPRECTS];
- unsigned int nbox;
-#endif
-
- /* Counters for throttling of rendering clients.
- */
- unsigned int last_frame;
- unsigned int last_dispatch;
-
- /* Maintain an LRU of contiguous regions of texture space. If you
- * think you own a region of texture memory, and it has an age
- * different to the one you set, then you are mistaken and it has
- * been stolen by another client. If global texAge hasn't changed,
- * there is no need to walk the list.
- *
- * These regions can be used as a proxy for the fine-grained texture
- * information of other clients - by maintaining them in the same
- * lru which is used to age their own textures, clients have an
- * approximate lru for the whole of global texture space, and can
- * make informed decisions as to which areas to kick out. There is
- * no need to choose whether to kick out your own texture or someone
- * else's - simply eject them all in LRU order.
- */
- /* Last elt is sentinal */
- drmTextureRegion texList[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
- /* last time texture was uploaded */
- unsigned int texAge[R128_NR_TEX_HEAPS];
-
- int ctxOwner; /* last context to upload state */
- int pfAllowPageFlip; /* set by the 2d driver, read by the client */
- int pfCurrentPage; /* set by kernel, read by others */
-} R128SAREAPriv, *R128SAREAPrivPtr;
-
-#endif