Переглянути джерело

Restore ability to build full driver.

Add config options to choose between full/subset driver, and fbdev vs. DRI
windowing systems.
tags/embedded-1-20030305^0
Keith Whitwell 23 роки тому
джерело
коміт
7b7af467dd

+ 9
- 39
src/dri-es/Makefile Переглянути файл

@@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1.2.1 2003/02/05 04:37:12 keithw Exp $
# $Id: Makefile,v 1.1.2.2 2003/03/04 17:29:55 keithw Exp $

# Mesa 3-D graphics library
# Version: 5.0
@@ -7,27 +7,18 @@


MESA = ../..
MESABUILDDIR = ..
default: dri.a
include $(MESA)/Makefile.include

INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -I$(MESA)/include -I. -I..
DEFINES =

CFLAGS = $(INCLUDES) $(DEFINES) -g -MD -Wall -Wpointer-arith \
-Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs

# The .a files for each mesa module required by this driver:
#
DRI_SOURCES = dri_glx.c \
dri_util.c \
xf86drm.c \
xf86drmHash.c \
xf86drmRandom.c \
xf86drmSL.c


C_SOURCES = $(DRI_SOURCES)
C_SOURCES = dri_glx.c \
dri_util.c \
xf86drm.c \
xf86drmHash.c \
xf86drmRandom.c \
xf86drmSL.c

ASM_SOURCES =

@@ -36,32 +27,11 @@ OBJECTS = $(C_SOURCES:.c=.o) \



##### RULES #####

.S.o:
$(CC) -c $(CFLAGS) $< -o $@

.c.o:
$(CC) -c $(CFLAGS) $< -o $@

##### TARGETS #####

default: dri.a

dri.a: $(OBJECTS) Makefile
rm -f $@ && ar rcv $@ $(OBJECTS) && ranlib $@

clean:
-rm -f *.o *~ *.d .\#* *.so

tags:
etags `find . -name \*.[ch]` `find ../include`

##### DEPENDENCIES #####

-include $(C_SOURCES:.c=.d)

.SUFFIXES: .c .d

.c.d:
$(CC) -M $(INCLUDES) $(DEFINES) $< > $@

+ 41
- 41
src/mesa/drivers/dri/radeon/Makefile Переглянути файл

@@ -1,4 +1,4 @@
# $Id: Makefile,v 1.1.2.25 2003/02/23 20:24:11 keithw Exp $
# $Id: Makefile,v 1.1.2.26 2003/03/04 17:29:56 keithw Exp $

# Mesa 3-D graphics library
# Version: 5.0
@@ -7,12 +7,25 @@


MESA = ../../..
MESABUILDDIR = ../..
default: radeon_dri.so
include $(MESA)/Makefile.include

SHARED_INCLUDES = -I$(MESABUILDDIR) -I$(MESA)/include -I. -I../common -Iserver

SHARED_INCLUDES= -I$(MESABUILDDIR) -I$(MESA)/include -I. -I../common -Iserver
MINIGLX_INCLUDES = -I$(MESABUILDDIR)/miniglx
DRI_INCLUDES = -I$(MESABUILDDIR)/dri

ifeq ($(FULL_DRIVER),true)
DEFINES = \
-D_HAVE_SWRAST=1 \
-D_HAVE_SWTNL=1 \
-D_HAVE_SANITY=1 \
-D_HAVE_CODEGEN=1 \
-D_HAVE_LIGHTING=1 \
-D_HAVE_TEXGEN=1 \
-D_HAVE_USERCLIP=1 \
-D_HAVE_FULL_GL=1
else
DEFINES = \
-D_HAVE_SWRAST=0 \
-D_HAVE_SWTNL=0 \
@@ -22,10 +35,7 @@ DEFINES = \
-D_HAVE_TEXGEN=0 \
-D_HAVE_USERCLIP=0 \
-D_HAVE_FULL_GL=0

CFLAGS = $(INCLUDES) $(DEFINES) -g -MD -Wall -Wpointer-arith \
-Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs
endif

