From b3f1aac95e5cef26824da08c89fcf2b08ac5ef86 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 21 Jun 2008 02:50:11 +0200 Subject: r200: fix typo in r200TryDrawPixels parameter validation (bug 16406) --- src/mesa/drivers/dri/r200/r200_pixel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c index db8ceeabe03..46d230767a1 100644 --- a/src/mesa/drivers/dri/r200/r200_pixel.c +++ b/src/mesa/drivers/dri/r200/r200_pixel.c @@ -382,7 +382,7 @@ r200TryDrawPixels( GLcontext *ctx, GLint pitch = unpack->RowLength ? unpack->RowLength : width; GLuint planemask; GLuint cpp = rmesa->r200Screen->cpp; - GLint size = width * pitch * cpp; + GLint size = height * pitch * cpp; if (R200_DEBUG & DEBUG_PIXEL) fprintf(stderr, "%s\n", __FUNCTION__); -- cgit v1.2.3 From dc25661099bcc4b107a30ca504fcc2e76db3492e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 21 Jun 2008 10:52:49 -0400 Subject: R300: 1002:5657 is actually RV410 See bug 14289 --- src/mesa/drivers/dri/radeon/radeon_chipset.h | 2 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/radeon/radeon_chipset.h b/src/mesa/drivers/dri/radeon/radeon_chipset.h index 2821ecc0c08..55a73eab209 100644 --- a/src/mesa/drivers/dri/radeon/radeon_chipset.h +++ b/src/mesa/drivers/dri/radeon/radeon_chipset.h @@ -106,6 +106,7 @@ #define PCI_CHIP_RV410_564F 0x564F #define PCI_CHIP_RV410_5652 0x5652 #define PCI_CHIP_RV410_5653 0x5653 +#define PCI_CHIP_RV410_5657 0x5657 #define PCI_CHIP_RS300_5834 0x5834 #define PCI_CHIP_RS300_5835 0x5835 #define PCI_CHIP_RS480_5954 0x5954 @@ -127,7 +128,6 @@ #define PCI_CHIP_RV370_5B63 0x5B63 #define PCI_CHIP_RV370_5B64 0x5B64 #define PCI_CHIP_RV370_5B65 0x5B65 -#define PCI_CHIP_RV370_5657 0x5657 #define PCI_CHIP_RV280_5C61 0x5C61 #define PCI_CHIP_RV280_5C63 0x5C63 #define PCI_CHIP_R430_5D48 0x5D48 diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 08568a407ed..b647cffa0e7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -599,7 +599,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) case PCI_CHIP_RV370_5B63: case PCI_CHIP_RV370_5B64: case PCI_CHIP_RV370_5B65: - case PCI_CHIP_RV370_5657: case PCI_CHIP_RV380_3150: case PCI_CHIP_RV380_3152: case PCI_CHIP_RV380_3154: @@ -656,6 +655,7 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) case PCI_CHIP_RV410_564F: case PCI_CHIP_RV410_5652: case PCI_CHIP_RV410_5653: + case PCI_CHIP_RV410_5657: case PCI_CHIP_RV410_5E48: case PCI_CHIP_RV410_5E4A: case PCI_CHIP_RV410_5E4B: -- cgit v1.2.3 From e1f9adc27445ea3381af1f71cfec0317298be5b1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 20 Jun 2008 17:58:53 -0700 Subject: Solaris port of Mesa 7.1 with autoconf support Signed-off-by: Brian Paul --- bin/mklib | 18 ++++++---- configs/autoconf.in | 3 ++ configure.ac | 60 +++++++++++++++++++++++++++++---- src/mesa/drivers/dri/common/dri_util.h | 1 + src/mesa/drivers/dri/common/xmlconfig.c | 6 ++++ src/mesa/main/glheader.h | 45 ++++++++++++++++++++++--- src/mesa/main/imports.h | 1 + 7 files changed, 116 insertions(+), 18 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/bin/mklib b/bin/mklib index 2fb215e7d7f..0dc3135d50f 100755 --- a/bin/mklib +++ b/bin/mklib @@ -61,7 +61,8 @@ do echo ' -minor N specifies minor version number (default is 0)' echo ' -patch N specifies patch version number (default is 0)' echo ' -lLIBRARY specifies a dependency on LIBRARY' - echo ' -LDIR search in DIR for library dependencies' + echo ' -LDIR search in DIR for library dependencies at build time' + echo ' -RDIR search in DIR for library dependencies at run time' echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' echo ' Not observed on all systems at this time.' echo ' -ldflags OPT specify any additional linker flags in OPT' @@ -107,6 +108,9 @@ do -L*) DEPS="$DEPS $1" ;; + -R*) + DEPS="$DEPS $1" + ;; -Wl*) DEPS="$DEPS $1" ;; @@ -336,7 +340,7 @@ case $ARCH in # use g++ LINK="g++" else - echo "mklib: warning: can't find C++ comiler, trying CC." + echo "mklib: warning: can't find C++ compiler, trying CC." LINK="CC" fi else @@ -365,9 +369,11 @@ case $ARCH in # Check if objects are SPARC v9 # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1 set ${OBJECTS} - SPARCV9=`file $1 | grep SPARCV9` - if [ "${SPARCV9}" ] ; then - OPTS="${OPTS} -xarch=v9" + if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then + SPARCV9=`file $1 | grep SPARCV9` + if [ "${SPARCV9}" ] ; then + OPTS="${OPTS} -xarch=v9" + fi fi if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} @@ -379,7 +385,7 @@ case $ARCH in ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} else rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} - ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} fi FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" diff --git a/configs/autoconf.in b/configs/autoconf.in index 9a70ec1fabb..ed44a0f1a68 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -98,3 +98,6 @@ DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ # Where libGL will look for DRI hardware drivers DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) + +# Additional per-platform configuration settings +@EXTRA_CONFIG_LINES@ diff --git a/configure.ac b/configure.ac index a054330e2fa..c4b65db4ea4 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,18 @@ AC_CHECK_PROGS([MAKE], [gmake make]) AC_PATH_PROG([MKDEP], [makedepend]) AC_PATH_PROG([SED], [sed]) +dnl Platform-specific program settings +EXTRA_CONFIG_LINES="" +AC_SUBST([EXTRA_CONFIG_LINES]) +case "$host_os" in +solaris*) + # Solaris /bin/sh is too old/non-POSIX compliant + AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh]) + EXTRA_CONFIG_LINES="SHELL=$POSIX_SHELL" + ;; +esac + + MKDEP_OPTIONS=-fdepend dnl Ask gcc where it's keeping its secret headers if test "x$GCC" = xyes; then @@ -75,6 +87,9 @@ if test "x$GCC" = xyes; then fi DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN" ;; +solaris*) + DEFINES="$DEFINES -DPTHREADS -DSVR4" + ;; esac dnl Add flags for gcc and g++ @@ -325,6 +340,16 @@ if test "x$enable_selinux" = "xyes"; then DEFINES="$DEFINES -DMESA_SELINUX" fi +dnl OS-specific libraries +OS_LIBS="" +case "$host_os" in +solaris*) + OS_LIBS="-lc" + if test "x$GXX" != xyes; then + OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS" + fi + ;; +esac dnl dnl Driver configuration. Options are xlib, dri and osmesa right now. @@ -478,7 +503,7 @@ xlib) X11_INCLUDES="$X11_INCLUDES $X_CFLAGS" GL_LIB_DEPS="$X_LIBS -lX11 -lXext" fi - GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread" + GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS" # if static, move the external libraries to the programs # and empty the libraries for libGL @@ -522,11 +547,11 @@ dri) fi # need DRM libs, -lpthread, etc. - GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" + GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS" ;; osmesa) # No libGL for osmesa - GL_LIB_DEPS="" + GL_LIB_DEPS="$OS_LIBS" ;; esac AC_SUBST([GL_LIB_DEPS]) @@ -671,6 +696,13 @@ if test "$mesa_driver" = dri; then unichrome savage sis swrast" fi ;; + solaris*) + DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" + DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" + if test "x$driglx_direct" = xyes; then + DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" + fi + ;; esac # default drivers @@ -750,7 +782,7 @@ AC_SUBST([OSMESA_LIB]) case "$mesa_driver" in osmesa) - # only link librararies with osmesa if shared + # only link libraries with osmesa if shared if test "$enable_static" = no; then OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS" else @@ -761,7 +793,7 @@ osmesa) *) # Link OSMesa to libGL otherwise OSMESA_LIB_DEPS="" - # only link librararies with osmesa if shared + # only link libraries with osmesa if shared if test "$enable_static" = no; then OSMESA_MESA_DEPS='-l$(GL_LIB)' else @@ -769,6 +801,9 @@ osmesa) fi ;; esac +if test "$enable_static" = no; then + OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS" +fi AC_SUBST([OSMESA_LIB_DEPS]) AC_SUBST([OSMESA_MESA_DEPS]) @@ -812,6 +847,9 @@ if test "x$enable_glu" = xyes; then ;; esac fi +if test "$enable_static" = no; then + GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS" +fi AC_SUBST([GLU_LIB_DEPS]) AC_SUBST([GLU_MESA_DEPS]) @@ -841,6 +879,7 @@ if test "x$enable_glw" = xyes; then # If static, empty GLW_LIB_DEPS and add libs for programs to link if test "$enable_static" = no; then GLW_MESA_DEPS='-l$(GL_LIB)' + GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS" else APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS" GLW_LIB_DEPS="" @@ -888,7 +927,7 @@ if test "x$enable_glut" = xyes; then # should check these... GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi" fi - GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm" + GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS" # If glut is available, we can build most programs if test "$with_demos" = yes; then @@ -914,7 +953,14 @@ dnl Only libm is added here if necessary as the libraries should dnl be pulled in by the linker dnl if test "x$APP_LIB_DEPS" = x; then - APP_LIB_DEPS="-lm" + case "$host_os" in + solaris*) + APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm" + ;; + *) + APP_LIB_DEPS="-lm" + ;; + esac fi AC_SUBST([APP_LIB_DEPS]) AC_SUBST([PROGRAM_DIRS]) diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 203479e3267..f126d084064 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -53,6 +53,7 @@ #include #include #include +#include "glheader.h" #include "GL/internal/glcore.h" #include "GL/internal/dri_interface.h" #include "GL/internal/dri_sarea.h" diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 8602d47cf97..f6ae75520c5 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -63,6 +63,12 @@ extern char *program_invocation_name, *program_invocation_short_name; #elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100) # include # define GET_PROGRAM_NAME() getprogname() +#elif defined(__sun) +/* Solaris has getexecname() which returns the full path - return just + the basename to match BSD getprogname() */ +# include +# include +# define GET_PROGRAM_NAME() basename(getexecname()) #endif #if !defined(GET_PROGRAM_NAME) diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index c6f81fdd7e6..533e4a2bd8d 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -76,6 +76,30 @@ # include #endif +/* For platforms that have the C99 standard uint*_t, + but not the commonly used u_int*_t */ +#if defined(__sun) +# define u_int8_t uint8_t +# define u_int16_t uint16_t +# define u_int32_t uint32_t +# define u_int64_t uint64_t +# define u_intptr_t uintptr_t +#endif + +/* Sun compilers define __i386 instead of the gcc-style __i386__ */ +#ifdef __SUNPRO_C +# if !defined(__i386__) && defined(__i386) +# define __i386__ +# elif !defined(__amd64__) && defined(__amd64) +# define __amd64__ +# elif !defined(__sparc__) && defined(__sparc) +# define __sparc__ +# endif +# if !defined(__volatile) +# define __volatile volatile +# endif +#endif + #if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) # define __WIN32__ # define finite _finite @@ -195,6 +219,12 @@ # define INLINE inline #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) # define INLINE __inline +#elif defined(__SUNPRO_C) && defined(__C99FEATURES__) +# define INLINE inline +# define __inline inline +# define __inline__ inline +#elif (__STDC_VERSION__ >= 199901L) /* C99 */ +# define INLINE inline #else # define INLINE #endif @@ -240,12 +270,17 @@ * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. * Don't define it if using a newer Windows compiler. */ -#if defined(__VMS) -# define __FUNCTION__ "VMS$NL:" -#elif __STDC_VERSION__ < 199901L -# if ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ +#ifndef __FUNCTION__ +# if defined(__VMS) +# define __FUNCTION__ "VMS$NL:" +# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ (!defined(_MSC_VER) || _MSC_VER < 1300) -# define __FUNCTION__ "" +# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ + (defined(__SUNPRO_C) && defined(__C99FEATURES__)) +# define __FUNCTION__ __func__ +# else +# define __FUNCTION__ "" +# endif # endif #endif diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 7ee26b423cc..00a18d3f15d 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -165,6 +165,7 @@ typedef union { GLfloat f; GLint i; } fi_type; defined(__mips) || defined(_MIPS_ARCH) || \ defined(__arm__) || \ defined(__sh__) || defined(__m32r__) || \ + (defined(__sun) && defined(_IEEE_754)) || \ (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS))) #define USE_IEEE #define IEEE_ONE 0x3f800000 -- cgit v1.2.3 From 2e922b0e35eda9e0dab9c085bdf83d2a1094dcbb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:24:43 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/ffb/ffb_clear.c | 2 +- src/mesa/drivers/dri/ffb/ffb_linetmp.h | 2 +- src/mesa/drivers/dri/ffb/ffb_pointtmp.h | 2 +- src/mesa/drivers/dri/ffb/ffb_vtxfmt.c | 6 +----- src/mesa/drivers/dri/gamma/gamma_context.h | 2 +- src/mesa/drivers/dri/gamma/gamma_render.c | 4 ++-- src/mesa/drivers/dri/i810/i810ioctl.h | 2 +- src/mesa/drivers/dri/i810/i810state.c | 2 +- src/mesa/drivers/dri/i810/i810texmem.c | 2 +- src/mesa/drivers/dri/i810/i810tris.c | 8 ++++---- 10 files changed, 14 insertions(+), 18 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c index e8dfcbe2543..2aa58360361 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ b/src/mesa/drivers/dri/ffb/ffb_clear.c @@ -79,7 +79,7 @@ struct ff_fixups { /* Compute fixups of non-page aligned areas after a page fill. * Return the number of fixups needed. */ -static __inline__ int +static INLINE int CreatorComputePageFillFixups(struct ff_fixups *fixups, int x, int y, int w, int h, int paligned_x, int paligned_y, diff --git a/src/mesa/drivers/dri/ffb/ffb_linetmp.h b/src/mesa/drivers/dri/ffb/ffb_linetmp.h index 0951513ca12..aea84f5f23f 100644 --- a/src/mesa/drivers/dri/ffb/ffb_linetmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_linetmp.h @@ -1,6 +1,6 @@ /* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_linetmp.h,v 1.2 2002/02/22 21:32:58 dawes Exp $ */ -static __inline void TAG(ffb_line)(GLcontext *ctx, ffb_vertex *v0, +static INLINE void TAG(ffb_line)(GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1 ) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h b/src/mesa/drivers/dri/ffb/ffb_pointtmp.h index 310c95d89bd..c483e205dd1 100644 --- a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_pointtmp.h @@ -1,6 +1,6 @@ /* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_pointtmp.h,v 1.3 2002/02/22 21:32:59 dawes Exp $ */ -static __inline void TAG(ffb_draw_point)(GLcontext *ctx, ffb_vertex *tmp ) +static INLINE void TAG(ffb_draw_point)(GLcontext *ctx, ffb_vertex *tmp ) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); ffb_fbcPtr ffb = fmesa->regs; diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c index 9c1b770fbd1..df0096b18fa 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c +++ b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c @@ -42,10 +42,6 @@ #include "ffb_vtxfmt.h" -#ifndef __GNUC__ -#define __inline /**/ -#endif - #define TNL_VERTEX ffbTnlVertex #define INTERP_RGBA(t, out, a, b) \ @@ -60,7 +56,7 @@ do { \ /* Color functions: */ -static __inline void ffb_recalc_base_color(GLcontext *ctx) +static INLINE void ffb_recalc_base_color(GLcontext *ctx) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); struct gl_light *light; diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h index f0ab1c4f05c..ef7119c2101 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ b/src/mesa/drivers/dri/gamma/gamma_context.h @@ -384,7 +384,7 @@ struct gamma_context { int TextureCount; }; -static __inline GLuint gammaPackColor( GLuint cpp, +static INLINE GLuint gammaPackColor( GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index a8fba499a5a..2bc579c3f90 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -129,13 +129,13 @@ static const GLuint hw_prim[GL_POLYGON+1] = { B_PrimType_Polygon }; -static __inline void gammaStartPrimitive( gammaContextPtr gmesa, GLenum prim ) +static INLINE void gammaStartPrimitive( gammaContextPtr gmesa, GLenum prim ) { CHECK_DMA_BUFFER(gmesa, 1); WRITE(gmesa->buf, Begin, gmesa->Begin | hw_prim[prim]); } -static __inline void gammaEndPrimitive( gammaContextPtr gmesa ) +static INLINE void gammaEndPrimitive( gammaContextPtr gmesa ) { GLcontext *ctx = gmesa->glCtx; diff --git a/src/mesa/drivers/dri/i810/i810ioctl.h b/src/mesa/drivers/dri/i810/i810ioctl.h index 61399ee7b72..eda15adfb6c 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.h +++ b/src/mesa/drivers/dri/i810/i810ioctl.h @@ -34,7 +34,7 @@ do { \ } \ } while (0) -static __inline GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes ) +static INLINE GLuint *i810AllocDmaLow( i810ContextPtr imesa, int bytes ) { if (imesa->vertex_low + bytes > imesa->vertex_high) i810FlushPrimsGetBuffer( imesa ); diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 185c098b5e1..4b3cb873b8c 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -27,7 +27,7 @@ #include "tnl/t_pipeline.h" -static __inline__ GLuint i810PackColor(GLuint format, +static INLINE GLuint i810PackColor(GLuint format, GLubyte r, GLubyte g, GLubyte b, GLubyte a) { diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index 08900cc67d8..9c24fcd8f57 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -64,7 +64,7 @@ void i810DestroyTexObj(i810ContextPtr imesa, i810TextureObjectPtr t) /* From linux kernel i386 header files, copes with odd sizes better * than COPY_DWORDS would: */ -static __inline__ void * __memcpy(void * to, const void * from, size_t n) +static INLINE void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; __asm__ __volatile__( diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c index 2c4ee06633d..f6dd7a4d223 100644 --- a/src/mesa/drivers/dri/i810/i810tris.c +++ b/src/mesa/drivers/dri/i810/i810tris.c @@ -75,7 +75,7 @@ do { \ } while (0) #endif -static __inline__ void i810_draw_triangle( i810ContextPtr imesa, +static INLINE void i810_draw_triangle( i810ContextPtr imesa, i810VertexPtr v0, i810VertexPtr v1, i810VertexPtr v2 ) @@ -90,7 +90,7 @@ static __inline__ void i810_draw_triangle( i810ContextPtr imesa, } -static __inline__ void i810_draw_quad( i810ContextPtr imesa, +static INLINE void i810_draw_quad( i810ContextPtr imesa, i810VertexPtr v0, i810VertexPtr v1, i810VertexPtr v2, @@ -109,7 +109,7 @@ static __inline__ void i810_draw_quad( i810ContextPtr imesa, } -static __inline__ void i810_draw_point( i810ContextPtr imesa, +static INLINE void i810_draw_point( i810ContextPtr imesa, i810VertexPtr tmp ) { GLfloat sz = 0.5 * CLAMP(imesa->glCtx->Point.Size, @@ -133,7 +133,7 @@ static __inline__ void i810_draw_point( i810ContextPtr imesa, } -static __inline__ void i810_draw_line( i810ContextPtr imesa, +static INLINE void i810_draw_line( i810ContextPtr imesa, i810VertexPtr v0, i810VertexPtr v1 ) { -- cgit v1.2.3 From 7899270b9f10b5671e7ea644a66832fe86b5a1a1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:27:36 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/s3v/s3v_context.h | 6 +++--- src/mesa/drivers/dri/s3v/s3v_render.c | 4 ++-- src/mesa/drivers/dri/sis/sis_tris.h | 2 +- src/mesa/drivers/dri/sis/sis_tritmp.h | 2 +- src/mesa/drivers/dri/tdfx/tdfx_context.h | 6 +++--- src/mesa/drivers/dri/trident/trident_state.c | 6 +++--- src/mesa/drivers/dri/unichrome/via_context.c | 2 +- src/mesa/drivers/dri/unichrome/via_ioctl.h | 4 ++-- src/mesa/drivers/dri/unichrome/via_state.c | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h index 6f527f3a834..ed698103fff 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ b/src/mesa/drivers/dri/s3v/s3v_context.h @@ -419,9 +419,9 @@ struct s3v_context { #define S3VIRGEPACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static __inline GLuint s3vPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static INLINE GLuint s3vPackColor( GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a ) { unsigned int ret; DEBUG(("cpp = %i, r=0x%x, g=0x%x, b=0x%x, a=0x%x\n", cpp, r, g, b, a)); diff --git a/src/mesa/drivers/dri/s3v/s3v_render.c b/src/mesa/drivers/dri/s3v/s3v_render.c index 6b86e0e6049..fa3f85e52b3 100644 --- a/src/mesa/drivers/dri/s3v/s3v_render.c +++ b/src/mesa/drivers/dri/s3v/s3v_render.c @@ -66,7 +66,7 @@ static const GLuint hw_prim[GL_POLYGON+1] = { PrimType_Polygon }; -static __inline void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim ) +static INLINE void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim ) { __DRIdrawablePrivate *dPriv = vmesa->driDrawable; @@ -110,7 +110,7 @@ static __inline void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim ) vmesa->restore_primitive = _hw_prim; } -static __inline void s3vEndPrimitive( s3vContextPtr vmesa ) +static INLINE void s3vEndPrimitive( s3vContextPtr vmesa ) { /* GLcontext *ctx = vmesa->glCtx; */ DEBUG(("s3vEndPrimitive\n")); diff --git a/src/mesa/drivers/dri/sis/sis_tris.h b/src/mesa/drivers/dri/sis/sis_tris.h index 5e07acc2118..250949a83ce 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.h +++ b/src/mesa/drivers/dri/sis/sis_tris.h @@ -48,7 +48,7 @@ do { \ sisFlushPrims(smesa); \ } while (0) -static __inline GLuint *sisAllocDmaLow(sisContextPtr smesa, int bytes) +static INLINE GLuint *sisAllocDmaLow(sisContextPtr smesa, int bytes) { GLuint *start; diff --git a/src/mesa/drivers/dri/sis/sis_tritmp.h b/src/mesa/drivers/dri/sis/sis_tritmp.h index e670a5bf760..f75e17318fc 100644 --- a/src/mesa/drivers/dri/sis/sis_tritmp.h +++ b/src/mesa/drivers/dri/sis/sis_tritmp.h @@ -234,7 +234,7 @@ static void TAG(sis6326_draw_point_mmio)(sisContextPtr smesa, char *verts) } #endif -static __inline void TAG(sis_vert_init)( void ) +static INLINE void TAG(sis_vert_init)( void ) { sis_tri_func_mmio[SIS_STATES] = TAG(sis_draw_tri_mmio); sis_line_func_mmio[SIS_STATES] = TAG(sis_draw_line_mmio); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.h b/src/mesa/drivers/dri/tdfx/tdfx_context.h index 89a7a9d6c4e..dc8ece59399 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.h @@ -984,9 +984,9 @@ FX_grColorMaskv_NoLock(GLcontext *ctx, const GLboolean rgba[4]); #define TDFXPACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((b) & 0xf0) << 4) | ((g) & 0xf0) | ((r) >> 4)) -static __inline__ GrColor_t tdfxPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static INLINE GrColor_t tdfxPackColor( GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a ) { switch ( cpp ) { case 2: diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c index 5303bd422ed..cc2e52ab279 100644 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ b/src/mesa/drivers/dri/trident/trident_state.c @@ -51,9 +51,9 @@ #define TRIDENTPACKCOLOR4444(r, g, b, a) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static __inline__ GLuint tridentPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static INLINE GLuint tridentPackColor( GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a ) { switch ( cpp ) { case 2: diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index d9b4f2d112a..ed7001d48df 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -123,7 +123,7 @@ static const GLubyte *viaGetString(GLcontext *ctx, GLenum name) * * \returns A pixel width that meets the alignment requirements. */ -static __inline__ unsigned +static INLINE unsigned buffer_align( unsigned width ) { return (width + 0x0f) & ~0x0f; diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.h b/src/mesa/drivers/dri/unichrome/via_ioctl.h index 44fc439c9fd..14a833a97d0 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.h +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.h @@ -58,7 +58,7 @@ void viaEmitBreadcrumb( struct via_context *vmesa ); void viaWrapPrimitive( struct via_context *vmesa ); -static __inline__ GLuint *viaAllocDma(struct via_context *vmesa, int bytes) +static INLINE GLuint *viaAllocDma(struct via_context *vmesa, int bytes) { if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) { viaFlushDma(vmesa); @@ -72,7 +72,7 @@ static __inline__ GLuint *viaAllocDma(struct via_context *vmesa, int bytes) } -static GLuint __inline__ *viaExtendPrimitive(struct via_context *vmesa, int bytes) +static GLuint INLINE *viaExtendPrimitive(struct via_context *vmesa, int bytes) { if (vmesa->dmaLow + bytes > VIA_DMA_HIGHWATER) { viaWrapPrimitive(vmesa); diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index d2c528923fd..645c58aa401 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -511,9 +511,9 @@ void viaEmitState(struct via_context *vmesa) } -static __inline__ GLuint viaPackColor(GLuint bpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +static INLINE GLuint viaPackColor(GLuint bpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { switch (bpp) { case 16: -- cgit v1.2.3 From 24197b4901c72b3a2c6afcb3f6936e0876853e1d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:30:01 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/mach64/mach64_ioctl.h | 4 ++-- src/mesa/drivers/dri/mach64/mach64_tex.h | 6 +++--- src/mesa/drivers/dri/mach64/mach64_tris.c | 8 ++++---- src/mesa/drivers/dri/mga/mgacontext.h | 6 +++--- src/mesa/drivers/dri/mga/mgaioctl.h | 2 +- src/mesa/drivers/dri/mga/mgatris.c | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.h b/src/mesa/drivers/dri/mach64/mach64_ioctl.h index c28bf31c49f..3e5faff4e62 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.h +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.h @@ -44,7 +44,7 @@ extern void mach64FlushVerticesLocked( mach64ContextPtr mmesa ); extern void mach64FlushDMALocked( mach64ContextPtr mmesa ); extern void mach64UploadHwStateLocked( mach64ContextPtr mmesa ); -static __inline void *mach64AllocDmaLow( mach64ContextPtr mmesa, int bytes ) +static INLINE void *mach64AllocDmaLow( mach64ContextPtr mmesa, int bytes ) { CARD32 *head; @@ -60,7 +60,7 @@ static __inline void *mach64AllocDmaLow( mach64ContextPtr mmesa, int bytes ) return head; } -static __inline void *mach64AllocDmaLocked( mach64ContextPtr mmesa, int bytes ) +static INLINE void *mach64AllocDmaLocked( mach64ContextPtr mmesa, int bytes ) { CARD32 *head; diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.h b/src/mesa/drivers/dri/mach64/mach64_tex.h index f6cf1cf8020..933cfbbab4a 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.h +++ b/src/mesa/drivers/dri/mach64/mach64_tex.h @@ -72,9 +72,9 @@ extern void mach64InitTextureFuncs( struct dd_function_table *functions ); #define MACH64PACKCOLOR4444(r, g, b, a) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static __inline__ GLuint mach64PackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static INLINE GLuint mach64PackColor( GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a ) { switch ( cpp ) { case 2: diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c index 369f6104428..5ce348f34da 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tris.c +++ b/src/mesa/drivers/dri/mach64/mach64_tris.c @@ -113,7 +113,7 @@ do { \ #define COPY_VERTEX_OOA( vb, vertsize, v, n ) DO_COPY_VERTEX( vb, vertsize, v, n, 1 ) -static __inline void mach64_draw_quad( mach64ContextPtr mmesa, +static INLINE void mach64_draw_quad( mach64ContextPtr mmesa, mach64VertexPtr v0, mach64VertexPtr v1, mach64VertexPtr v2, @@ -419,7 +419,7 @@ static __inline void mach64_draw_quad( mach64ContextPtr mmesa, #endif } -static __inline void mach64_draw_triangle( mach64ContextPtr mmesa, +static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa, mach64VertexPtr v0, mach64VertexPtr v1, mach64VertexPtr v2 ) @@ -666,7 +666,7 @@ static __inline void mach64_draw_triangle( mach64ContextPtr mmesa, #endif } -static __inline void mach64_draw_line( mach64ContextPtr mmesa, +static INLINE void mach64_draw_line( mach64ContextPtr mmesa, mach64VertexPtr v0, mach64VertexPtr v1 ) { @@ -955,7 +955,7 @@ static __inline void mach64_draw_line( mach64ContextPtr mmesa, #endif } -static __inline void mach64_draw_point( mach64ContextPtr mmesa, +static INLINE void mach64_draw_point( mach64ContextPtr mmesa, mach64VertexPtr v0 ) { #if MACH64_NATIVE_VTXFMT diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h index 2681976fc2b..55d823810b6 100644 --- a/src/mesa/drivers/dri/mga/mgacontext.h +++ b/src/mesa/drivers/dri/mga/mgacontext.h @@ -329,9 +329,9 @@ extern int MGA_DEBUG; #define DEBUG_VERBOSE_TEXTURE 0x08 #define DEBUG_VERBOSE_FALLBACK 0x10 -static __inline__ GLuint mgaPackColor(GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +static INLINE GLuint mgaPackColor(GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { switch (cpp) { case 2: diff --git a/src/mesa/drivers/dri/mga/mgaioctl.h b/src/mesa/drivers/dri/mga/mgaioctl.h index 0ea0ba1acd4..3a377234e46 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.h +++ b/src/mesa/drivers/dri/mga/mgaioctl.h @@ -62,7 +62,7 @@ void mgaInitIoctlFuncs( struct dd_function_table *functions ); extern drmBufPtr mga_get_buffer_ioctl( mgaContextPtr mmesa ); -static __inline +static INLINE GLuint *mgaAllocDmaLow( mgaContextPtr mmesa, int bytes ) { GLuint *head; diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c index 91b413ae760..9f270d7d6c9 100644 --- a/src/mesa/drivers/dri/mga/mgatris.c +++ b/src/mesa/drivers/dri/mga/mgatris.c @@ -67,7 +67,7 @@ do { \ } while (0) #endif -static void __inline__ mga_draw_triangle( mgaContextPtr mmesa, +static void INLINE mga_draw_triangle( mgaContextPtr mmesa, mgaVertexPtr v0, mgaVertexPtr v1, mgaVertexPtr v2 ) @@ -82,7 +82,7 @@ static void __inline__ mga_draw_triangle( mgaContextPtr mmesa, } -static void __inline__ mga_draw_quad( mgaContextPtr mmesa, +static void INLINE mga_draw_quad( mgaContextPtr mmesa, mgaVertexPtr v0, mgaVertexPtr v1, mgaVertexPtr v2, @@ -101,7 +101,7 @@ static void __inline__ mga_draw_quad( mgaContextPtr mmesa, } -static __inline__ void mga_draw_point( mgaContextPtr mmesa, +static INLINE void mga_draw_point( mgaContextPtr mmesa, mgaVertexPtr tmp ) { const GLfloat sz = 0.5 * CLAMP(mmesa->glCtx->Point.Size, @@ -160,7 +160,7 @@ static __inline__ void mga_draw_point( mgaContextPtr mmesa, } -static __inline__ void mga_draw_line( mgaContextPtr mmesa, +static INLINE void mga_draw_line( mgaContextPtr mmesa, mgaVertexPtr v0, mgaVertexPtr v1 ) { -- cgit v1.2.3 From 055ab81920e7299ec4fce8f9908c88c001050a92 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:34:00 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/savage/savageioctl.h | 14 +++++++------- src/mesa/drivers/dri/savage/savagespan.h | 8 ++++---- src/mesa/drivers/dri/savage/savagestate.c | 2 +- src/mesa/drivers/dri/savage/savagetex.c | 2 +- src/mesa/drivers/dri/savage/savagetris.c | 18 +++++++++--------- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/savage/savageioctl.h b/src/mesa/drivers/dri/savage/savageioctl.h index c7ff0017fde..50dce848a27 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.h +++ b/src/mesa/drivers/dri/savage/savageioctl.h @@ -64,19 +64,19 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv ); extern void savageGetDMABuffer( savageContextPtr imesa ); -static __inline +static INLINE void savageReleaseIndexedVerts( savageContextPtr imesa ) { imesa->firstElt = -1; } -static __inline +static INLINE GLboolean savageHaveIndexedVerts( savageContextPtr imesa ) { return (imesa->firstElt != -1); } -static __inline +static INLINE u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) { struct savage_vtxbuf_t *buffer = imesa->vtxBuf; @@ -115,7 +115,7 @@ u_int32_t *savageAllocVtxBuf( savageContextPtr imesa, GLuint words ) return head; } -static __inline +static INLINE u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) { u_int32_t *ret; @@ -131,7 +131,7 @@ u_int32_t *savageAllocIndexedVerts( savageContextPtr imesa, GLuint n ) * - Actually allocate entries for the indices in the command buffer. * (This allocation must succeed without wrapping the cmd buffer!) */ -static __inline +static INLINE void savageFlushElts( savageContextPtr imesa ) { if (imesa->elts.cmd) { @@ -148,7 +148,7 @@ void savageFlushElts( savageContextPtr imesa ) /* Allocate a command buffer entry with bytes of arguments: * - implies savageFlushElts */ -static __inline +static INLINE drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes ) { drm_savage_cmd_header_t *ret; @@ -171,7 +171,7 @@ drm_savage_cmd_header_t *savageAllocCmdBuf( savageContextPtr imesa, GLuint bytes * incomplete indexed drawing command yet * - increments the number of elts. Final allocation is done in savageFlushElts */ -static __inline +static INLINE u_int16_t *savageAllocElts( savageContextPtr imesa, GLuint n ) { u_int16_t *ret; diff --git a/src/mesa/drivers/dri/savage/savagespan.h b/src/mesa/drivers/dri/savage/savagespan.h index f6a312e820e..53a7f8b97c8 100644 --- a/src/mesa/drivers/dri/savage/savagespan.h +++ b/src/mesa/drivers/dri/savage/savagespan.h @@ -55,7 +55,7 @@ savageSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis, * * Note that there is no encoding for numbers < 2^-16. */ -static __inline GLuint savageEncodeFloat16( GLdouble x ) +static INLINE GLuint savageEncodeFloat16( GLdouble x ) { GLint r = (GLint)(x * 0x10000000); GLint exp = 0; @@ -67,7 +67,7 @@ static __inline GLuint savageEncodeFloat16( GLdouble x ) } return exp > 0xf ? 0xffff : (r - 0x1000) | (exp << 12); } -static __inline GLdouble savageDecodeFloat16( GLuint x ) +static INLINE GLdouble savageDecodeFloat16( GLuint x ) { static const GLdouble pow2[16] = { 1.0/(1<<28), 1.0/(1<<27), 1.0/(1<<26), 1.0/(1<<25), @@ -92,7 +92,7 @@ static __inline GLdouble savageDecodeFloat16( GLuint x ) * * Details analogous to the 16-bit format. */ -static __inline GLuint savageEncodeFloat24( GLdouble x ) +static INLINE GLuint savageEncodeFloat24( GLdouble x ) { int64_t r = (int64_t)(x * ((int64_t)1 << (19+32))); GLint exp = 0; @@ -105,7 +105,7 @@ static __inline GLuint savageEncodeFloat24( GLdouble x ) return exp > 0x1f ? 0xffffff : (r - 0x80000) | (exp << 19); } #define _1 (int64_t)1 -static __inline GLdouble savageDecodeFloat24( GLuint x ) +static INLINE GLdouble savageDecodeFloat24( GLuint x ) { static const GLdouble pow2[32] = { 1.0/(_1<<51), 1.0/(_1<<50), 1.0/(_1<<49), 1.0/(_1<<48), diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 7c36b133a91..c5ef47f2580 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -76,7 +76,7 @@ static void savageBlendFunc_s4(GLcontext *); static void savageBlendFunc_s3d(GLcontext *); -static __inline__ GLuint savagePackColor(GLuint format, +static INLINE GLuint savagePackColor(GLuint format, GLubyte r, GLubyte g, GLubyte b, GLubyte a) { diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 1dcfee291f5..9b81756eb94 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -101,7 +101,7 @@ static const savageTileInfo tileInfo_s3d_s4[5] = { * \param w width in bytes */ #define SUBTILE_FUNC(w,h) \ -static __inline GLubyte *savageUploadSubtile_##w##x##h \ +static INLINE GLubyte *savageUploadSubtile_##w##x##h \ (GLubyte *dest, GLubyte *src, GLuint srcStride) \ { \ GLuint y; \ diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index 4ce2f60b4f3..c67045c8b57 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -95,7 +95,7 @@ do { \ } while (0) #endif -static void __inline__ savage_draw_triangle (savageContextPtr imesa, +static void INLINE savage_draw_triangle (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2) { @@ -108,7 +108,7 @@ static void __inline__ savage_draw_triangle (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 0, v2); } -static void __inline__ savage_draw_quad (savageContextPtr imesa, +static void INLINE savage_draw_quad (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2, @@ -125,7 +125,7 @@ static void __inline__ savage_draw_quad (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 0, v3); } -static __inline__ void savage_draw_point (savageContextPtr imesa, +static INLINE void savage_draw_point (savageContextPtr imesa, savageVertexPtr tmp) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); @@ -161,7 +161,7 @@ static __inline__ void savage_draw_point (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 2, tmp); } -static __inline__ void savage_draw_line (savageContextPtr imesa, +static INLINE void savage_draw_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; @@ -219,7 +219,7 @@ do { \ tmp.f[vertex_size-1] *= rhw; \ } while (0) -static void __inline__ savage_ptex_tri (savageContextPtr imesa, +static void INLINE savage_ptex_tri (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1, savageVertexPtr v2) { @@ -233,7 +233,7 @@ static void __inline__ savage_ptex_tri (savageContextPtr imesa, PTEX_VERTEX (j, tmp, vertsize, 0, v2); EMIT_VERT (j, vb, vertsize, 0, &tmp); } -static __inline__ void savage_ptex_line (savageContextPtr imesa, +static INLINE void savage_ptex_line (savageContextPtr imesa, savageVertexPtr v0, savageVertexPtr v1 ) { GLuint vertsize = imesa->HwVertexSize; @@ -281,7 +281,7 @@ static __inline__ void savage_ptex_line (savageContextPtr imesa, EMIT_VERT (j, vb, vertsize, 2, &tmp1); } -static __inline__ void savage_ptex_point (savageContextPtr imesa, +static INLINE void savage_ptex_point (savageContextPtr imesa, savageVertexPtr v0) { GLuint vertsize = imesa->HwVertexSize; u_int32_t *vb = savageAllocVtxBuf (imesa, 6*vertsize); @@ -934,7 +934,7 @@ do { \ #define SAVAGE_EMIT_ST1 0x0300 -static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) +static INLINE GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); @@ -997,7 +997,7 @@ static __inline__ GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) } -static __inline__ GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) +static INLINE GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) { savageContextPtr imesa = SAVAGE_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); -- cgit v1.2.3 From 5ee7b7912c1fe7b09d13ae385088e4281b62eba6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:34:38 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/nouveau/nouveau_state.c | 6 +++--- src/mesa/drivers/dri/r128/r128_ioctl.h | 2 +- src/mesa/drivers/dri/r128/r128_tex.h | 6 +++--- src/mesa/drivers/dri/r200/r200_context.h | 2 +- src/mesa/drivers/dri/r200/r200_ioctl.h | 6 +++--- src/mesa/drivers/dri/r200/r200_vertprog.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_context.h | 6 +++--- src/mesa/drivers/dri/radeon/radeon_ioctl.h | 6 +++--- 8 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e2f9fb869a1..1eb6069e34c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -38,9 +38,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mtypes.h" #include "colormac.h" -static __inline__ GLuint nouveauPackColor(GLuint format, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +static INLINE GLuint nouveauPackColor(GLuint format, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { switch (format) { case 2: diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.h b/src/mesa/drivers/dri/r128/r128_ioctl.h index 0f9d11fe699..5ed44559a6d 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.h +++ b/src/mesa/drivers/dri/r128/r128_ioctl.h @@ -45,7 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. extern drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa ); extern void r128FlushVerticesLocked( r128ContextPtr rmesa ); -static __inline void *r128AllocDmaLow( r128ContextPtr rmesa, int count, +static INLINE void *r128AllocDmaLow( r128ContextPtr rmesa, int count, int vert_size ) { u_int32_t *head; diff --git a/src/mesa/drivers/dri/r128/r128_tex.h b/src/mesa/drivers/dri/r128/r128_tex.h index 54053b8b315..40168f83bc2 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.h +++ b/src/mesa/drivers/dri/r128/r128_tex.h @@ -68,9 +68,9 @@ extern void r128InitTextureFuncs( struct dd_function_table *functions ); #define R128PACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static __inline__ u_int32_t r128PackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) +static INLINE u_int32_t r128PackColor( GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a ) { switch ( cpp ) { case 2: diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index be73507995b..ee478e7d3c0 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -927,7 +927,7 @@ struct r200_context { #define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx)) -static __inline GLuint r200PackColor( GLuint cpp, +static INLINE GLuint r200PackColor( GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index 4521fbabf1d..31431b7b03d 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -137,7 +137,7 @@ do { \ memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \ rmesa->hw.ATOM.cmd_size * 4) -static __inline int R200_DB_STATECHANGE( +static INLINE int R200_DB_STATECHANGE( r200ContextPtr rmesa, struct r200_state_atom *atom ) { @@ -183,7 +183,7 @@ do { \ * and hang on to the lock until the critical section is finished and we flush * the buffer again and unlock. */ -static __inline void r200EnsureCmdBufSpace( r200ContextPtr rmesa, int bytes ) +static INLINE void r200EnsureCmdBufSpace( r200ContextPtr rmesa, int bytes ) { if (rmesa->store.cmd_used + bytes > R200_CMD_BUF_SZ) r200FlushCmdBuf( rmesa, __FUNCTION__ ); @@ -192,7 +192,7 @@ static __inline void r200EnsureCmdBufSpace( r200ContextPtr rmesa, int bytes ) /* Alloc space in the command buffer */ -static __inline char *r200AllocCmdBuf( r200ContextPtr rmesa, +static INLINE char *r200AllocCmdBuf( r200ContextPtr rmesa, int bytes, const char *where ) { char * head; diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 4be03448592..562992fbb5c 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -154,7 +154,7 @@ static GLboolean r200VertexProgUpdateParams(GLcontext *ctx, struct r200_vertex_p return GL_TRUE; } -static __inline unsigned long t_dst_mask(GLuint mask) +static INLINE unsigned long t_dst_mask(GLuint mask) { /* WRITEMASK_* is equivalent to VSF_FLAG_* */ return mask & VSF_FLAG_ALL; @@ -229,7 +229,7 @@ static unsigned long t_src_class(enum register_file file) } } -static __inline unsigned long t_swizzle(GLubyte swizzle) +static INLINE unsigned long t_swizzle(GLubyte swizzle) { /* this is in fact a NOP as the Mesa SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ return swizzle; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index b4ffde5d540..7c45c37b03e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -705,9 +705,9 @@ struct radeon_context { #define RADEON_CONTEXT(ctx) ((radeonContextPtr)(ctx->DriverCtx)) -static __inline GLuint radeonPackColor(GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +static INLINE GLuint radeonPackColor(GLuint cpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { switch (cpp) { case 2: diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/src/mesa/drivers/dri/radeon/radeon_ioctl.h index b8d68eec867..b3c287fb2bf 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h @@ -124,7 +124,7 @@ do { \ memcpy( rmesa->hw.ATOM.lastcmd, rmesa->hw.ATOM.cmd, \ rmesa->hw.ATOM.cmd_size * 4) -static __inline int RADEON_DB_STATECHANGE( +static INLINE int RADEON_DB_STATECHANGE( radeonContextPtr rmesa, struct radeon_state_atom *atom ) { @@ -177,7 +177,7 @@ do { \ * and hang on to the lock until the critical section is finished and we flush * the buffer again and unlock. */ -static __inline void radeonEnsureCmdBufSpace( radeonContextPtr rmesa, +static INLINE void radeonEnsureCmdBufSpace( radeonContextPtr rmesa, int bytes ) { if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ) @@ -187,7 +187,7 @@ static __inline void radeonEnsureCmdBufSpace( radeonContextPtr rmesa, /* Alloc space in the command buffer */ -static __inline char *radeonAllocCmdBuf( radeonContextPtr rmesa, +static INLINE char *radeonAllocCmdBuf( radeonContextPtr rmesa, int bytes, const char *where ) { if (rmesa->store.cmd_used + bytes > RADEON_CMD_BUF_SZ) -- cgit v1.2.3 From 402e7f76b15e619a83d1d1587d1dd181d313e543 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:49:40 -0600 Subject: #undef DEBUG to silence warnings --- src/mesa/drivers/dri/s3v/s3v_macros.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/s3v/s3v_macros.h b/src/mesa/drivers/dri/s3v/s3v_macros.h index 3bc871b7eaf..7e9b4529df4 100644 --- a/src/mesa/drivers/dri/s3v/s3v_macros.h +++ b/src/mesa/drivers/dri/s3v/s3v_macros.h @@ -19,6 +19,7 @@ #include #endif +#undef DEBUG #if GENERIC_DEBUG #define DEBUG(str) printf str #else -- cgit v1.2.3 From 37f19b94ac31d7a6f77ed9936c28ec8f36983721 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:49:45 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/nouveau/nouveau_shader.h | 6 +++--- src/mesa/drivers/dri/nouveau/nv04_swtcl.c | 16 ++++++++-------- src/mesa/drivers/dri/nouveau/nv10_swtcl.c | 20 ++++++++++---------- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 6 +++--- src/mesa/drivers/dri/r300/r300_context.h | 4 ++-- src/mesa/drivers/dri/r300/r300_emit.h | 20 ++++++++++---------- src/mesa/drivers/dri/r300/r300_fragprog_emit.c | 6 +++--- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- src/mesa/drivers/dri/r300/r500_fragprog_emit.c | 10 +++++----- src/mesa/drivers/dri/swrast/swrast_priv.h | 6 +++--- src/mesa/drivers/dri/swrast/swrast_spantemp.h | 8 ++++---- src/mesa/drivers/dri/trident/trident_context.h | 4 ++-- 14 files changed, 56 insertions(+), 56 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.h b/src/mesa/drivers/dri/nouveau/nouveau_shader.h index 7125a2ae821..636bcaa72b2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_shader.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.h @@ -396,21 +396,21 @@ struct _nvsFunc { int (*GetLoopIncrement) (nvsFunc *); }; -static inline nvsRegister +static INLINE nvsRegister nvsNegate(nvsRegister reg) { reg.negate = !reg.negate; return reg; } -static inline nvsRegister +static INLINE nvsRegister nvsAbs(nvsRegister reg) { reg.abs = 1; return reg; } -static inline nvsRegister +static INLINE nvsRegister nvsSwizzle(nvsRegister reg, nvsSwzComp x, nvsSwzComp y, nvsSwzComp z, nvsSwzComp w) { diff --git a/src/mesa/drivers/dri/nouveau/nv04_swtcl.c b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c index cb072e0bdbc..1b73d0be6fb 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv04_swtcl.c @@ -53,7 +53,7 @@ static void nv04RenderPrimitive( GLcontext *ctx, GLenum prim ); static void nv04ResetLineStipple( GLcontext *ctx ); -static inline void nv04_2triangles(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3,nouveauVertex* v4,nouveauVertex* v5) +static INLINE void nv04_2triangles(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3,nouveauVertex* v4,nouveauVertex* v5) { BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xA),49); OUT_RINGp(v0,8); @@ -65,7 +65,7 @@ static inline void nv04_2triangles(struct nouveau_context *nmesa,nouveauVertex* OUT_RING(0xFEDCBA); } -static inline void nv04_1triangle(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2) +static INLINE void nv04_1triangle(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2) { BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xD),25); OUT_RINGp(v0,8); @@ -74,7 +74,7 @@ static inline void nv04_1triangle(struct nouveau_context *nmesa,nouveauVertex* v OUT_RING(0xFED); } -static inline void nv04_1quad(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3) +static INLINE void nv04_1quad(struct nouveau_context *nmesa,nouveauVertex* v0,nouveauVertex* v1,nouveauVertex* v2,nouveauVertex* v3) { BEGIN_RING_SIZE(NvSub3D,NV04_DX5_TEXTURED_TRIANGLE_TLVERTEX_SX(0xC),33); OUT_RINGp(v0,8); @@ -84,17 +84,17 @@ static inline void nv04_1quad(struct nouveau_context *nmesa,nouveauVertex* v0,no OUT_RING(0xFECEDC); } -static inline void nv04_render_points(GLcontext *ctx,GLuint first,GLuint last) +static INLINE void nv04_render_points(GLcontext *ctx,GLuint first,GLuint last) { WARN_ONCE("Unimplemented\n"); } -static inline void nv04_render_line(GLcontext *ctx,GLuint v1,GLuint v2) +static INLINE void nv04_render_line(GLcontext *ctx,GLuint v1,GLuint v2) { WARN_ONCE("Unimplemented\n"); } -static inline void nv04_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3) +static INLINE void nv04_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLubyte *vertptr = (GLubyte *)nmesa->verts; @@ -107,7 +107,7 @@ static inline void nv04_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuin ); } -static inline void nv04_render_quad(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3,GLuint v4) +static INLINE void nv04_render_quad(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3,GLuint v4) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLubyte *vertptr = (GLubyte *)nmesa->verts; @@ -465,7 +465,7 @@ static void nv04ChooseRenderState(GLcontext *ctx) -static inline void nv04OutputVertexFormat(struct nouveau_context* nmesa) +static INLINE void nv04OutputVertexFormat(struct nouveau_context* nmesa) { GLcontext* ctx=nmesa->glCtx; DECLARE_RENDERINPUTS(index); diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c index 42b3d666fb9..a55d597ab42 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c @@ -100,7 +100,7 @@ static const int default_attr_size[8]={3,3,3,4,3,1,4,4}; #endif -static inline void nv10StartPrimitive(struct nouveau_context* nmesa,GLuint primitive,GLuint size) +static INLINE void nv10StartPrimitive(struct nouveau_context* nmesa,GLuint primitive,GLuint size) { if ((nmesa->screen->card->type>=NV_10) && (nmesa->screen->card->type<=NV_17)) BEGIN_RING_SIZE(NvSub3D,NV10_TCL_PRIMITIVE_3D_BEGIN_END,1); @@ -131,7 +131,7 @@ void nv10FinishPrimitive(struct nouveau_context *nmesa) } -static inline void nv10ExtendPrimitive(struct nouveau_context* nmesa, int size) +static INLINE void nv10ExtendPrimitive(struct nouveau_context* nmesa, int size) { /* make sure there's enough room. if not, wait */ if (RING_AVAILABLE()verts; @@ -230,7 +230,7 @@ static void (*nv10_render_tab_verts[GL_POLYGON+2])(GLcontext *, }; -static inline void nv10_render_generic_primitive_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags,GLuint prim) +static INLINE void nv10_render_generic_primitive_elts(GLcontext *ctx,GLuint start,GLuint count,GLuint flags,GLuint prim) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLfloat *vertptr = (GLfloat *)nmesa->verts; @@ -332,7 +332,7 @@ do { \ nmesa->vertex_attr_count++; \ } while (0) -static inline void nv10_render_point(GLcontext *ctx, GLfloat *vertptr) +static INLINE void nv10_render_point(GLcontext *ctx, GLfloat *vertptr) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLuint vertsize = nmesa->vertex_size; @@ -344,7 +344,7 @@ static inline void nv10_render_point(GLcontext *ctx, GLfloat *vertptr) nv10FinishPrimitive(nmesa); } -static inline void nv10_render_points(GLcontext *ctx,GLuint first,GLuint last) +static INLINE void nv10_render_points(GLcontext *ctx,GLuint first,GLuint last) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); @@ -364,7 +364,7 @@ static inline void nv10_render_points(GLcontext *ctx,GLuint first,GLuint last) } } -static inline void nv10_render_line(GLcontext *ctx,GLuint v1,GLuint v2) +static INLINE void nv10_render_line(GLcontext *ctx,GLuint v1,GLuint v2) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLfloat *vertptr = (GLfloat *)nmesa->verts; @@ -378,7 +378,7 @@ static inline void nv10_render_line(GLcontext *ctx,GLuint v1,GLuint v2) nv10FinishPrimitive(nmesa); } -static inline void nv10_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3) +static INLINE void nv10_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLfloat *vertptr = (GLfloat *)nmesa->verts; @@ -393,7 +393,7 @@ static inline void nv10_render_triangle(GLcontext *ctx,GLuint v1,GLuint v2,GLuin nv10FinishPrimitive(nmesa); } -static inline void nv10_render_quad(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3,GLuint v4) +static INLINE void nv10_render_quad(GLcontext *ctx,GLuint v1,GLuint v2,GLuint v3,GLuint v4) { struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx); GLfloat *vertptr = (GLfloat *)nmesa->verts; @@ -428,7 +428,7 @@ static void nv10ChooseRenderState(GLcontext *ctx) -static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa) +static INLINE void nv10OutputVertexFormat(struct nouveau_context* nmesa) { GLcontext* ctx=nmesa->glCtx; TNLcontext *tnl = TNL_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 8d4d604ba96..d378045b983 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -150,7 +150,7 @@ static void r300PrintStateAtom(r300ContextPtr r300, struct r300_state_atom *stat * The caller must have ensured that there is enough space in the command * buffer. */ -static inline void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) +static INLINE void r300EmitAtoms(r300ContextPtr r300, GLboolean dirty) { struct r300_state_atom *atom; uint32_t *dest; diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index acb6e38c6df..a8eaa580bd9 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -52,7 +52,7 @@ extern void r300DestroyCmdBuf(r300ContextPtr r300); * * \param dwords The number of dwords we need to be free on the command buffer */ -static inline void r300EnsureCmdBufSpace(r300ContextPtr r300, +static INLINE void r300EnsureCmdBufSpace(r300ContextPtr r300, int dwords, const char *caller) { assert(dwords < r300->cmdbuf.size); @@ -68,7 +68,7 @@ static inline void r300EnsureCmdBufSpace(r300ContextPtr r300, * causes state reemission after a flush. This is necessary to ensure * correct hardware state after an unlock. */ -static inline uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, +static INLINE uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, int dwords, const char *caller) { uint32_t *ptr; @@ -80,7 +80,7 @@ static inline uint32_t *r300RawAllocCmdBuf(r300ContextPtr r300, return ptr; } -static inline uint32_t *r300AllocCmdBuf(r300ContextPtr r300, +static INLINE uint32_t *r300AllocCmdBuf(r300ContextPtr r300, int dwords, const char *caller) { uint32_t *ptr; diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 6279a67ab16..285b2ad6fd6 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -78,7 +78,7 @@ typedef struct r300_context *r300ContextPtr; /** * This function takes a float and packs it into a uint32_t */ -static inline uint32_t r300PackFloat32(float fl) +static INLINE uint32_t r300PackFloat32(float fl) { union { float fl; @@ -95,7 +95,7 @@ static inline uint32_t r300PackFloat32(float fl) * But it works for most things. I'll fix it later if someone * else with a better clue doesn't */ -static inline uint32_t r300PackFloat24(float f) +static INLINE uint32_t r300PackFloat24(float f) { float mantissa; int exponent; diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index e6a6df8c4c2..5950539cba4 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -50,7 +50,7 @@ #define CP_PACKET3( pkt, n ) \ (RADEON_CP_PACKET3 | (pkt) | ((n) << 16)) -static inline uint32_t cmdpacket0(int reg, int count) +static INLINE uint32_t cmdpacket0(int reg, int count) { drm_r300_cmd_header_t cmd; @@ -62,7 +62,7 @@ static inline uint32_t cmdpacket0(int reg, int count) return cmd.u; } -static inline uint32_t cmdvpu(int addr, int count) +static INLINE uint32_t cmdvpu(int addr, int count) { drm_r300_cmd_header_t cmd; @@ -74,7 +74,7 @@ static inline uint32_t cmdvpu(int addr, int count) return cmd.u; } -static inline uint32_t cmdr500fp(int addr, int count, int type, int clamp) +static INLINE uint32_t cmdr500fp(int addr, int count, int type, int clamp) { drm_r300_cmd_header_t cmd; @@ -88,7 +88,7 @@ static inline uint32_t cmdr500fp(int addr, int count, int type, int clamp) return cmd.u; } -static inline uint32_t cmdpacket3(int packet) +static INLINE uint32_t cmdpacket3(int packet) { drm_r300_cmd_header_t cmd; @@ -98,7 +98,7 @@ static inline uint32_t cmdpacket3(int packet) return cmd.u; } -static inline uint32_t cmdcpdelay(unsigned short count) +static INLINE uint32_t cmdcpdelay(unsigned short count) { drm_r300_cmd_header_t cmd; @@ -108,7 +108,7 @@ static inline uint32_t cmdcpdelay(unsigned short count) return cmd.u; } -static inline uint32_t cmdwait(unsigned char flags) +static INLINE uint32_t cmdwait(unsigned char flags) { drm_r300_cmd_header_t cmd; @@ -118,7 +118,7 @@ static inline uint32_t cmdwait(unsigned char flags) return cmd.u; } -static inline uint32_t cmdpacify(void) +static INLINE uint32_t cmdpacify(void) { drm_r300_cmd_header_t cmd; @@ -218,7 +218,7 @@ static inline uint32_t cmdpacify(void) /** * Must be sent to switch to 2d commands */ -void static inline end_3d(r300ContextPtr rmesa) +void static INLINE end_3d(r300ContextPtr rmesa) { drm_radeon_cmd_header_t *cmd = NULL; @@ -227,7 +227,7 @@ void static inline end_3d(r300ContextPtr rmesa) cmd[0].header.cmd_type = R300_CMD_END3D; } -void static inline cp_delay(r300ContextPtr rmesa, unsigned short count) +void static INLINE cp_delay(r300ContextPtr rmesa, unsigned short count) { drm_radeon_cmd_header_t *cmd = NULL; @@ -236,7 +236,7 @@ void static inline cp_delay(r300ContextPtr rmesa, unsigned short count) cmd[0].i = cmdcpdelay(count); } -void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) +void static INLINE cp_wait(r300ContextPtr rmesa, unsigned char flags) { drm_radeon_cmd_header_t *cmd = NULL; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/r300_fragprog_emit.c index 9ba29feb40b..d72b92832c9 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_emit.c @@ -584,7 +584,7 @@ static GLuint emit_const4fv(struct r300_pfs_compile_state *cs, return reg; } -static inline GLuint negate(GLuint r) +static INLINE GLuint negate(GLuint r) { REG_NEGS(r); REG_NEGV(r); @@ -594,13 +594,13 @@ static inline GLuint negate(GLuint r) /* Hack, to prevent clobbering sources used multiple times when * emulating non-native instructions */ -static inline GLuint keep(GLuint r) +static INLINE GLuint keep(GLuint r) { REG_SET_NO_USE(r, GL_TRUE); return r; } -static inline GLuint absolute(GLuint r) +static INLINE GLuint absolute(GLuint r) { REG_ABS(r); return r; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 55d3d55e900..b1284647da1 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1853,7 +1853,7 @@ static void r500SetupRSUnit(GLcontext * ctx) if(_nc>_p->vpu.count)_p->vpu.count=_nc;\ }while(0) -static inline void r300SetupVertexProgramFragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) +static INLINE void r300SetupVertexProgramFragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf) { int i; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 861f0427cf5..c4e325e6a76 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -186,7 +186,7 @@ static unsigned long t_src_class(enum register_file file) } } -static inline unsigned long t_swizzle(GLubyte swizzle) +static INLINE unsigned long t_swizzle(GLubyte swizzle) { /* this is in fact a NOP as the Mesa SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ return swizzle; diff --git a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c index e1ad342690b..3dc72af87ab 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog_emit.c @@ -201,7 +201,7 @@ static const GLfloat LIT[] = {127.999999, 127.999999, -127.999999}; -static inline GLuint make_rgb_swizzle(struct prog_src_register src) { +static INLINE GLuint make_rgb_swizzle(struct prog_src_register src) { GLuint swiz = 0x0; GLuint temp; /* This could be optimized, but it should be plenty fast already. */ @@ -217,7 +217,7 @@ static inline GLuint make_rgb_swizzle(struct prog_src_register src) { return swiz; } -static inline GLuint make_rgba_swizzle(GLuint src) { +static INLINE GLuint make_rgba_swizzle(GLuint src) { GLuint swiz = 0x0; GLuint temp; int i; @@ -230,7 +230,7 @@ static inline GLuint make_rgba_swizzle(GLuint src) { return swiz; } -static inline GLuint make_alpha_swizzle(struct prog_src_register src) { +static INLINE GLuint make_alpha_swizzle(struct prog_src_register src) { GLuint swiz = GET_SWZ(src.Swizzle, 3); if (swiz == 5) swiz++; @@ -241,14 +241,14 @@ static inline GLuint make_alpha_swizzle(struct prog_src_register src) { return swiz; } -static inline GLuint make_sop_swizzle(struct prog_src_register src) { +static INLINE GLuint make_sop_swizzle(struct prog_src_register src) { GLuint swiz = GET_SWZ(src.Swizzle, 0); if (swiz == 5) swiz++; return swiz; } -static inline GLuint make_strq_swizzle(struct prog_src_register src) { +static INLINE GLuint make_strq_swizzle(struct prog_src_register src) { GLuint swiz = 0x0, temp = 0x0; int i; for (i = 0; i < 4; i++) { diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index a3e3922f128..a614823aa04 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -92,19 +92,19 @@ struct swrast_renderbuffer { GLuint pitch; }; -static inline __DRIcontext * +static INLINE __DRIcontext * swrast_context(GLcontext *ctx) { return (__DRIcontext *) ctx; } -static inline __DRIdrawable * +static INLINE __DRIdrawable * swrast_drawable(GLframebuffer *fb) { return (__DRIdrawable *) fb; } -static inline struct swrast_renderbuffer * +static INLINE struct swrast_renderbuffer * swrast_renderbuffer(struct gl_renderbuffer *rb) { return (struct swrast_renderbuffer *) rb; diff --git a/src/mesa/drivers/dri/swrast/swrast_spantemp.h b/src/mesa/drivers/dri/swrast/swrast_spantemp.h index e7a9c86d7de..187a240ea2f 100644 --- a/src/mesa/drivers/dri/swrast/swrast_spantemp.h +++ b/src/mesa/drivers/dri/swrast/swrast_spantemp.h @@ -36,7 +36,7 @@ #ifndef _SWRAST_SPANTEMP_ONCE #define _SWRAST_SPANTEMP_ONCE -static inline void +static INLINE void PUT_PIXEL( GLcontext *glCtx, GLint x, GLint y, GLubyte *p ) { __DRIcontext *ctx = swrast_context(glCtx); @@ -50,7 +50,7 @@ PUT_PIXEL( GLcontext *glCtx, GLint x, GLint y, GLubyte *p ) } -static inline void +static INLINE void GET_PIXEL( GLcontext *glCtx, GLint x, GLint y, GLubyte *p ) { __DRIcontext *ctx = swrast_context(glCtx); @@ -62,7 +62,7 @@ GET_PIXEL( GLcontext *glCtx, GLint x, GLint y, GLubyte *p ) read->loaderPrivate); } -static inline void +static INLINE void PUT_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) { __DRIcontext *ctx = swrast_context(glCtx); @@ -75,7 +75,7 @@ PUT_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) draw->loaderPrivate); } -static inline void +static INLINE void GET_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) { __DRIcontext *ctx = swrast_context(glCtx); diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h index 1d3ca84400d..82b53df884b 100644 --- a/src/mesa/drivers/dri/trident/trident_context.h +++ b/src/mesa/drivers/dri/trident/trident_context.h @@ -54,14 +54,14 @@ #undef TAG /* these require that base be dword-aligned */ -static inline void MMIO_OUT32(unsigned char *base, unsigned int offset, +static INLINE void MMIO_OUT32(unsigned char *base, unsigned int offset, unsigned int val) { unsigned int *addr = (unsigned int *)(base + offset); *addr = val; } -static inline unsigned int MMIO_IN32(unsigned char *base, unsigned int offset) +static INLINE unsigned int MMIO_IN32(unsigned char *base, unsigned int offset) { unsigned int *addr = (unsigned int *)(base + offset); return *addr; -- cgit v1.2.3 From cc96d5492038cb79806031e513365e08647d6bfa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:52:32 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/i965/brw_context.h | 2 +- src/mesa/drivers/dri/i965/brw_eu.h | 126 ++++++++++++++++---------------- src/mesa/drivers/dri/i965/brw_wm_emit.c | 2 +- 3 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index bef425f2da1..32e05542e0d 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -685,7 +685,7 @@ void brw_upload_constant_buffer_state(struct brw_context *brw); * Inline conversion functions. These are better-typed than the * macros used previously: */ -static inline struct brw_context * +static INLINE struct brw_context * brw_context( GLcontext *ctx ) { return (struct brw_context *)ctx; diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index c138d15fe82..207b8b7ca38 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -110,7 +110,7 @@ struct brw_compile { -static __inline int type_sz( GLuint type ) +static INLINE int type_sz( GLuint type ) { switch( type ) { case BRW_REGISTER_TYPE_UD: @@ -129,7 +129,7 @@ static __inline int type_sz( GLuint type ) } } -static __inline struct brw_reg brw_reg( GLuint file, +static INLINE struct brw_reg brw_reg( GLuint file, GLuint nr, GLuint subnr, GLuint type, @@ -166,7 +166,7 @@ static __inline struct brw_reg brw_reg( GLuint file, return reg; } -static __inline struct brw_reg brw_vec16_reg( GLuint file, +static INLINE struct brw_reg brw_vec16_reg( GLuint file, GLuint nr, GLuint subnr ) { @@ -181,7 +181,7 @@ static __inline struct brw_reg brw_vec16_reg( GLuint file, WRITEMASK_XYZW); } -static __inline struct brw_reg brw_vec8_reg( GLuint file, +static INLINE struct brw_reg brw_vec8_reg( GLuint file, GLuint nr, GLuint subnr ) { @@ -197,7 +197,7 @@ static __inline struct brw_reg brw_vec8_reg( GLuint file, } -static __inline struct brw_reg brw_vec4_reg( GLuint file, +static INLINE struct brw_reg brw_vec4_reg( GLuint file, GLuint nr, GLuint subnr ) { @@ -213,7 +213,7 @@ static __inline struct brw_reg brw_vec4_reg( GLuint file, } -static __inline struct brw_reg brw_vec2_reg( GLuint file, +static INLINE struct brw_reg brw_vec2_reg( GLuint file, GLuint nr, GLuint subnr ) { @@ -228,7 +228,7 @@ static __inline struct brw_reg brw_vec2_reg( GLuint file, WRITEMASK_XY); } -static __inline struct brw_reg brw_vec1_reg( GLuint file, +static INLINE struct brw_reg brw_vec1_reg( GLuint file, GLuint nr, GLuint subnr ) { @@ -244,14 +244,14 @@ static __inline struct brw_reg brw_vec1_reg( GLuint file, } -static __inline struct brw_reg retype( struct brw_reg reg, +static INLINE struct brw_reg retype( struct brw_reg reg, GLuint type ) { reg.type = type; return reg; } -static __inline struct brw_reg suboffset( struct brw_reg reg, +static INLINE struct brw_reg suboffset( struct brw_reg reg, GLuint delta ) { reg.subnr += delta * type_sz(reg.type); @@ -259,7 +259,7 @@ static __inline struct brw_reg suboffset( struct brw_reg reg, } -static __inline struct brw_reg offset( struct brw_reg reg, +static INLINE struct brw_reg offset( struct brw_reg reg, GLuint delta ) { reg.nr += delta; @@ -267,7 +267,7 @@ static __inline struct brw_reg offset( struct brw_reg reg, } -static __inline struct brw_reg byte_offset( struct brw_reg reg, +static INLINE struct brw_reg byte_offset( struct brw_reg reg, GLuint bytes ) { GLuint newoffset = reg.nr * REG_SIZE + reg.subnr + bytes; @@ -277,28 +277,28 @@ static __inline struct brw_reg byte_offset( struct brw_reg reg, } -static __inline struct brw_reg brw_uw16_reg( GLuint file, +static INLINE struct brw_reg brw_uw16_reg( GLuint file, GLuint nr, GLuint subnr ) { return suboffset(retype(brw_vec16_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr); } -static __inline struct brw_reg brw_uw8_reg( GLuint file, +static INLINE struct brw_reg brw_uw8_reg( GLuint file, GLuint nr, GLuint subnr ) { return suboffset(retype(brw_vec8_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr); } -static __inline struct brw_reg brw_uw1_reg( GLuint file, +static INLINE struct brw_reg brw_uw1_reg( GLuint file, GLuint nr, GLuint subnr ) { return suboffset(retype(brw_vec1_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr); } -static __inline struct brw_reg brw_imm_reg( GLuint type ) +static INLINE struct brw_reg brw_imm_reg( GLuint type ) { return brw_reg( BRW_IMMEDIATE_VALUE, 0, @@ -311,35 +311,35 @@ static __inline struct brw_reg brw_imm_reg( GLuint type ) 0); } -static __inline struct brw_reg brw_imm_f( GLfloat f ) +static INLINE struct brw_reg brw_imm_f( GLfloat f ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_F); imm.dw1.f = f; return imm; } -static __inline struct brw_reg brw_imm_d( GLint d ) +static INLINE struct brw_reg brw_imm_d( GLint d ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_D); imm.dw1.d = d; return imm; } -static __inline struct brw_reg brw_imm_ud( GLuint ud ) +static INLINE struct brw_reg brw_imm_ud( GLuint ud ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UD); imm.dw1.ud = ud; return imm; } -static __inline struct brw_reg brw_imm_uw( GLushort uw ) +static INLINE struct brw_reg brw_imm_uw( GLushort uw ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_UW); imm.dw1.ud = uw | (uw << 16); return imm; } -static __inline struct brw_reg brw_imm_w( GLshort w ) +static INLINE struct brw_reg brw_imm_w( GLshort w ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_W); imm.dw1.d = w | (w << 16); @@ -352,7 +352,7 @@ static __inline struct brw_reg brw_imm_w( GLshort w ) /* Vector of eight signed half-byte values: */ -static __inline struct brw_reg brw_imm_v( GLuint v ) +static INLINE struct brw_reg brw_imm_v( GLuint v ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_V); imm.vstride = BRW_VERTICAL_STRIDE_0; @@ -364,7 +364,7 @@ static __inline struct brw_reg brw_imm_v( GLuint v ) /* Vector of four 8-bit float values: */ -static __inline struct brw_reg brw_imm_vf( GLuint v ) +static INLINE struct brw_reg brw_imm_vf( GLuint v ) { struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_VF); imm.vstride = BRW_VERTICAL_STRIDE_0; @@ -378,7 +378,7 @@ static __inline struct brw_reg brw_imm_vf( GLuint v ) #define VF_ONE 0x30 #define VF_NEG (1<<7) -static __inline struct brw_reg brw_imm_vf4( GLuint v0, +static INLINE struct brw_reg brw_imm_vf4( GLuint v0, GLuint v1, GLuint v2, GLuint v3) @@ -395,51 +395,51 @@ static __inline struct brw_reg brw_imm_vf4( GLuint v0, } -static __inline struct brw_reg brw_address( struct brw_reg reg ) +static INLINE struct brw_reg brw_address( struct brw_reg reg ) { return brw_imm_uw(reg.nr * REG_SIZE + reg.subnr); } -static __inline struct brw_reg brw_vec1_grf( GLuint nr, +static INLINE struct brw_reg brw_vec1_grf( GLuint nr, GLuint subnr ) { return brw_vec1_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr); } -static __inline struct brw_reg brw_vec8_grf( GLuint nr, +static INLINE struct brw_reg brw_vec8_grf( GLuint nr, GLuint subnr ) { return brw_vec8_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr); } -static __inline struct brw_reg brw_vec4_grf( GLuint nr, +static INLINE struct brw_reg brw_vec4_grf( GLuint nr, GLuint subnr ) { return brw_vec4_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr); } -static __inline struct brw_reg brw_vec2_grf( GLuint nr, +static INLINE struct brw_reg brw_vec2_grf( GLuint nr, GLuint subnr ) { return brw_vec2_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr); } -static __inline struct brw_reg brw_uw8_grf( GLuint nr, +static INLINE struct brw_reg brw_uw8_grf( GLuint nr, GLuint subnr ) { return brw_uw8_reg(BRW_GENERAL_REGISTER_FILE, nr, subnr); } -static __inline struct brw_reg brw_null_reg( void ) +static INLINE struct brw_reg brw_null_reg( void ) { return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_NULL, 0); } -static __inline struct brw_reg brw_address_reg( GLuint subnr ) +static INLINE struct brw_reg brw_address_reg( GLuint subnr ) { return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_ADDRESS, @@ -450,7 +450,7 @@ static __inline struct brw_reg brw_address_reg( GLuint subnr ) * aren't xyzw. This goes against the convention for other scalar * regs: */ -static __inline struct brw_reg brw_ip_reg( void ) +static INLINE struct brw_reg brw_ip_reg( void ) { return brw_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_IP, @@ -463,7 +463,7 @@ static __inline struct brw_reg brw_ip_reg( void ) WRITEMASK_XYZW); /* NOTE! */ } -static __inline struct brw_reg brw_acc_reg( void ) +static INLINE struct brw_reg brw_acc_reg( void ) { return brw_vec8_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_ACCUMULATOR, @@ -471,7 +471,7 @@ static __inline struct brw_reg brw_acc_reg( void ) } -static __inline struct brw_reg brw_flag_reg( void ) +static INLINE struct brw_reg brw_flag_reg( void ) { return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_FLAG, @@ -479,14 +479,14 @@ static __inline struct brw_reg brw_flag_reg( void ) } -static __inline struct brw_reg brw_mask_reg( GLuint subnr ) +static INLINE struct brw_reg brw_mask_reg( GLuint subnr ) { return brw_uw1_reg(BRW_ARCHITECTURE_REGISTER_FILE, BRW_ARF_MASK, subnr); } -static __inline struct brw_reg brw_message_reg( GLuint nr ) +static INLINE struct brw_reg brw_message_reg( GLuint nr ) { return brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE, nr, @@ -499,7 +499,7 @@ static __inline struct brw_reg brw_message_reg( GLuint nr ) /* This is almost always called with a numeric constant argument, so * make things easy to evaluate at compile time: */ -static __inline GLuint cvt( GLuint val ) +static INLINE GLuint cvt( GLuint val ) { switch (val) { case 0: return 0; @@ -513,7 +513,7 @@ static __inline GLuint cvt( GLuint val ) return 0; } -static __inline struct brw_reg stride( struct brw_reg reg, +static INLINE struct brw_reg stride( struct brw_reg reg, GLuint vstride, GLuint width, GLuint hstride ) @@ -525,43 +525,43 @@ static __inline struct brw_reg stride( struct brw_reg reg, return reg; } -static __inline struct brw_reg vec16( struct brw_reg reg ) +static INLINE struct brw_reg vec16( struct brw_reg reg ) { return stride(reg, 16,16,1); } -static __inline struct brw_reg vec8( struct brw_reg reg ) +static INLINE struct brw_reg vec8( struct brw_reg reg ) { return stride(reg, 8,8,1); } -static __inline struct brw_reg vec4( struct brw_reg reg ) +static INLINE struct brw_reg vec4( struct brw_reg reg ) { return stride(reg, 4,4,1); } -static __inline struct brw_reg vec2( struct brw_reg reg ) +static INLINE struct brw_reg vec2( struct brw_reg reg ) { return stride(reg, 2,2,1); } -static __inline struct brw_reg vec1( struct brw_reg reg ) +static INLINE struct brw_reg vec1( struct brw_reg reg ) { return stride(reg, 0,1,0); } -static __inline struct brw_reg get_element( struct brw_reg reg, GLuint elt ) +static INLINE struct brw_reg get_element( struct brw_reg reg, GLuint elt ) { return vec1(suboffset(reg, elt)); } -static __inline struct brw_reg get_element_ud( struct brw_reg reg, GLuint elt ) +static INLINE struct brw_reg get_element_ud( struct brw_reg reg, GLuint elt ) { return vec1(suboffset(retype(reg, BRW_REGISTER_TYPE_UD), elt)); } -static __inline struct brw_reg brw_swizzle( struct brw_reg reg, +static INLINE struct brw_reg brw_swizzle( struct brw_reg reg, GLuint x, GLuint y, GLuint z, @@ -575,33 +575,33 @@ static __inline struct brw_reg brw_swizzle( struct brw_reg reg, } -static __inline struct brw_reg brw_swizzle1( struct brw_reg reg, +static INLINE struct brw_reg brw_swizzle1( struct brw_reg reg, GLuint x ) { return brw_swizzle(reg, x, x, x, x); } -static __inline struct brw_reg brw_writemask( struct brw_reg reg, +static INLINE struct brw_reg brw_writemask( struct brw_reg reg, GLuint mask ) { reg.dw1.bits.writemask &= mask; return reg; } -static __inline struct brw_reg brw_set_writemask( struct brw_reg reg, +static INLINE struct brw_reg brw_set_writemask( struct brw_reg reg, GLuint mask ) { reg.dw1.bits.writemask = mask; return reg; } -static __inline struct brw_reg negate( struct brw_reg reg ) +static INLINE struct brw_reg negate( struct brw_reg reg ) { reg.negate ^= 1; return reg; } -static __inline struct brw_reg brw_abs( struct brw_reg reg ) +static INLINE struct brw_reg brw_abs( struct brw_reg reg ) { reg.abs = 1; return reg; @@ -609,7 +609,7 @@ static __inline struct brw_reg brw_abs( struct brw_reg reg ) /*********************************************************************** */ -static __inline struct brw_reg brw_vec4_indirect( GLuint subnr, +static INLINE struct brw_reg brw_vec4_indirect( GLuint subnr, GLint offset ) { struct brw_reg reg = brw_vec4_grf(0, 0); @@ -619,7 +619,7 @@ static __inline struct brw_reg brw_vec4_indirect( GLuint subnr, return reg; } -static __inline struct brw_reg brw_vec1_indirect( GLuint subnr, +static INLINE struct brw_reg brw_vec1_indirect( GLuint subnr, GLint offset ) { struct brw_reg reg = brw_vec1_grf(0, 0); @@ -629,48 +629,48 @@ static __inline struct brw_reg brw_vec1_indirect( GLuint subnr, return reg; } -static __inline struct brw_reg deref_4f(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_4f(struct brw_indirect ptr, GLint offset) { return brw_vec4_indirect(ptr.addr_subnr, ptr.addr_offset + offset); } -static __inline struct brw_reg deref_1f(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_1f(struct brw_indirect ptr, GLint offset) { return brw_vec1_indirect(ptr.addr_subnr, ptr.addr_offset + offset); } -static __inline struct brw_reg deref_4b(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_4b(struct brw_indirect ptr, GLint offset) { return retype(deref_4f(ptr, offset), BRW_REGISTER_TYPE_B); } -static __inline struct brw_reg deref_1uw(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_1uw(struct brw_indirect ptr, GLint offset) { return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_UW); } -static __inline struct brw_reg deref_1d(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_1d(struct brw_indirect ptr, GLint offset) { return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_D); } -static __inline struct brw_reg deref_1ud(struct brw_indirect ptr, GLint offset) +static INLINE struct brw_reg deref_1ud(struct brw_indirect ptr, GLint offset) { return retype(deref_1f(ptr, offset), BRW_REGISTER_TYPE_UD); } -static __inline struct brw_reg get_addr_reg(struct brw_indirect ptr) +static INLINE struct brw_reg get_addr_reg(struct brw_indirect ptr) { return brw_address_reg(ptr.addr_subnr); } -static __inline struct brw_indirect brw_indirect_offset( struct brw_indirect ptr, GLint offset ) +static INLINE struct brw_indirect brw_indirect_offset( struct brw_indirect ptr, GLint offset ) { ptr.addr_offset += offset; return ptr; } -static __inline struct brw_indirect brw_indirect( GLuint addr_subnr, GLint offset ) +static INLINE struct brw_indirect brw_indirect( GLuint addr_subnr, GLint offset ) { struct brw_indirect ptr; ptr.addr_subnr = addr_subnr; @@ -679,7 +679,7 @@ static __inline struct brw_indirect brw_indirect( GLuint addr_subnr, GLint offse return ptr; } -static __inline struct brw_instruction *current_insn( struct brw_compile *p) +static INLINE struct brw_instruction *current_insn( struct brw_compile *p) { return &p->store[p->nr_insn]; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 4cda55914ce..ba9168b6efc 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -39,7 +39,7 @@ /* Not quite sure how correct this is - need to understand horiz * vs. vertical strides a little better. */ -static __inline struct brw_reg sechalf( struct brw_reg reg ) +static INLINE struct brw_reg sechalf( struct brw_reg reg ) { if (reg.vstride) reg.nr++; -- cgit v1.2.3 From ba97ed2b743ba0b6631e0fbcf2ab12afe885f87c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:52:40 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/intel/intel_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 1348b0adcf0..df79ab88977 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -328,7 +328,7 @@ do { \ * XXX Put this in src/mesa/main/imports.h ??? */ #if defined(i386) || defined(__i386__) -static inline void * __memcpy(void * to, const void * from, size_t n) +static INLINE void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; __asm__ __volatile__( -- cgit v1.2.3 From 71d2578ac5530c8641bcd5d9a9654373a6ce853e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Jun 2008 10:55:24 -0600 Subject: replace __inline and __inline__ with INLINE macro --- src/mesa/drivers/dri/common/memops.h | 2 +- src/mesa/drivers/dri/common/mmio.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/common/memops.h b/src/mesa/drivers/dri/common/memops.h index 4952d788e81..9cd1d8ec3fa 100644 --- a/src/mesa/drivers/dri/common/memops.h +++ b/src/mesa/drivers/dri/common/memops.h @@ -4,7 +4,7 @@ * memset an area in I/O space * We need to be careful about this on some archs */ -static __inline__ void drimemsetio(void* address, int c, int size) +static INLINE void drimemsetio(void* address, int c, int size) { #if defined(__powerpc__) || defined(__ia64__) int i; diff --git a/src/mesa/drivers/dri/common/mmio.h b/src/mesa/drivers/dri/common/mmio.h index 2b7b4123e5a..89871aab59e 100644 --- a/src/mesa/drivers/dri/common/mmio.h +++ b/src/mesa/drivers/dri/common/mmio.h @@ -37,7 +37,7 @@ #if defined( __powerpc__ ) -static __inline__ u_int32_t +static INLINE u_int32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { u_int32_t val; @@ -50,7 +50,7 @@ read_MMIO_LE32( volatile void * base, unsigned long offset ) #else -static __inline__ u_int32_t +static INLINE u_int32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { volatile u_int32_t * p = (volatile u_int32_t *) (((volatile char *) base) + offset); -- cgit v1.2.3 From 98fa0aec366ac41065698fd9bf76731b7d08f1f7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 09:41:58 -0700 Subject: i915: Allow accelerated pixel ops to be disabled with INTEL_NO_BLIT. This matches 965. --- src/mesa/drivers/dri/intel/intel_pixel.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 9018e3daef4..cc6b9bb0eae 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -113,8 +113,10 @@ void intelInitPixelFuncs(struct dd_function_table *functions) { functions->Accum = _swrast_Accum; - functions->Bitmap = _swrast_Bitmap; - functions->CopyPixels = intelCopyPixels; - functions->ReadPixels = intelReadPixels; - functions->DrawPixels = intelDrawPixels; + if (!getenv("INTEL_NO_BLIT")) { + functions->Bitmap = _swrast_Bitmap; + functions->CopyPixels = intelCopyPixels; + functions->ReadPixels = intelReadPixels; + functions->DrawPixels = intelDrawPixels; + } } -- cgit v1.2.3 From 59890987799624e07083300d291f2457baff0192 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 09:48:23 -0700 Subject: i915: Fix read != draw drawable for glCopyPixels. Taken from commit bad6e175cf59cce630c37d73f6e71f3a4de50ae6. --- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index c453097e55e..e7d5cc6df22 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -272,6 +272,7 @@ do_blit_copypixels(GLcontext * ctx, if (intel->driDrawable->numClipRects) { __DRIdrawablePrivate *dPriv = intel->driDrawable; + __DRIdrawablePrivate *dReadPriv = intel->driReadDrawable; drm_clip_rect_t *box = dPriv->pClipRects; drm_clip_rect_t dest_rect; GLint nbox = dPriv->numClipRects; @@ -303,8 +304,8 @@ do_blit_copypixels(GLcontext * ctx, srcy = dPriv->h - srcy - height; dstx += dPriv->x; dsty += dPriv->y; - srcx += dPriv->x; - srcy += dPriv->y; + srcx += dReadPriv->x; + srcy += dReadPriv->y; /* Clip against the source region. This is the only source * clipping we do. Dst is clipped with cliprects below. -- cgit v1.2.3 From eda68cccc072c10f94c096b9877d09a787069631 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 09:37:07 -0700 Subject: i915: Add support for accelerated glBitmap, shared from 965. --- src/mesa/drivers/dri/i915/Makefile | 1 + src/mesa/drivers/dri/i915/intel_pixel_bitmap.c | 350 +------------------------ src/mesa/drivers/dri/intel/intel_blit.c | 9 +- src/mesa/drivers/dri/intel/intel_pixel.c | 2 +- 4 files changed, 8 insertions(+), 354 deletions(-) mode change 100644 => 120000 src/mesa/drivers/dri/i915/intel_pixel_bitmap.c (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 7ef055ccad2..bdd3b852603 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -28,6 +28,7 @@ DRIVER_SOURCES = \ intel_tex_format.c \ intel_tex.c \ intel_pixel.c \ + intel_pixel_bitmap.c \ intel_pixel_copy.c \ intel_pixel_read.c \ intel_pixel_draw.c \ diff --git a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c deleted file mode 100644 index 066d5b1fd4f..00000000000 --- a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c +++ /dev/null @@ -1,349 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 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, sub license, 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 portionsalloc - * 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 TUNGSTEN GRAPHICS 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. - * - **************************************************************************/ - -#include "glheader.h" -#include "enums.h" -#include "image.h" -#include "colormac.h" -#include "mtypes.h" -#include "macros.h" -#include "bufferobj.h" -#include "swrast/swrast.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_ioctl.h" -#include "intel_batchbuffer.h" -#include "intel_blit.h" -#include "intel_regions.h" -#include "intel_buffer_objects.h" - - - -#define FILE_DEBUG_FLAG DEBUG_PIXEL - - -/* Unlike the other intel_pixel_* functions, the expectation here is - * that the incoming data is not in a PBO. With the XY_TEXT blit - * method, there's no benefit haveing it in a PBO, but we could - * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit - * PBO bitmaps. I think they are probably pretty rare though - I - * wonder if Xgl uses them? - */ -static const GLubyte *map_pbo( GLcontext *ctx, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ) -{ - GLubyte *buf; - - if (!_mesa_validate_pbo_access(2, unpack, width, height, 1, - GL_COLOR_INDEX, GL_BITMAP, - (GLvoid *) bitmap)) { - _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)"); - return NULL; - } - - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - GL_READ_ONLY_ARB, - unpack->BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)"); - return NULL; - } - - return ADD_POINTERS(buf, bitmap); -} - -static GLboolean test_bit( const GLubyte *src, - GLuint bit ) -{ - return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0; -} - -static void set_bit( GLubyte *dest, - GLuint bit ) -{ - dest[bit/8] |= 1 << (bit % 8); -} - -static int align(int x, int align) -{ - return (x + align - 1) & ~(align - 1); -} - -/* Extract a rectangle's worth of data from the bitmap. Called - * per-cliprect. - */ -static GLuint get_bitmap_rect(GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap, - GLuint x, GLuint y, - GLuint w, GLuint h, - GLubyte *dest, - GLuint row_align, - GLboolean invert) -{ - GLuint src_offset = (x + unpack->SkipPixels) & 0x7; - GLuint mask = unpack->LsbFirst ? 0 : 7; - GLuint bit = 0; - GLint row, col; - GLint first, last; - GLint incr; - GLuint count = 0; - - if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", - __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask); - - if (invert) { - first = h-1; - last = 0; - incr = -1; - } - else { - first = 0; - last = h-1; - incr = 1; - } - - /* Require that dest be pre-zero'd. - */ - for (row = first; row != (last+incr); row += incr) { - const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap, - width, height, - GL_COLOR_INDEX, GL_BITMAP, - y + row, x); - - for (col = 0; col < w; col++, bit++) { - if (test_bit(rowsrc, (col + src_offset) ^ mask)) { - set_bit(dest, bit ^ 7); - count++; - } - } - - if (row_align) - bit = (bit + row_align - 1) & ~(row_align - 1); - } - - return count; -} - - - - -/* - * Render a bitmap. - */ -static GLboolean -do_blit_bitmap( GLcontext *ctx, - GLint dstx, GLint dsty, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap ) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_region *dst = intel_drawbuf_region(intel); - - union { - GLuint ui; - GLubyte ub[4]; - } color; - - - if (unpack->BufferObj->Name) { - bitmap = map_pbo(ctx, width, height, unpack, bitmap); - if (bitmap == NULL) - return GL_TRUE; /* even though this is an error, we're done */ - } - - UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]); - - /* Does zoom apply to bitmaps? - */ - if (!intel_check_blit_fragment_ops(ctx) || - ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F) - return GL_FALSE; - - LOCK_HARDWARE(intel); - - if (intel->driDrawable->numClipRects) { - __DRIdrawablePrivate *dPriv = intel->driDrawable; - drm_clip_rect_t *box = dPriv->pClipRects; - drm_clip_rect_t dest_rect; - GLint nbox = dPriv->numClipRects; - GLint srcx = 0, srcy = 0; - GLint orig_screen_x1, orig_screen_y2; - GLuint i; - - - orig_screen_x1 = dPriv->x + dstx; - orig_screen_y2 = dPriv->y + (dPriv->h - dsty); - - /* Do scissoring in GL coordinates: - */ -x if (ctx->Scissor.Enabled) - { - GLint x = ctx->Scissor.X; - GLint y = ctx->Scissor.Y; - GLuint w = ctx->Scissor.Width; - GLuint h = ctx->Scissor.Height; - - if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) - goto out; - } - - /* Convert from GL to hardware coordinates: - */ - dsty = dPriv->y + (dPriv->h - dsty - height); - dstx = dPriv->x + dstx; - - dest_rect.x1 = dstx; - dest_rect.y1 = dsty; - dest_rect.x2 = dstx + width; - dest_rect.y2 = dsty + height; - - for (i = 0; i < nbox; i++) { - drm_clip_rect_t rect; - int box_w, box_h; - GLint px, py; - GLuint stipple[32]; - - if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) - continue; - - /* Now go back to GL coordinates to figure out what subset of - * the bitmap we are uploading for this cliprect: - */ - box_w = rect.x2 - rect.x1; - box_h = rect.y2 - rect.y1; - srcx = rect.x1 - orig_screen_x1; - srcy = orig_screen_y2 - rect.y2; - - -#define DY 32 -#define DX 32 - - /* Then, finally, chop it all into chunks that can be - * digested by hardware: - */ - for (py = 0; py < box_h; py += DY) { - for (px = 0; px < box_w; px += DX) { - int h = MIN2(DY, box_h - py); - int w = MIN2(DX, box_w - px); - GLuint sz = align(align(w,8) * h, 64)/8; - - assert(sz <= sizeof(stipple)); - memset(stipple, 0, sz); - - /* May need to adjust this when padding has been introduced in - * sz above: - */ - if (get_bitmap_rect(width, height, unpack, - bitmap, - srcx + px, srcy + py, w, h, - (GLubyte *)stipple, - 8, - GL_TRUE) == 0) - continue; - - /* - */ - intelEmitImmediateColorExpandBlit( intel, - dst->cpp, - (GLubyte *)stipple, - sz, - color.ui, - dst->pitch, - dst->buffer, - 0, - dst->tiled, - rect.x1 + px, - rect.y2 - (py + h), - w, h); - } - } - } - out: - intel_batchbuffer_flush(intel->batch); - } - UNLOCK_HARDWARE(intel); - - - if (unpack->BufferObj->Name) { - /* done with PBO so unmap it now */ - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT, - unpack->BufferObj); - } - - return GL_TRUE; -} - - - - - -/* There are a large number of possible ways to implement bitmap on - * this hardware, most of them have some sort of drawback. Here are a - * few that spring to mind: - * - * Blit: - * - XY_MONO_SRC_BLT_CMD - * - use XY_SETUP_CLIP_BLT for cliprect clipping. - * - XY_TEXT_BLT - * - XY_TEXT_IMMEDIATE_BLT - * - blit per cliprect, subject to maximum immediate data size. - * - XY_COLOR_BLT - * - per pixel or run of pixels - * - XY_PIXEL_BLT - * - good for sparse bitmaps - * - * 3D engine: - * - Point per pixel - * - Translate bitmap to an alpha texture and render as a quad - * - Chop bitmap up into 32x32 squares and render w/polygon stipple. - */ -void -intelBitmap(GLcontext * ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte * pixels) -{ - if (do_blit_bitmap(ctx, x, y, width, height, - unpack, pixels)) - return; - - if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); - - _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); -} diff --git a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c new file mode 120000 index 00000000000..9085c7b0397 --- /dev/null +++ b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c @@ -0,0 +1 @@ +../intel/intel_pixel_bitmap.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 414300c5497..d9dbbb24825 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -576,9 +576,6 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, dst_pitch *= cpp; - if (dst_tiled) - dst_pitch /= 4; - DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n", __FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords); @@ -592,8 +589,12 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, opcode = XY_SETUP_BLT_CMD; if (cpp == 4) opcode |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB; - if (dst_tiled) +#ifndef I915 + if (dst_tiled) { opcode |= XY_DST_TILED; + dst_pitch /= 4; + } +#endif br13 = dst_pitch | (translate_raster_op(logic_op) << 16) | (1 << 29); if (cpp == 2) diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index cc6b9bb0eae..a6ccdf49f55 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -114,7 +114,7 @@ intelInitPixelFuncs(struct dd_function_table *functions) { functions->Accum = _swrast_Accum; if (!getenv("INTEL_NO_BLIT")) { - functions->Bitmap = _swrast_Bitmap; + functions->Bitmap = intelBitmap; functions->CopyPixels = intelCopyPixels; functions->ReadPixels = intelReadPixels; functions->DrawPixels = intelDrawPixels; -- cgit v1.2.3 From 90d33edf37d12495fcfb4876d1048f3ed5df2b9b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 10:50:10 -0700 Subject: intel: Note reasons for blit pixel op fallbacks under INTEL_DEBUG=pix. --- src/mesa/drivers/dri/intel/intel_pixel.c | 71 +++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 15 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index a6ccdf49f55..c0333969d0c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -33,6 +33,7 @@ #include "intel_pixel.h" #include "intel_regions.h" +#define FILE_DEBUG_FLAG DEBUG_PIXEL /** * Check if any fragment operations are in effect which might effect @@ -44,21 +45,61 @@ intel_check_blit_fragment_ops(GLcontext * ctx) if (ctx->NewState) _mesa_update_state(ctx); - /* XXX Note: Scissor could be done with the blitter: - */ - return !(ctx->_ImageTransferState || - ctx->Color.AlphaEnabled || - ctx->Depth.Test || - ctx->Fog.Enabled || - ctx->Scissor.Enabled || - ctx->Stencil.Enabled || - !ctx->Color.ColorMask[0] || - !ctx->Color.ColorMask[1] || - !ctx->Color.ColorMask[2] || - !ctx->Color.ColorMask[3] || - ctx->Texture._EnabledUnits || - ctx->FragmentProgram._Enabled || - ctx->Color.BlendEnabled); + if (ctx->FragmentProgram._Enabled) { + DBG("fallback due to fragment program\n"); + return GL_FALSE; + } + + if (ctx->Color.BlendEnabled) { + DBG("fallback due to blend\n"); + return GL_FALSE; + } + + if (ctx->Texture._EnabledUnits) { + DBG("fallback due to texturing\n"); + return GL_FALSE; + } + + if (!(ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && + ctx->Color.ColorMask[3])) { + DBG("fallback due to color masking\n"); + return GL_FALSE; + } + + if (ctx->Color.AlphaEnabled) { + DBG("fallback due to alpha\n"); + return GL_FALSE; + } + + if (ctx->Depth.Test) { + DBG("fallback due to depth test\n"); + return GL_FALSE; + } + + if (ctx->Fog.Enabled) { + DBG("fallback due to fog\n"); + return GL_FALSE; + } + + if (ctx->_ImageTransferState) { + DBG("fallback due to image transfer\n"); + return GL_FALSE; + } + + if (ctx->Stencil.Enabled) { + DBG("fallback due to image stencil\n"); + return GL_FALSE; + } + + if (ctx->Scissor.Enabled) { + /* XXX Note: Scissor could be done with the blitter */ + DBG("fallback due to image scissor\n"); + return GL_FALSE; + } + + return GL_TRUE; } -- cgit v1.2.3 From f23adc504d8202bbcc78121567a61c0b24819422 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 11:34:42 -0700 Subject: intel: Merge check_blit_fragment_ops between i915/i965. Both had some useful bits for the other. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/intel_pixel.c | 1 + src/mesa/drivers/dri/i965/intel_pixel_copy.c | 28 ---------------------------- src/mesa/drivers/dri/intel/intel_pixel.c | 7 +++++++ 4 files changed, 9 insertions(+), 28 deletions(-) create mode 120000 src/mesa/drivers/dri/i965/intel_pixel.c (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index d46b3428f59..c561b744d1b 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -19,6 +19,7 @@ DRIVER_SOURCES = \ intel_regions.c \ intel_screen.c \ intel_span.c \ + intel_pixel.c \ intel_pixel_copy.c \ intel_pixel_bitmap.c \ intel_state.c \ diff --git a/src/mesa/drivers/dri/i965/intel_pixel.c b/src/mesa/drivers/dri/i965/intel_pixel.c new file mode 120000 index 00000000000..d733c5e8745 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_pixel.c @@ -0,0 +1 @@ +../intel/intel_pixel.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c index 2f9c621dae7..5725dff3ef4 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -70,34 +70,6 @@ copypix_src_region(struct intel_context *intel, GLenum type) return NULL; } - - - -/** - * Check if any fragment operations are in effect which might effect - * glDraw/CopyPixels. - */ -GLboolean -intel_check_blit_fragment_ops(GLcontext * ctx) -{ - if (ctx->NewState) - _mesa_update_state(ctx); - - return !(ctx->_ImageTransferState || - ctx->RenderMode != GL_RENDER || - ctx->Color.AlphaEnabled || - ctx->Depth.Test || - ctx->Fog.Enabled || - ctx->Stencil.Enabled || - !ctx->Color.ColorMask[0] || - !ctx->Color.ColorMask[1] || - !ctx->Color.ColorMask[2] || - !ctx->Color.ColorMask[3] || /* can do this! */ - ctx->Texture._EnabledUnits || - ctx->FragmentProgram._Enabled || - ctx->Color.BlendEnabled); -} - /* Doesn't work for overlapping regions. Could do a double copy or * just fallback. */ diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index c0333969d0c..72eb823bc47 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -99,6 +99,11 @@ intel_check_blit_fragment_ops(GLcontext * ctx) return GL_FALSE; } + if (ctx->RenderMode != GL_RENDER) { + DBG("fallback due to render mode\n"); + return GL_FALSE; + } + return GL_TRUE; } @@ -157,7 +162,9 @@ intelInitPixelFuncs(struct dd_function_table *functions) if (!getenv("INTEL_NO_BLIT")) { functions->Bitmap = intelBitmap; functions->CopyPixels = intelCopyPixels; +#ifdef I915 functions->ReadPixels = intelReadPixels; functions->DrawPixels = intelDrawPixels; +#endif } } -- cgit v1.2.3 From f5eb62a1161f050925c5c0b4839c437b29bdbc6b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 11:44:42 -0700 Subject: intel: Avoid glBitmap software fallback for blending when no blending occurs. Mesa demos tend to leave blending on but in GL_ONE/GL_ZERO, or GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA with a source alpha of 1.0. --- src/mesa/drivers/dri/i965/intel_pixel_copy.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel.c | 23 +++++++++++++++++++++-- src/mesa/drivers/dri/intel/intel_pixel.h | 3 ++- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c index 5725dff3ef4..dba4bb137e4 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -188,7 +188,7 @@ do_blit_copypixels(GLcontext * ctx, /* Copypixels can be more than a straight copy. Ensure all the * extra operations are disabled: */ - if (!intel_check_blit_fragment_ops(ctx) || + if (!intel_check_blit_fragment_ops(ctx, GL_FALSE) || ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F) return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index 72eb823bc47..6417866b201 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -35,12 +35,25 @@ #define FILE_DEBUG_FLAG DEBUG_PIXEL +static GLenum +effective_func(GLenum func, GLboolean src_alpha_is_one) +{ + if (src_alpha_is_one) { + if (func == GL_SRC_ALPHA) + return GL_ONE; + if (func == GL_ONE_MINUS_SRC_ALPHA) + return GL_ZERO; + } + + return func; +} + /** * Check if any fragment operations are in effect which might effect * glDraw/CopyPixels. */ GLboolean -intel_check_blit_fragment_ops(GLcontext * ctx) +intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one) { if (ctx->NewState) _mesa_update_state(ctx); @@ -50,7 +63,13 @@ intel_check_blit_fragment_ops(GLcontext * ctx) return GL_FALSE; } - if (ctx->Color.BlendEnabled) { + if (ctx->Color.BlendEnabled && + (effective_func(ctx->Color.BlendSrcRGB, src_alpha_is_one) != GL_ONE || + effective_func(ctx->Color.BlendDstRGB, src_alpha_is_one) != GL_ZERO || + ctx->Color.BlendEquationRGB != GL_FUNC_ADD || + effective_func(ctx->Color.BlendSrcA, src_alpha_is_one) != GL_ONE || + effective_func(ctx->Color.BlendDstA, src_alpha_is_one) != GL_ZERO || + ctx->Color.BlendEquationA != GL_FUNC_ADD)) { DBG("fallback due to blend\n"); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index ea2319a01f5..9c899b954c3 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -32,7 +32,8 @@ void intelInitPixelFuncs(struct dd_function_table *functions); -GLboolean intel_check_blit_fragment_ops(GLcontext * ctx); +GLboolean intel_check_blit_fragment_ops(GLcontext * ctx, + GLboolean src_alpha_is_one); GLboolean intel_check_meta_tex_fragment_ops(GLcontext * ctx); diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 4cb68655f2b..81238acfe4e 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -194,7 +194,7 @@ do_blit_bitmap( GLcontext *ctx, /* Does zoom apply to bitmaps? */ - if (!intel_check_blit_fragment_ops(ctx) || + if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F) || ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F) return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 2804c8deeaf..34813d2aa0d 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -253,7 +253,7 @@ do_blit_drawpixels(GLcontext * ctx, return GL_FALSE; } - if (!intel_check_blit_fragment_ops(ctx)) { + if (!intel_check_blit_fragment_ops(ctx, GL_FALSE)) { if (INTEL_DEBUG & DEBUG_PIXEL) _mesa_printf("%s - bad GL fragment state for blitter\n", __FUNCTION__); -- cgit v1.2.3 From 744357e29c6a51b9e1770e0340eee5105f6b5585 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 11:49:21 -0700 Subject: intel: Same pixel function init for everyone now. --- src/mesa/drivers/dri/i915/i830_context.c | 1 - src/mesa/drivers/dri/i915/i915_context.c | 1 - src/mesa/drivers/dri/i965/brw_context.c | 8 -------- src/mesa/drivers/dri/intel/intel_context.c | 1 + 4 files changed, 1 insertion(+), 10 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index 240c57c9ad3..acb7178a5cd 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -52,7 +52,6 @@ static void i830InitDriverFunctions(struct dd_function_table *functions) { intelInitDriverFunctions(functions); - intelInitPixelFuncs(functions); i830InitStateFuncs(functions); i830InitTextureFuncs(functions); } diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 01619590999..532b402db70 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -94,7 +94,6 @@ static void i915InitDriverFunctions(struct dd_function_table *functions) { intelInitDriverFunctions(functions); - intelInitPixelFuncs(functions); i915InitStateFunctions(functions); i915InitTextureFuncs(functions); i915InitFragProgFuncs(functions); diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 1601f6dd248..33f1bba085b 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -65,14 +65,6 @@ static void brwInitDriverFunctions( struct dd_function_table *functions ) { intelInitDriverFunctions( functions ); - /* CopyPixels can be accelerated even with the current memory - * manager: - */ - if (!getenv("INTEL_NO_BLIT")) { - functions->CopyPixels = intelCopyPixels; - functions->Bitmap = intelBitmap; - } - brwInitFragProgFuncs( functions ); brwInitProgFuncs( functions ); } diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 80e2111b832..671b3f68a3e 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -528,6 +528,7 @@ intelInitDriverFunctions(struct dd_function_table *functions) intelInitTextureFuncs(functions); intelInitStateFuncs(functions); intelInitBufferFuncs(functions); + intelInitPixelFuncs(functions); } -- cgit v1.2.3 From 9a0d773116c6e9d7a63a63644a12170b7486a86e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 13:18:40 -0700 Subject: i965: Use the shared intel_pixel_copy.c. This disables the textured copy implementation on 965, which didn't appear to work (mesa copypix demo, disable the blit path, move so that regions don't overlap and textured is used, and you get garbage). If we resurrect this for i965, I'd rather it used the 915-style metaops instead. Current metaops code left in place so that whoever picks it up has a reference. --- src/mesa/drivers/dri/i965/intel_pixel_copy.c | 319 +------------------------- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 8 +- 2 files changed, 5 insertions(+), 322 deletions(-) mode change 100644 => 120000 src/mesa/drivers/dri/i965/intel_pixel_copy.c (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c deleted file mode 100644 index dba4bb137e4..00000000000 --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c +++ /dev/null @@ -1,318 +0,0 @@ -/************************************************************************** - * - * Copyright 2003 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, sub license, 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 TUNGSTEN GRAPHICS 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. - * - **************************************************************************/ - -#include "glheader.h" -#include "enums.h" -#include "image.h" -#include "mtypes.h" -#include "macros.h" -#include "state.h" -#include "swrast/swrast.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_ioctl.h" -#include "intel_batchbuffer.h" -#include "intel_blit.h" -#include "intel_regions.h" -#include "intel_buffers.h" -#include "intel_pixel.h" - -#define FILE_DEBUG_FLAG DEBUG_PIXEL - -static struct intel_region * -copypix_src_region(struct intel_context *intel, GLenum type) -{ - switch (type) { - case GL_COLOR: - return intel_readbuf_region(intel); - case GL_DEPTH: - /* Don't think this is really possible execpt at 16bpp, when we have no stencil. - */ - if (intel->depth_region && intel->depth_region->cpp == 2) - return intel->depth_region; - case GL_STENCIL: - /* Don't think this is really possible. - */ - break; - case GL_DEPTH_STENCIL_EXT: - /* Does it matter whether it is stencil/depth or depth/stencil? - */ - return intel->depth_region; - default: - break; - } - - return NULL; -} - -/* Doesn't work for overlapping regions. Could do a double copy or - * just fallback. - */ -static GLboolean -do_texture_copypixels(GLcontext * ctx, - GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_region *dst = intel_drawbuf_region(intel); - struct intel_region *src = copypix_src_region(intel, type); - GLenum src_format; - GLenum src_type; - - DBG("%s %d,%d %dx%d --> %d,%d\n", __FUNCTION__, - srcx, srcy, width, height, dstx, dsty); - - if (!src || !dst || type != GL_COLOR || - ctx->_ImageTransferState || - ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F || - ctx->RenderMode != GL_RENDER || - ctx->Texture._EnabledUnits || - ctx->FragmentProgram._Enabled || - src != dst ) - return GL_FALSE; - - /* Can't handle overlapping regions. Don't have sufficient control - * over rasterization to pull it off in-place. Punt on these for - * now. - * - * XXX: do a copy to a temporary. - */ - if (src->buffer == dst->buffer) { - drm_clip_rect_t srcbox; - drm_clip_rect_t dstbox; - drm_clip_rect_t tmp; - - srcbox.x1 = srcx; - srcbox.y1 = srcy; - srcbox.x2 = srcx + width - 1; - srcbox.y2 = srcy + height - 1; - - dstbox.x1 = dstx; - dstbox.y1 = dsty; - dstbox.x2 = dstx + width - 1; - dstbox.y2 = dsty + height - 1; - - DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2); - DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2, - width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - - if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) { - DBG("%s: regions overlap\n", __FUNCTION__); - return GL_FALSE; - } - } - - intelFlush(&intel->ctx); - - intel->vtbl.install_meta_state(intel); - - /* Is this true? Also will need to turn depth testing on according - * to state: - */ - intel->vtbl.meta_no_stencil_write(intel); - intel->vtbl.meta_no_depth_write(intel); - - /* Set the 3d engine to draw into the destination region: - */ - intel->vtbl.meta_draw_region(intel, dst, intel->depth_region); - - intel->vtbl.meta_import_pixel_state(intel); - - if (src->cpp == 2) { - src_format = GL_RGB; - src_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { - src_format = GL_BGRA; - src_type = GL_UNSIGNED_BYTE; - } - - /* Set the frontbuffer up as a large rectangular texture. - */ - intel->vtbl.meta_frame_buffer_texture( intel, srcx - dstx, srcy - dsty ); - - intel->vtbl.meta_texture_blend_replace(intel); - - if (intel->driDrawable->numClipRects) - intel->vtbl.meta_draw_quad( intel, - dstx, dstx + width, - dsty, dsty + height, - ctx->Current.RasterPos[ 2 ], - 0, 0.0, 0.0, 0.0, 0.0 ); - - intel->vtbl.leave_meta_state( intel ); - - DBG("%s: success\n", __FUNCTION__); - return GL_TRUE; -} - -/** - * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc. - */ -static GLboolean -do_blit_copypixels(GLcontext * ctx, - GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_region *dst = intel_drawbuf_region(intel); - struct intel_region *src = copypix_src_region(intel, type); - - /* Copypixels can be more than a straight copy. Ensure all the - * extra operations are disabled: - */ - if (!intel_check_blit_fragment_ops(ctx, GL_FALSE) || - ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F) - return GL_FALSE; - - if (!src || !dst) - return GL_FALSE; - - - - intelFlush(&intel->ctx); - -/* intel->vtbl.render_start(intel); */ -/* intel->vtbl.emit_state(intel); */ - - LOCK_HARDWARE(intel); - - if (intel->driDrawable->numClipRects) { - __DRIdrawablePrivate *dPriv = intel->driDrawable; - __DRIdrawablePrivate *dReadPriv = intel->driReadDrawable; - drm_clip_rect_t *box = dPriv->pClipRects; - drm_clip_rect_t dest_rect; - GLint nbox = dPriv->numClipRects; - GLint delta_x = 0; - GLint delta_y = 0; - GLuint i; - - /* Do scissoring in GL coordinates: - */ - if (ctx->Scissor.Enabled) - { - GLint x = ctx->Scissor.X; - GLint y = ctx->Scissor.Y; - GLuint w = ctx->Scissor.Width; - GLuint h = ctx->Scissor.Height; - GLint dx = dstx - srcx; - GLint dy = dsty - srcy; - - if (!_mesa_clip_to_region(x, y, x+w-1, y+h-1, &dstx, &dsty, &width, &height)) - goto out; - - srcx = dstx - dx; - srcy = dsty - dy; - } - - /* Convert from GL to hardware coordinates: - */ - dsty = dPriv->h - dsty - height; - srcy = dPriv->h - srcy - height; - dstx += dPriv->x; - dsty += dPriv->y; - srcx += dReadPriv->x; - srcy += dReadPriv->y; - - /* Clip against the source region. This is the only source - * clipping we do. Dst is clipped with cliprects below. - */ - { - delta_x = srcx - dstx; - delta_y = srcy - dsty; - - if (!_mesa_clip_to_region(0, 0, src->pitch, src->height, - &srcx, &srcy, &width, &height)) - goto out; - - dstx = srcx - delta_x; - dsty = srcy - delta_y; - } - - dest_rect.x1 = dstx; - dest_rect.y1 = dsty; - dest_rect.x2 = dstx + width; - dest_rect.y2 = dsty + height; - -/* intel->vtbl.emit_flush(intel, 0); */ - - /* Could do slightly more clipping: Eg, take the intersection of - * the existing set of cliprects and those cliprects translated - * by delta_x, delta_y: - * - * This code will not overwrite other windows, but will - * introduce garbage when copying from obscured window regions. - */ - for (i = 0; i < nbox; i++) { - drm_clip_rect_t rect; - - if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) - continue; - - - intelEmitCopyBlit(intel, - dst->cpp, - src->pitch, src->buffer, 0, src->tiled, - dst->pitch, dst->buffer, 0, dst->tiled, - rect.x1 + delta_x, - rect.y1 + delta_y, /* srcx, srcy */ - rect.x1, rect.y1, /* dstx, dsty */ - rect.x2 - rect.x1, rect.y2 - rect.y1, - ctx->Color.ColorLogicOpEnabled ? - ctx->Color.LogicOp : GL_COPY); - } - - out: - intel_batchbuffer_flush(intel->batch); - } - UNLOCK_HARDWARE(intel); - return GL_TRUE; -} - -void -intelCopyPixels(GLcontext * ctx, - GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint destx, GLint desty, GLenum type) -{ - if (INTEL_DEBUG & DEBUG_PIXEL) - fprintf(stderr, "%s\n", __FUNCTION__); - - if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) - return; - - if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) - return; - - if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("fallback to _swrast_CopyPixels\n"); - - _swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type); -} diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c new file mode 120000 index 00000000000..ee433605904 --- /dev/null +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c @@ -0,0 +1 @@ +../intel/intel_pixel_copy.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index e7d5cc6df22..f45bfff6e5a 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -40,7 +40,6 @@ #include "intel_buffers.h" #include "intel_blit.h" #include "intel_regions.h" -#include "intel_tris.h" #include "intel_pixel.h" #define FILE_DEBUG_FLAG DEBUG_PIXEL @@ -99,6 +98,7 @@ intel_check_copypixel_blit_fragment_ops(GLcontext * ctx) ctx->Color.BlendEnabled); } +#ifdef I915 /* Doesn't work for overlapping regions. Could do a double copy or * just fallback. */ @@ -236,9 +236,7 @@ do_texture_copypixels(GLcontext * ctx, DBG("%s: success\n", __FUNCTION__); return GL_TRUE; } - - - +#endif /* I915 */ /** @@ -374,8 +372,10 @@ intelCopyPixels(GLcontext * ctx, if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) return; +#ifdef I915 if (do_texture_copypixels(ctx, srcx, srcy, width, height, destx, desty, type)) return; +#endif DBG("fallback to _swrast_CopyPixels\n"); -- cgit v1.2.3 From 5174b85a0cb13b06779ea6fc0a8362c9fe57e2ea Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 24 Jun 2008 14:04:11 -0700 Subject: intel: Fix glCopyPixels when x or y are < 0 in hw coordinates. Nothing would get drawn as the negative coordinates broke the rectangle intersection code that used unsigned ints. Tested with copypix demo and sliding the copy to the upper left. --- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index f45bfff6e5a..45f72bac522 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -272,7 +272,6 @@ do_blit_copypixels(GLcontext * ctx, __DRIdrawablePrivate *dPriv = intel->driDrawable; __DRIdrawablePrivate *dReadPriv = intel->driReadDrawable; drm_clip_rect_t *box = dPriv->pClipRects; - drm_clip_rect_t dest_rect; GLint nbox = dPriv->numClipRects; GLint delta_x = 0; GLint delta_y = 0; @@ -320,11 +319,6 @@ do_blit_copypixels(GLcontext * ctx, dsty = srcy - delta_y; } - dest_rect.x1 = dstx; - dest_rect.y1 = dsty; - dest_rect.x2 = dstx + width; - dest_rect.y2 = dsty + height; - /* Could do slightly more clipping: Eg, take the intersection of * the existing set of cliprects and those cliprects translated * by delta_x, delta_y: @@ -333,19 +327,21 @@ do_blit_copypixels(GLcontext * ctx, * introduce garbage when copying from obscured window regions. */ for (i = 0; i < nbox; i++) { - drm_clip_rect_t rect; + GLint clip_x = dstx; + GLint clip_y = dsty; + GLint clip_w = width; + GLint clip_h = height; - if (!intel_intersect_cliprects(&rect, &dest_rect, &box[i])) + if (!_mesa_clip_to_region(box[i].x1, box[i].y1, box[i].x2, box[i].y2, + &clip_x, &clip_y, &clip_w, &clip_h)) continue; - - intelEmitCopyBlit(intel, dst->cpp, + intelEmitCopyBlit(intel, dst->cpp, src->pitch, src->buffer, 0, src->tiled, dst->pitch, dst->buffer, 0, dst->tiled, - rect.x1 + delta_x, - rect.y1 + delta_y, /* srcx, srcy */ - rect.x1, rect.y1, /* dstx, dsty */ - rect.x2 - rect.x1, rect.y2 - rect.y1, + clip_x + delta_x, clip_y + delta_y, /* srcx, srcy */ + clip_x, clip_y, /* dstx, dsty */ + clip_w, clip_h, ctx->Color.ColorLogicOpEnabled ? ctx->Color.LogicOp : GL_COPY); } -- cgit v1.2.3