Commit e4344161 authored by Ian Romanick's avatar Ian Romanick
parent 117042b4
......@@ -47,6 +47,5 @@ DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis
DRI_DIRS = i915 i965 r200 r300 radeon
......@@ -62,8 +62,7 @@ GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
DRI_DIRS = i915 i965 nouveau r200 r300 r600 radeon swrast
INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
......
......@@ -11,6 +11,4 @@ ARCH_FLAGS = -DDEBUG
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200 r300
#DRI_DIRS = unichrome sis
#DRI_DIRS = i810 mga r128 tdfx
......@@ -13,5 +13,5 @@ MESA_ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = mach64 r128 r200 r300 radeon tdfx
DRI_DIRS = r200 r300 radeon
......@@ -16,9 +16,5 @@ LIB_DIR = lib64
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# sis is missing because it has not been converted to use
# the new interface. i810 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = i915 i965 mach64 mga r128 r200 r300 radeon savage tdfx unichrome
DRI_DIRS = i915 i965 r200 r300 radeon
......@@ -52,5 +52,4 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
SRC_DIRS = glx gallium mesa glu
DRIVER_DIRS = dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome
DRI_DIRS = i915 r200 r300 radeon
......@@ -1161,25 +1161,20 @@ if test "x$enable_dri" = xyes; then
case "$host_cpu" in
x86_64)
# sis is missing because they have not be converted to use
# the new interface. i810 are missing because there is no
# x86-64 system where they could *ever* be used.
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
radeon savage tdfx unichrome swrast"
DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
fi
;;
powerpc*)
# Build only the drivers for cards that exist on PowerPC.
# At some point MGA will be added, but not yet.
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
DRI_DIRS="r200 r300 r600 radeon swrast"
fi
;;
sparc*)
# Build only the drivers for cards that exist on sparc`
# Build only the drivers for cards that exist on sparc
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
DRI_DIRS="r200 r300 r600 radeon swrast"
fi
;;
esac
......@@ -1189,8 +1184,7 @@ if test "x$enable_dri" = xyes; then
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 \
radeon tdfx unichrome savage sis swrast"
DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
fi
;;
gnu*)
......@@ -1210,8 +1204,7 @@ if test "x$enable_dri" = xyes; then
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
DRI_DIRS="i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast"
DRI_DIRS="i915 i965 nouveau r200 r300 r600 radeon swrast"
fi
DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
......
......@@ -176,22 +176,10 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
If you built the DRI hardware drivers, you'll also see the DRI drivers:
</p>
<pre>
-rwxr-xr-x 1 brian users 15607851 Jul 21 12:11 ffb_dri.so
-rwxr-xr-x 1 brian users 15148747 Jul 21 12:11 i810_dri.so
-rwxr-xr-x 1 brian users 14497814 Jul 21 12:11 i830_dri.so
-rwxr-xr-x 1 brian users 16895413 Jul 21 12:11 i915_dri.so
-rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
-rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
-rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
-rwxr-xr-x 1 brian users 16050488 Jul 21 12:11 r300_dri.so
-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
-rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
-rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
-rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
-rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
-rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
</pre>
<p>
......
......@@ -33,7 +33,7 @@ When libGL.so initializes itself it uses the DRI to determine the
appropriate hardware driver for each screen on the local X display.
The hardware drivers are expected to be in the /usr/X11R6/lib/modules/dri/
directory. Drivers are named with the convention <name>_dri.so where
<name> is a driver such as "tdfx", "i810", "gamma", etc.
<name> is a driver such as "radeon", "i965", "nouveau", etc.
The LIBGL_DRIVERS_DIR environment variable may be used to specify a
different DRI modules directory, overriding /usr/X11R6/lib/modules/dri/.
......
......@@ -7,14 +7,6 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
static const int i810_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i810_pci_ids.h"
#undef CHIPSET
};
#endif
static const int i915_chip_ids[] = {
#define CHIPSET(chip, desc, misc) chip,
#include "pci_ids/i915_pci_ids.h"
......@@ -59,9 +51,6 @@ static const struct {
const int *chip_ids;
int num_chips_ids;
} driver_map[] = {
#if !defined(DRIVER_MAP_DRI2_ONLY) && !defined(DRIVER_MAP_GALLIUM_ONLY)
{ 0x8086, "i810", i810_chip_ids, ARRAY_SIZE(i810_chip_ids) },
#endif
{ 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
{ 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
#ifndef DRIVER_MAP_GALLIUM_ONLY
......
......@@ -91,7 +91,7 @@ ErrorMessageF(const char *f, ...)
* directories specified by the \c LIBGL_DRIVERS_PATH environment variable in
* order to find the driver.
*
* \param driverName - a name like "tdfx", "i810", "mga", etc.
* \param driverName - a name like "i965", "radeon", "nouveau", etc.
*
* \returns
* A handle from \c dlopen, or \c NULL if driver file not found.
......
......@@ -94,7 +94,7 @@ static const struct glx_context_vtable dri_context_vtable;
/*
* Given a display pointer and screen number, determine the name of
* the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
* the DRI driver for the screen (i.e., "i965", "radeon", "nouveau", etc).
* Return True for success, False for failure.
*/
static Bool
......@@ -384,7 +384,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc,
goto handle_error;
}
/* Get device name (like "tdfx") and the ddx version numbers.
/* Get device name (like "radeon") and the ddx version numbers.
* We'll check the version in each DRI driver's "createNewScreen"
* function. */
if (!XF86DRIGetClientDriverName(dpy, scrn,
......
# src/mesa/drivers/dri/i810/Makefile
TOP = ../../../../..
include $(TOP)/configs/current
LIBNAME = i810_dri.so
include ../Makefile.defines
DRIVER_SOURCES = \
i810context.c \
i810ioctl.c \
i810render.c \
i810screen.c \
i810span.c \
i810state.c \
i810tex.c \
i810texmem.c \
i810texstate.c \
i810tris.c \
i810vb.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../Makefile.targets
This diff is collapsed.
This diff is collapsed.
/*
* GLX Hardware Device Driver for Intel i810
* Copyright (C) 1999 Keith Whitwell
*
* 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 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
* KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS 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.
*
*/
#ifndef I810CONTEXT_INC
#define I810CONTEXT_INC
typedef struct i810_context_t i810Context;
typedef struct i810_context_t *i810ContextPtr;
typedef struct i810_texture_object_t *i810TextureObjectPtr;
#include "drm.h"
#include "main/mtypes.h"
#include "main/mm.h"
#include "i810screen.h"
#include "i810tex.h"
/* Reasons to disable hardware rasterization.
*/
#define I810_FALLBACK_TEXTURE 0x1
#define I810_FALLBACK_DRAW_BUFFER 0x2
#define I810_FALLBACK_READ_BUFFER 0x4
#define I810_FALLBACK_COLORMASK 0x8
#define I810_FALLBACK_SPECULAR 0x20
#define I810_FALLBACK_LOGICOP 0x40
#define I810_FALLBACK_RENDERMODE 0x80
#define I810_FALLBACK_STENCIL 0x100
#define I810_FALLBACK_BLEND_EQ 0x200
#define I810_FALLBACK_BLEND_FUNC 0x400
#ifndef PCI_CHIP_I810
#define PCI_CHIP_I810 0x7121
#define PCI_CHIP_I810_DC100 0x7123
#define PCI_CHIP_I810_E 0x7125
#define PCI_CHIP_I815 0x1132
#endif
#define IS_I810(imesa) (imesa->i810Screen->deviceID == PCI_CHIP_I810 || \
imesa->i810Screen->deviceID == PCI_CHIP_I810_DC100 || \
imesa->i810Screen->deviceID == PCI_CHIP_I810_E)
#define IS_I815(imesa) (imesa->i810Screen->deviceID == PCI_CHIP_I815)
#define I810_UPLOAD_TEX(i) (I810_UPLOAD_TEX0<<(i))
/* Use the templated vertex formats:
*/
#define TAG(x) i810##x
#include "tnl_dd/t_dd_vertex.h"
#undef TAG
typedef void (*i810_tri_func)( i810ContextPtr, i810Vertex *, i810Vertex *,
i810Vertex * );
typedef void (*i810_line_func)( i810ContextPtr, i810Vertex *, i810Vertex * );
typedef void (*i810_point_func)( i810ContextPtr, i810Vertex * );
struct i810_context_t {
GLint refcount;
struct gl_context *glCtx;
/* Texture object bookkeeping
*/
unsigned nr_heaps;
driTexHeap * texture_heaps[1];
driTextureObject swapped;
struct i810_texture_object_t *CurrentTexObj[2];
/* Bit flag to keep track of fallbacks.
*/
GLuint Fallback;
/* State for i810vb.c and i810tris.c.
*/
GLuint new_state; /* _NEW_* flags */
GLuint SetupNewInputs;
GLuint SetupIndex;
GLuint RenderIndex;
GLmatrix ViewportMatrix;
GLenum render_primitive;
GLenum reduced_primitive;
GLuint hw_primitive;
GLubyte *verts;
drmBufPtr vertex_buffer;
char *vertex_addr;
GLuint vertex_low;
GLuint vertex_high;
GLuint vertex_last_prim;
GLboolean upload_cliprects;
/* Fallback rasterization functions
*/
i810_point_func draw_point;
i810_line_func draw_line;
i810_tri_func draw_tri;
/* Hardware state
*/
GLuint dirty; /* I810_UPLOAD_* */
GLuint Setup[I810_CTX_SETUP_SIZE];
GLuint BufferSetup[I810_DEST_SETUP_SIZE];
int vertex_size;
int vertex_stride_shift;
unsigned int lastStamp;
GLboolean stipple_in_hw;
GLenum TexEnvImageFmt[2];
/* State which can't be computed completely on the fly:
*/
GLuint LcsCullMode;
GLuint LcsLineWidth;
GLuint LcsPointSize;
/* Funny mesa mirrors
*/
GLushort ClearColor;
/* DRI stuff
*/
GLuint needClip;
struct gl_framebuffer *glBuffer;
GLboolean doPageFlip;
/* These refer to the current draw (front vs. back) buffer:
*/
int drawX; /* origin of drawable in draw buffer */
int drawY;
GLuint numClipRects; /* cliprects for that buffer */
drm_clip_rect_t *pClipRects;
int lastSwap;
int texAge;
int ctxAge;
int dirtyAge;
GLboolean scissor;
drm_clip_rect_t draw_rect;
drm_clip_rect_t scissor_rect;
drm_context_t hHWContext;
drm_hw_lock_t *driHwLock;
int driFd;
__DRIdrawable *driDrawable;
__DRIscreen *driScreen;
i810ScreenPrivate *i810Screen;
I810SAREAPtr sarea;
};
#define I810_CONTEXT(ctx) ((i810ContextPtr)(ctx->DriverCtx))
#define GET_DISPATCH_AGE( imesa ) imesa->sarea->last_dispatch
#define GET_ENQUEUE_AGE( imesa ) imesa->sarea->last_enqueue
/* Lock the hardware and validate our state.
*/
#define LOCK_HARDWARE( imesa ) \
do { \
char __ret=0; \
DRM_CAS(imesa->driHwLock, imesa->hHWContext, \
(DRM_LOCK_HELD|imesa->hHWContext), __ret); \
if (__ret) \
i810GetLock( imesa, 0 ); \
} while (0)
/* Release the kernel lock.
*/
#define UNLOCK_HARDWARE(imesa) \
DRM_UNLOCK(imesa->driFd, imesa->driHwLock, imesa->hHWContext);
/* This is the wrong way to do it, I'm sure. Otherwise the drm
* bitches that I've already got the heavyweight lock. At worst,
* this is 3 ioctls. The best solution probably only gets me down
* to 2 ioctls in the worst case.
*/
#define LOCK_HARDWARE_QUIESCENT( imesa ) do { \
LOCK_HARDWARE( imesa ); \
i810RegetLockQuiescent( imesa ); \
} while(0)
extern void i810GetLock( i810ContextPtr imesa, GLuint flags );
extern void i810EmitHwStateLocked( i810ContextPtr imesa );
extern void i810EmitScissorValues( i810ContextPtr imesa, int box_nr, int emit );
extern void i810EmitDrawingRectangle( i810ContextPtr imesa );
extern void i810XMesaSetBackClipRects( i810ContextPtr imesa );
extern void i810XMesaSetFrontClipRects( i810ContextPtr imesa );
#define SUBPIXEL_X -.5
#define SUBPIXEL_Y -.5
/* ================================================================
* Debugging:
*/
#define DO_DEBUG 1
#if DO_DEBUG
extern int I810_DEBUG;
#else
#define I810_DEBUG 0
#endif
#define DEBUG_TEXTURE 0x1
#define DEBUG_STATE 0x2
#define DEBUG_IOCTL 0x4
#define DEBUG_PRIMS 0x8
#define DEBUG_VERTS 0x10
#define DEBUG_FALLBACKS 0x20
#define DEBUG_VERBOSE 0x40
#define DEBUG_DRI 0x80
#define DEBUG_DMA 0x100
#define DEBUG_SANITY 0x200
#define DEBUG_SYNC 0x400
#define DEBUG_SLEEP 0x800
#endif
This diff is collapsed.
#ifndef I810_IOCTL_H
#define I810_IOCTL_H
#include "i810context.h"
void i810EmitPrim( i810ContextPtr imesa );
void i810FlushPrims( i810ContextPtr mmesa );
void i810FlushPrimsLocked( i810ContextPtr mmesa );
void i810FlushPrimsGetBuffer( i810ContextPtr imesa );
void i810WaitAgeLocked( i810ContextPtr imesa, int age );
void i810WaitAge( i810ContextPtr imesa, int age );
void i810DmaFinish( i810ContextPtr imesa );
void i810RegetLockQuiescent( i810ContextPtr imesa );
void i810InitIoctlFuncs( struct dd_function_table *functions );
void i810CopyBuffer( const __DRIdrawable *dpriv );
void i810PageFlip( const __DRIdrawable *dpriv );
int i810_check_copy(int fd);
#define I810_STATECHANGE(imesa, flag) \
do { \
if (imesa->vertex_low != imesa->vertex_last_prim) \
i810FlushPrims(imesa); \
imesa->dirty |= flag; \
} while (0) \
#define I810_FIREVERTICES(imesa) \
do { \
if (imesa->vertex_buffer) { \
i810FlushPrims(imesa); \
} \
} while (0)
static INLINE GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes )
{
if (imesa->vertex_low + bytes > imesa->vertex_high)
i810FlushPrimsGetBuffer( imesa );
{
GLuint *start = (GLuint *)(imesa->vertex_addr + imesa->vertex_low);
imesa->vertex_low += bytes;
return start;
}
}
#endif
/*
* Intel i810 DRI driver for Mesa 3.5
*
* Copyright (C) 1999-2000 Keith Whitwell 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 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 KEITH WHITWELL 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:
* Keith Whitwell <keith@tungstengraphics.com>
*/
/*
* Render unclipped vertex buffers by emitting vertices directly to
* dma buffers. Use strip/fan hardware acceleration where possible.
*
*/
#include "main/glheader.h"
#include "main/context.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/mtypes.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
#include "i810screen.h"
#include "i810_dri.h"
#include "i810context.h"
#include "i810tris.h"
#include "i810vb.h"
#include "i810ioctl.h"
/*
* Render unclipped vertex buffers by emitting vertices directly to
* dma buffers. Use strip/fan hardware primitives where possible.
* Try to simulate missing primitives with indexed vertices.
*/
#define HAVE_POINTS 0
#define HAVE_LINES 1
#define HAVE_LINE_STRIPS 1
#define HAVE_TRIANGLES 1
#define HAVE_TRI_STRIPS 1
#define HAVE_TRI_STRIP_1 0 /* has it, template can't use it yet */
#define HAVE_TRI_FANS 1
#define HAVE_POLYGONS 1
#define HAVE_QUADS 0
#define HAVE_QUAD_STRIPS 0
#define HAVE_ELTS 0
static GLuint hw_prim[GL_POLYGON+1] = {
0,
PR_LINES,
0,
PR_LINESTRIP,
PR_TRIANGLES,
PR_TRISTRIP_0,
PR_TRIFAN,
0,
0,
PR_POLYGON
};
static const GLenum reduced_prim[GL_POLYGON+1] = {
GL_POINTS,
GL_LINES,
GL_LINES,
GL_LINES,
GL_TRIANGLES,
GL_TRIANGLES,
GL_TRIANGLES,
GL_TRIANGLES,
GL_TRIANGLES,
GL_TRIANGLES
};
#define LOCAL_VARS i810ContextPtr imesa = I810_CONTEXT(ctx)
#define INIT( prim ) do { \
I810_STATECHANGE(imesa, 0); \
i810RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \
} while (0)
#define GET_CURRENT_VB_MAX_VERTS() \
(((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4))
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
(I810_DMA_BUF_SZ-4) / (imesa->vertex_size * 4)
#define ALLOC_VERTS( nr ) \
i810AllocDmaLow( imesa, (nr) * imesa->vertex_size * 4)
#define EMIT_VERTS( ctx, j, nr, buf ) \
i810_emit_contiguous_verts(ctx, j, (j)+(nr), buf)