# The .a files for each mesa module required by this driver:
#
@@ -40,7 +50,7 @@ FULL_MESA = $(MESABUILDDIR)/swrast_setup/swrast_setup.a \
SUBSET_MESA = $(MESABUILDDIR)/mesa.a \
$(MESABUILDDIR)/math/math.a

DRI = $(MESABUILDDIR)/dri/dri.a

MINIGLX_SOURCES = server/radeon_dri.c

@@ -63,6 +73,7 @@ FULL_DRIVER_SOURCES = \
radeon_tex.c \
radeon_texmem.c \
radeon_texstate.c \
radeon_texcombine.c \
radeon_lighting.c \
radeon_userclip.c \
radeon_texgen.c \
@@ -81,55 +92,44 @@ FULL_DRIVER_SOURCES = \
INCLUDES = $(MINIGLX_INCLUDES) \
$(SHARED_INCLUDES)


ifeq ($(FULL_DRIVER),true)
C_SOURCES = $(DRIVER_SOURCES) \
$(FULL_DRIVER_SOURCES) \
$(MINIGLX_SOURCES)
MESA_MODULES = $(FULL_MESA)
else
C_SOURCES = $(DRIVER_SOURCES) \
$(SUBSET_DRIVER_SOURCES) \
$(MINIGLX_SOURCES)
MESA_MODULES = $(FULL_MESA)
endif

ASM_SOURCES =

ifeq ($(WINDOW_SYSTEM),dri)
WINOBJ=$(MESABUILDDIR)/dri/dri.a
WINLIB=
else
WINOBJ=
WINLIB=-L$(MESA)/src/miniglx
endif

ASM_SOURCES =
OBJECTS = $(C_SOURCES:.c=.o) \
$(ASM_SOURCES:.S=.o)



##### RULES #####

.S.o:
$(CC) -c $(CFLAGS) $< -o $@

.c.o:
$(CC) -c $(CFLAGS) $< -o $@

##### TARGETS #####

default: radeon_dri.so install

radeon_dri.so: $(SUBSET_MESA) $(OBJECTS) Makefile
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(SUBSET_MESA) -L$(MESA)/src/miniglx -lGL -lc -lm

#radeon_dri.so: $(SUBSET_MESA) $(DRI) $(OBJECTS) Makefile
# rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(SUBSET_MESA) $(DRI) -lc -lm


loc:
wc -l $(DRIVER_SOURCES) $(SUBSET_DRIVER_SOURCES)
wc -l $(DRIVER_SOURCES) $(FULL_DRIVER_SOURCES) radeon_maos_verts.c radeon_maos_vbtmp.h

install:
# Build the subset or full driver?
#
radeon_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lGL -lc -lm
rm -f $(MESA)/lib/radeon_dri.so && \
install radeon_dri.so $(MESA)/lib/radeon_dri.so

clean:
-rm -f *.o *~ *.d .\#* *.so

tags:
etags `find . -name \*.[ch]` `find ../include`

##### DEPENDENCIES #####

-include $(C_SOURCES:.c=.d)

.SUFFIXES: .c .d

.c.d:
$(CC) -M $(INCLUDES) $(DEFINES) $< > $@

+ 6
- 1
src/mesa/drivers/dri/radeon/radeon_context.c Переглянути файл

@@ -51,6 +51,8 @@
#include "radeon_tcl.h"
#include "radeon_vtxfmt.h"
#include "radeon_tex.h"
#include "radeon_span.h"
#include "radeon_maos.h"
#else
#include "radeon_subset.h"
#endif
@@ -202,8 +204,10 @@ static void radeonInitDriverFuncs( GLcontext *ctx )
ctx->Driver.ResizeBuffers = ResizeBuffers;
ctx->Driver.Error = NULL;
ctx->Driver.DrawPixels = NULL;
#if !_HAVE_SWRAST
ctx->Driver.Bitmap = radeonPointsBitmap;
ctx->Driver.ReadPixels = radeonReadPixels;
#endif
}


