From bf17c6dede1c0cf1edee10f2cc7e1e619b944d3a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 22 Jun 2006 12:24:09 -0400 Subject: [PATCH 01/11] Drop libz from the server's link line, it was only needed for LBX. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d025638a3..b8d942ee7 100644 --- a/configure.ac +++ b/configure.ac @@ -843,7 +843,7 @@ PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}" -XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} -lm -lz" +XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} -lm" AC_SUBST([XSERVER_LIBS]) AC_SUBST([SYS_LIBS]) From d67fd106968e371d8be3966ed5ecdd3c69f36e3a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 22 Jun 2006 12:47:51 -0400 Subject: [PATCH 02/11] Add kdrive servers to .gitignore --- .gitignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 429f677ff..149c1e63e 100644 --- a/.gitignore +++ b/.gitignore @@ -116,6 +116,24 @@ hw/dmx/examples/xdmx hw/dmx/examples/xinput hw/dmx/examples/xled hw/dmx/examples/xtest +hw/kdrive/ati/Xati +hw/kdrive/chips/Xchips +hw/kdrive/ephyr/Xephyr +hw/kdrive/epson/Xepson +hw/kdrive/fake/Xfake +hw/kdrive/fbdev/Xfbdev +hw/kdrive/i810/Xi810 +hw/kdrive/mach64/Xmach64 +hw/kdrive/mga/Xmga +hw/kdrive/neomagic/Xneomagic +hw/kdrive/nvidia/Xnvidia +hw/kdrive/pm2/Xpm2 +hw/kdrive/r128/Xr128 +hw/kdrive/sdl/Xsdl +hw/kdrive/sis300/Xsis +hw/kdrive/smi/Xsmi +hw/kdrive/vesa/Xvesa +hw/kdrive/via/Xvia hw/vfb/Xvfb hw/vfb/Xvfb.1x hw/vfb/Xvfb.man From 2cf1f39ca974c81a2f52d2f7509aa3d098a87176 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 21 Jun 2006 09:30:59 -0700 Subject: [PATCH 03/11] Add a manpage for EXA. --- .gitignore | 2 ++ hw/xfree86/exa/Makefile.am | 12 ++++++++++++ hw/xfree86/exa/exa.man.pre | 40 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 hw/xfree86/exa/exa.man.pre diff --git a/.gitignore b/.gitignore index 149c1e63e..1e7970677 100644 --- a/.gitignore +++ b/.gitignore @@ -144,6 +144,8 @@ hw/xfree86/doc/man/Xorg.1x hw/xfree86/doc/man/Xorg.man hw/xfree86/doc/man/xorg.conf.5x hw/xfree86/doc/man/xorg.conf.man +hw/xfree86/exa/exa.4 +hw/xfree86/exa/exa.man hw/xfree86/fbdevhw/fbdevhw.4x hw/xfree86/fbdevhw/fbdevhw.man hw/xfree86/getconfig/cfg.man diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am index 8e85e1ede..7f0a20e4c 100644 --- a/hw/xfree86/exa/Makefile.am +++ b/hw/xfree86/exa/Makefile.am @@ -14,3 +14,15 @@ libexa_la_SOURCES = \ libexa_la_LIBADD = \ ../../../exa/libexa.la + +include $(top_srcdir)/cpprules.in + +drivermandir = $(DRIVER_MAN_DIR) +driverman_DATA = exa.$(DRIVER_MAN_SUFFIX) +CLEANFILES = $(driverman_DATA) exa.man + +exa.$(DRIVER_MAN_SUFFIX): exa.man + -rm -f exa.$(DRIVER_MAN_SUFFIX) + $(LN_S) exa.man exa.$(DRIVER_MAN_SUFFIX) + +EXTRA_DIST = exa.man.pre README diff --git a/hw/xfree86/exa/exa.man.pre b/hw/xfree86/exa/exa.man.pre new file mode 100644 index 000000000..ea41b90e4 --- /dev/null +++ b/hw/xfree86/exa/exa.man.pre @@ -0,0 +1,40 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH EXA __drivermansuffix__ __vendorversion__ +.SH NAME +exa \- new 2D acceleration architecture for X.Org +.SH DESCRIPTION +.B EXA +provides a simple API for video drivers to implement for 2D acceleration. It +is a module loaded by drivers, and is not intended to be loaded on its own. See +your driver's manual page for how to enable +.B EXA +. +.PP +The +.B EXA +architecture is designed to make accelerating the Render extension simple and +efficient, and results in various performance tradeoffs compared to XAA. Some +options are available for debugging performance issues or driver rendering +problems. They are not intended for general use. +.TP +.BI "Option \*qEXANoComposite\*q \*q" boolean \*q +Disables acceleration of the Composite operation, which is at the heart of +the Render extension. Not related to the Composite extension. Default: No. +.TP +.BI "Option \*qEXANoUploadToScreen\*q \*q" boolean \*q +Disables acceleration of uploading pixmap data to the freamebuffer. Default: No. +.TP +.BI "Option \*qEXANoDownloadFromScreen\*q \*q" boolean \*q +Disables acceleration of downloading of pixmap data from the framebuffer. +.B NOTE: +Not usable with drivers which rely on DownloadFromScreen succeeding. +Default: No. +.TP +.BI "Option \*qMigrationHeuristic\*q \*q" anystr \*q +Chooses an alternate pixmap migration heuristic, for debugging purposes. The +default is intended to be the best performing one for general use, though others +may help with specific use cases. Available options include \*qalways\*q, +\*qgreedy\*q, and \*qsmart\*q. Default: smart. +.SH AUTHORS +Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel Dänzer From c7ac485a59709572307b9a4a9abacc52c7021b65 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 21 Jun 2006 09:34:55 -0700 Subject: [PATCH 04/11] Remove the default case from fbcompose.c switches which should cover all cases. Instead, stick the NULL return default case afterwards, so that the compiler can warn us when we've got unimplemented cases. Removes some unimplemented and unused 8bpp, depth 4 picture format names. --- fb/fbcompose.c | 8 ++++---- render/picture.h | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fb/fbcompose.c b/fb/fbcompose.c index 03adab456..3a61e975a 100644 --- a/fb/fbcompose.c +++ b/fb/fbcompose.c @@ -573,9 +573,9 @@ static fetchProc fetchProcForPicture (PicturePtr pict) /* 1bpp formats */ case PICT_a1: return fbFetch_a1; case PICT_g1: return fbFetch_g1; - default: - return NULL; } + + return NULL; } /* @@ -1010,9 +1010,9 @@ static fetchPixelProc fetchPixelProcForPicture (PicturePtr pict) /* 1bpp formats */ case PICT_a1: return fbFetchPixel_a1; case PICT_g1: return fbFetchPixel_g1; - default: - return NULL; } + + return NULL; } diff --git a/render/picture.h b/render/picture.h index e7d86ac39..8184c02c0 100644 --- a/render/picture.h +++ b/render/picture.h @@ -102,10 +102,6 @@ typedef enum _PictFormatShort { PICT_g8 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0), PICT_x4a4 = PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0), - PICT_x4r1g2b1 = PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1), - PICT_x4b1g2r1 = PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1), - PICT_x4a1r1g1b1 = PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1), - PICT_x4a1b1g1r1 = PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1), PICT_x4c4 = PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0), PICT_x4g4 = PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0), From bc6cfde19887eff7a07dc739ffa29609fb55b83d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 23 Jun 2006 20:07:34 -0700 Subject: [PATCH 05/11] Use correct OSNAME setting so we can find os-specific modules like libdrm. --- hw/xfree86/loader/os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c index 42ab0bc70..83fd24787 100644 --- a/hw/xfree86/loader/os.c +++ b/hw/xfree86/loader/os.c @@ -33,10 +33,11 @@ /* * OSNAME is a standard form of the OS name that may be used by the - * loader and by OS-specific modules. + * loader and by OS-specific modules. OSNAME here is different from what's in + * dix-config.h */ -#ifndef OSNAME +#undef OSNAME #if defined(__linux__) #define OSNAME "linux" #elif defined(__FreeBSD__) @@ -66,7 +67,6 @@ #else #define OSNAME "unknown" #endif -#endif /* Return the OS name, and run-time OS version */ From a195a3debca02572d9f7d7a9976b5bf67acc5d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 24 Jun 2006 14:54:52 +0200 Subject: [PATCH 06/11] Fix byte swapping in some GLX requests. --- GL/glx/indirect_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GL/glx/indirect_util.c b/GL/glx/indirect_util.c index c9d8600c8..bab0226be 100644 --- a/GL/glx/indirect_util.c +++ b/GL/glx/indirect_util.c @@ -185,8 +185,8 @@ __glXSendReplySwap( ClientPtr client, const void * data, size_t elements, } __glXReply.length = bswap_32( reply_ints ); - __glXReply.type = bswap_32( X_Reply ); - __glXReply.sequenceNumber = bswap_32( client->sequence ); + __glXReply.type = X_Reply; + __glXReply.sequenceNumber = bswap_16( client->sequence ); __glXReply.size = bswap_32( elements ); __glXReply.retval = bswap_32( retval ); From 4426215a6e99f84550aaac23ac9c2018668bfbc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 24 Jun 2006 15:02:56 +0200 Subject: [PATCH 07/11] Bug #7213: Fix the XFree86-DRI extension for byte-swapped clients. These clients are by definition non-local and thus not direct rendering capable, but they still need the QueryVersion and QueryDirectRenderingCapable requests to find out cleanly. --- hw/xfree86/dri/xf86dri.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 4b0e35459..5e460361b 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -81,6 +81,7 @@ static DISPATCH_PROC(ProcXF86DRIDispatch); static DISPATCH_PROC(ProcXF86DRIAuthConnection); static DISPATCH_PROC(SProcXF86DRIQueryVersion); +static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable); static DISPATCH_PROC(SProcXF86DRIDispatch); static void XF86DRIResetProc(ExtensionEntry* extEntry); @@ -142,6 +143,9 @@ ProcXF86DRIQueryVersion( if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); + swaps(&rep.majorVersion, n); + swaps(&rep.minorVersion, n); + swapl(&rep.patchVersion, n); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); return (client->noClientException); @@ -154,6 +158,7 @@ ProcXF86DRIQueryDirectRenderingCapable( { xXF86DRIQueryDirectRenderingCapableReply rep; Bool isCapable; + register int n; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); @@ -172,9 +177,14 @@ ProcXF86DRIQueryDirectRenderingCapable( } rep.isCapable = isCapable; - if (!LocalClient(client)) + if (!LocalClient(client) || client->swapped) rep.isCapable = 0; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + } + WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); return (client->noClientException); @@ -626,6 +636,18 @@ SProcXF86DRIQueryVersion( return ProcXF86DRIQueryVersion(client); } +static int +SProcXF86DRIQueryDirectRenderingCapable( + register ClientPtr client +) +{ + register int n; + REQUEST(xXF86DRIQueryDirectRenderingCapableReq); + swaps(&stuff->length, n); + swapl(&stuff->screen, n); + return ProcXF86DRIQueryDirectRenderingCapable(client); +} + static int SProcXF86DRIDispatch ( register ClientPtr client @@ -633,16 +655,17 @@ SProcXF86DRIDispatch ( { REQUEST(xReq); - /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) - return DRIErrorBase + XF86DRIClientNotLocal; - - /* only local clients are allowed DRI access */ + /* + * Only local clients are allowed DRI access, but remote clients still need + * these requests to find out cleanly. + */ switch (stuff->data) { case X_XF86DRIQueryVersion: return SProcXF86DRIQueryVersion(client); + case X_XF86DRIQueryDirectRenderingCapable: + return SProcXF86DRIQueryDirectRenderingCapable(client); default: - return BadRequest; + return DRIErrorBase + XF86DRIClientNotLocal; } } From 36756fdb2ddc154b406f664a6af0f38d26e6973d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 24 Jun 2006 15:09:24 +0200 Subject: [PATCH 08/11] Make sure is actually included when needed. configure only defines HAVE_BACKTRACE, not HAVE_EXECINFO_H. This could cause problems on platforms where the size of a pointer is greater than that of an integer, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363218 . --- hw/xfree86/common/xf86Events.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 397f75dc1..831c68ad8 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -1255,12 +1255,8 @@ xf86InterceptSigIll(void (*sigillhandler)(void)) xf86SigIllHandler = sigillhandler; } -#ifdef HAVE_EXECINFO_H -#define HAVE_BACKTRACE -#include -#endif - #ifdef HAVE_BACKTRACE +#include static __inline__ void xorg_backtrace(void) { From 930b9a069a425818d4e9965f53be7df1f4d7d422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 24 Jun 2006 15:21:17 +0200 Subject: [PATCH 09/11] Bug #6818: Avoid infinite loop in exaLog2() with negative arguments. --- exa/exa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exa/exa.c b/exa/exa.c index 4b96af815..aa5532a98 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -158,7 +158,7 @@ exaLog2(int val) { int bits; - if (!val) + if (val <= 0) return 0; for (bits = 0; val != 0; bits++) val >>= 1; From afb84c2fca56887b3bfe7aa93f337c49b087acdc Mon Sep 17 00:00:00 2001 From: George Fufutos Date: Sat, 24 Jun 2006 15:23:14 +0200 Subject: [PATCH 10/11] Bug #6911: Check return value of exaGetPixelFromRGBA(). --- exa/exa_render.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exa/exa_render.c b/exa/exa_render.c index 26b29ab04..b21c5d724 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -282,8 +282,12 @@ exaTryDriverSolidFill(PicturePtr pSrc, return -1; } - exaGetPixelFromRGBA(&pixel, red, green, blue, alpha, - pDst->format); + if (!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha, + pDst->format)) + { + REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + return -1; + } if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) { From 48c871564d493203d434d5da015903399287f619 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 26 Jun 2006 15:57:32 +0200 Subject: [PATCH 11/11] Move EXA_PM_IS_SOLID() to the public API, since drivers will want it frequently. --- exa/exa.h | 9 +++++++++ exa/exa_priv.h | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/exa/exa.h b/exa/exa.h index 2cb200854..96465a775 100644 --- a/exa/exa.h +++ b/exa/exa.h @@ -36,6 +36,7 @@ #include "windowstr.h" #include "gcstruct.h" #include "picturestr.h" +#include "fb.h" #define EXA_VERSION_MAJOR 2 #define EXA_VERSION_MINOR 0 @@ -715,4 +716,12 @@ exaGetPixmapSize(PixmapPtr pPix); void exaEnableDisableFBAccess (int index, Bool enable); +/** + * Returns TRUE if the given planemask covers all the significant bits in the + * pixel values for pDrawable. + */ +#define EXA_PM_IS_SOLID(_pDrawable, _pm) \ + (((_pm) & FbFullMask((_pDrawable)->depth)) == \ + FbFullMask((_pDrawable)->depth)) + #endif /* EXA_H */ diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 90af55335..03ee0eddb 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -137,14 +137,6 @@ extern int exaPixmapPrivateIndex; /** Align an offset to a power-of-two alignment */ #define EXA_ALIGN2(offset, align) (((offset) + (align) - 1) & ~((align) - 1)) -/** - * Returns TRUE if the given planemask covers all the significant bits in the - * pixel values for pDrawable. - */ -#define EXA_PM_IS_SOLID(_pDrawable, _pm) \ - (((_pm) & FbFullMask((_pDrawable)->depth)) == \ - FbFullMask((_pDrawable)->depth)) - #define EXA_PIXMAP_SCORE_MOVE_IN 10 #define EXA_PIXMAP_SCORE_MAX 20 #define EXA_PIXMAP_SCORE_MOVE_OUT -10