@@ -366,8 +370,9 @@ radeonCreateContext( const __GLcontextModes *glVisual,
#if _HAVE_SWTNL
radeonInitSwtcl( ctx );
#endif
#if !_HAVE_FULL_GL
radeonInitSelect( ctx );
#endif

rmesa->do_irqs = (rmesa->radeonScreen->irq && !getenv("RADEON_NO_IRQS"));
rmesa->irqsEmitted = 0;

+ 41
- 36
src/mesa/drivers/dri/radeon/radeon_context.h Переглянути файл

@@ -49,9 +49,47 @@ typedef struct radeon_context *radeonContextPtr;
#include "radeon_screen.h"
#include "mm.h"

/**
* \brief Reference counting on DMA buffers.
*/
struct radeon_dma_buffer {
int refcount; /**< \brief number of retained regions in radeon_dma_buffer::buf */
drmBufPtr buf; /**< \brief DMA buffer */
};

/**
* \brief Get the start of a DMA region.
*
* \param rvb pointer to a radeon_dma_region structure.
*
* \return pointer to the region start.
*/
#define GET_START(rvb) (rmesa->radeonScreen->agp_buffer_offset + \
(rvb)->address - rmesa->dma.buf0_address + \
(rvb)->start)

/**
* \brief A retained DMA region.
*
* e.g. vertices for indexed vertices.
*/
struct radeon_dma_region {
struct radeon_dma_buffer *buf; /**< \brief DMA buffer */
char *address; /**< \brief buf->address */
int start; /**< \brief start offset from start of radeon_dma_region::buf */
int end; /**< \brief end offset from start of radeon_dma_region::buf */
int ptr; /**< \brief offsets from start of radeon_dma_region::buf */
int aos_start; /**< \brief array of structures start */
int aos_stride; /**< \brief array of structures stride */
int aos_size; /**< \brief array of structures size */
};

#if _HAVE_SWTNL
#include "radeon_swtcl.h"
#endif
#if _HAVE_FULL_GL
#include "radeon_vtxfmt.h"
#endif

/**
* \brief Color buffer state.
@@ -478,40 +516,6 @@ struct radeon_texture {
GLint numHeaps; /**< \brief number of active heaps */
};

/**
* \brief Reference counting on DMA buffers.
*/
struct radeon_dma_buffer {
int refcount; /**< \brief number of retained regions in radeon_dma_buffer::buf */
drmBufPtr buf; /**< \brief DMA buffer */
};

/**
* \brief Get the start of a DMA region.
*
* \param rvb pointer to a radeon_dma_region structure.
*
* \return pointer to the region start.
*/
#define GET_START(rvb) (rmesa->radeonScreen->agp_buffer_offset + \
(rvb)->address - rmesa->dma.buf0_address + \
(rvb)->start)

/**
* \brief A retained DMA region.
*
* e.g. vertices for indexed vertices.
*/
struct radeon_dma_region {
struct radeon_dma_buffer *buf; /**< \brief DMA buffer */
char *address; /**< \brief buf->address */
int start; /**< \brief start offset from start of radeon_dma_region::buf */
int end; /**< \brief end offset from start of radeon_dma_region::buf */
int ptr; /**< \brief offsets from start of radeon_dma_region::buf */
int aos_start; /**< \brief array of structures start */
int aos_stride; /**< \brief array of structures stride */
int aos_size; /**< \brief array of structures size */
};


/**
@@ -709,8 +713,9 @@ struct radeon_context {

/* radeon_vtxfmt.c
*/
/* struct radeon_vbinfo vb; */

#if _HAVE_FULL_GL
struct radeon_vbinfo vb;
#endif
/**
* \brief Mirrors of some DRI state
*/

+ 7
- 6
src/mesa/drivers/dri/radeon/radeon_lighting.c Переглянути файл

@@ -53,7 +53,7 @@
/* Update on colormaterial, material emmissive/ambient,
* lightmodel.globalambient
*/
void update_global_ambient( GLcontext *ctx )
void update_global_ambient( GLcontext *ctx )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
float *fcmd = (float *)RADEON_DB_STATE( glt );
@@ -137,7 +137,7 @@ void check_twoside_fallback( GLcontext *ctx )
TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_LIGHT_TWOSIDE, fallback );
}

void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode )
{
if (ctx->Light.ColorMaterialEnabled) {
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -321,8 +321,9 @@ void radeonUpdateLighting( GLcontext *ctx )
}
}

void radeonLightfv( GLcontext *ctx, GLenum light,
GLenum pname, const GLfloat *params )

void radeonLightfv( GLcontext *ctx, GLenum light,
GLenum pname, const GLfloat *params )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLint p = light - GL_LIGHT0;
@@ -395,8 +396,8 @@ void radeonUpdateLighting( GLcontext *ctx )


void radeonLightModelfv( GLcontext *ctx, GLenum pname,
const GLfloat *param )
void radeonLightModelfv( GLcontext *ctx, GLenum pname,
const GLfloat *param )
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);


+ 1
- 0
src/mesa/drivers/dri/radeon/radeon_span.h Переглянути файл

@@ -38,5 +38,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define __RADEON_SPAN_H__

extern void radeonInitSpanFuncs( GLcontext *ctx );
extern void radeonCreateSwrastContext( GLcontext *ctx );

#endif

+ 3
- 2
src/mesa/drivers/dri/radeon/radeon_state.c Переглянути файл

@@ -1307,8 +1307,8 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_CLIP_PLANE2:
case GL_CLIP_PLANE3:
case GL_CLIP_PLANE4:
case GL_CLIP_PLANE5:
p = cap-GL_CLIP_PLANE0;
case GL_CLIP_PLANE5: {
GLuint p = cap-GL_CLIP_PLANE0;
RADEON_STATECHANGE( rmesa, tcl );
if (state) {
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= (RADEON_UCP_ENABLE_0<<p);
@@ -1318,6 +1318,7 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~(RADEON_UCP_ENABLE_0<<p);
}
break;
}
#endif

case GL_CULL_FACE:

+ 13
- 1
src/mesa/drivers/dri/radeon/radeon_state.h Переглянути файл

@@ -75,7 +75,6 @@ extern void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode );
#define TEXMAT_2 5

extern void radeonUpdateSpecular( GLcontext *ctx );
extern void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq );

extern void radeonUploadMatrixTranspose( radeonContextPtr rmesa, GLfloat *src,
int idx );
@@ -83,5 +82,18 @@ extern void radeonUploadMatrix( radeonContextPtr rmesa, GLfloat *src, int idx );

extern void radeonUpdateScissor( GLcontext *ctx );

/* radeon_lighting.c
*/
extern void radeonInitLightStateFuncs( GLcontext *ctx );
extern void radeonColorMaterial( GLcontext *ctx, GLenum face, GLenum mode );
extern void check_twoside_fallback( GLcontext *ctx );
extern void radeonUpdateLighting( GLcontext *ctx );


/* radeon_userclip.c
*/
extern void radeonClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq );
extern void radeonInitUserClip( GLcontext *ctx );
extern void radeonUpdateClipPlanes( GLcontext *ctx );

#endif

+ 3
- 3
src/mesa/drivers/dri/radeon/radeon_swtcl.h Переглянути файл

@@ -33,13 +33,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

#ifndef __RADEON_TRIS_H__
#define __RADEON_TRIS_H__
#ifndef __RADEON_SWTCL_H__
#define __RADEON_SWTCL_H__

#include "mtypes.h"
#include "swrast/swrast.h"


/* Flags for software fallback cases */
/* See correponding strings in radeon_swtcl.c */
#define RADEON_FALLBACK_TEXTURE 0x0001
@@ -94,6 +93,7 @@ struct radeon_swtcl_info {
struct radeon_dma_region indexed_verts;
};

extern void radeonCreateTnlContext( GLcontext *ctx );
extern void radeonInitSwtcl( GLcontext *ctx );
extern void radeonDestroySwtcl( GLcontext *ctx );


+ 2
- 1
src/mesa/drivers/dri/radeon/radeon_tcl.c Переглянути файл

@@ -40,6 +40,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "mtypes.h"
#include "enums.h"

#include "radeon_context.h"

#if _HAVE_SWTNL
#include "array_cache/acache.h"
#include "tnl/tnl.h"
@@ -48,7 +50,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_maos.h"
#endif

#include "radeon_context.h"
#include "radeon_state.h"
#include "radeon_ioctl.h"
#include "radeon_tex.h"

+ 6
- 0
src/mesa/drivers/dri/radeon/radeon_tex.h Переглянути файл

@@ -39,6 +39,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.


extern void radeonUpdateTextureState( GLcontext *ctx );
extern void radeonUpdateTextureMatrix( GLcontext *ctx );
extern GLboolean radeonUpdateTexgen( GLcontext *ctx, GLuint unit );
extern GLboolean radeonUpdateTextureEnvCombine( GLcontext *ctx, int unit );

extern int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t );

@@ -52,4 +55,7 @@ extern void radeonUpdateTexLRU( radeonContextPtr rmesa, radeonTexObjPtr t );

extern void radeonInitTextureFuncs( GLcontext *ctx );

extern void radeonInitTexTransform( GLcontext *ctx );


#endif /* __RADEON_TEX_H__ */

+ 30
- 0
src/mesa/drivers/dri/radeon/radeon_vtxfmt.h Переглянути файл

@@ -140,6 +140,36 @@ struct radeon_vbinfo {
GLvertexformat vtxfmt;
};

struct radeon_vb {
/* Keep these first: referenced from codegen templates:
*/
GLint counter, initial_counter;
GLint *dmaptr;
void (*notify)( void );
GLint vertex_size;

/* A maximum total of 15 elements per vertex: 3 floats for position, 3
* floats for normal, 4 floats for color, 4 bytes for secondary color,
* 2 floats for each texture unit (4 floats total).
*
* As soon as the 3rd TMU is supported or cube maps (or 3D textures) are
* supported, this value will grow.
*
* The position data is never actually stored here, so 3 elements could be
* trimmed out of the buffer.
*/
union { float f; int i; radeon_color_t color; } vertex[15];

GLfloat *normalptr;
GLfloat *floatcolorptr;
radeon_color_t *colorptr;
GLfloat *floatspecptr;
radeon_color_t *specptr;
GLfloat *texcoordptr[2];

GLcontext *context; /* current context : Single thread only! */
};


extern struct radeon_vb vb;


+ 1
- 1
src/mesa/drivers/dri/radeon/radeon_vtxfmt_c.c Переглянути файл

@@ -38,7 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "api_noop.h"
#include "vtxfmt.h"

#include "radeon_vtxfmt.h"
#include "radeon_context.h"

/* Fallback versions of all the entrypoints for situations where
* codegen isn't available. This is still a lot faster than the

+ 1
- 1
src/mesa/drivers/dri/radeon/radeon_vtxfmt_sse.c Переглянути файл

@@ -35,7 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "glheader.h"
#include "imports.h"
#include "simple_list.h"
#include "radeon_vtxfmt.h"
#include "radeon_context.h"

#if defined(USE_SSE_ASM) && _HAVE_CODEGEN
#include "X86/common_x86_asm.h"

+ 1
- 1
src/mesa/drivers/dri/radeon/radeon_vtxfmt_x86.c Переглянути файл

@@ -36,7 +36,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "imports.h"
#include "mmath.h"
#include "simple_list.h"
#include "radeon_vtxfmt.h"
#include "radeon_context.h"

#if defined(USE_X86_ASM)


+ 1
- 1
src/miniglx/example.miniglx.conf Переглянути файл

@@ -12,7 +12,7 @@ clientDriverName=radeon_dri.so

# The pci bus id of the video card. Find this with scanpci, lspci or
# look in /proc/pci.
pciBusID=PCI:3:0:0
pciBusID=PCI:1:0:0

# Virtual screen dimensions. Can reduce this to save videocard memory
# at the expense of maximum window size available.

Завантаження…
Відмінити
Зберегти