From 8bce182568f14edfb03911d8c5d791fd83bb6222 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 29 Jan 2007 17:30:59 -0800 Subject: [PATCH 01/20] Restore a few important lines killed in the previous commit. Typical results were failure to sync, and a black screen. --- hw/xfree86/common/xf86Mode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 7f5ae362d..d5085b542 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -725,6 +725,11 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) p->CrtcVSyncEnd *= p->VScan; p->CrtcVTotal *= p->VScan; } + p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay); + p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal); + p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay); + p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal); + p->CrtcHAdjusted = FALSE; p->CrtcVAdjusted = FALSE; } From 8274ea6aa97b06a56b7468c3908894c0ff72b687 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Feb 2007 12:15:54 -0800 Subject: [PATCH 02/20] Set the Damage version supported in the server, instead of using damageproto. This was caught by distributions upgrading damageproto to 1.1, before the server they had supported it. The server then advertised the new version without supporting the protocol. --- damageext/damageext.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/damageext/damageext.c b/damageext/damageext.c index ae1091eaf..739d20f09 100755 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -35,6 +35,13 @@ int DamageClientPrivateIndex; RESTYPE DamageExtType; RESTYPE DamageExtWinType; +/* Version of the damage extension supported by the server, as opposed to the + * DAMAGE_* defines from damageproto for what version the proto header + * supports. + */ +#define SERVER_DAMAGE_MAJOR 1 +#define SERVER_DAMAGE_MINOR 1 + #define prScreen screenInfo.screens[0] static void @@ -143,16 +150,16 @@ ProcDamageQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < DAMAGE_MAJOR) { + if (stuff->majorVersion < SERVER_DAMAGE_MAJOR) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { - rep.majorVersion = DAMAGE_MAJOR; - if (stuff->majorVersion == DAMAGE_MAJOR && - stuff->minorVersion < DAMAGE_MINOR) + rep.majorVersion = SERVER_DAMAGE_MAJOR; + if (stuff->majorVersion == SERVER_DAMAGE_MAJOR && + stuff->minorVersion < SERVER_DAMAGE_MINOR) rep.minorVersion = stuff->minorVersion; else - rep.minorVersion = DAMAGE_MINOR; + rep.minorVersion = SERVER_DAMAGE_MINOR; } pDamageClient->major_version = rep.majorVersion; pDamageClient->minor_version = rep.minorVersion; From 4f2f3233c808fd86bf9f6c09937feda9e0b367fd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Feb 2007 15:10:29 -0800 Subject: [PATCH 03/20] Fix the size expectations of xRRSetCrtcGamma. It was using REQUEST_SIZE_MATCH (client request length must equal request size) rather than REQUEST_AT_LEAST_SIZE (client request length must be at least big enough for request size), and this request has data following the request structure. --- randr/rrcrtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index c84ec6178..fdd1d429d 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -870,7 +870,7 @@ ProcRRSetCrtcGamma (ClientPtr client) unsigned long len; CARD16 *red, *green, *blue; - REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq); + REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess); if (!crtc) return RRErrorBase + BadRRCrtc; From cf5b29d75dad7c74543f49f010c817623a3df747 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 2 Feb 2007 12:57:38 +0200 Subject: [PATCH 04/20] dmx: drop leftover __GLXdrawablePrivateRec struct. --- hw/dmx/glxProxy/glxdrawable.h | 52 ----------------------------------- hw/dmx/glxProxy/glxserver.h | 3 -- 2 files changed, 55 deletions(-) diff --git a/hw/dmx/glxProxy/glxdrawable.h b/hw/dmx/glxProxy/glxdrawable.h index 59fffa747..baed68315 100644 --- a/hw/dmx/glxProxy/glxdrawable.h +++ b/hw/dmx/glxProxy/glxdrawable.h @@ -49,58 +49,6 @@ typedef struct { } __GLXpixmap; -struct __GLXdrawablePrivateRec { - /* - ** list of drawable private structs - */ - struct __GLXdrawablePrivateRec *last; - struct __GLXdrawablePrivateRec *next; - - DrawablePtr pDraw; - XID drawId; - __GLXpixmap *pGlxPixmap; - - /* - ** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above. - ** Needed by the resource freer because pDraw might already have been - ** freed. - */ - int type; - - /* - ** Configuration of the visual to which this drawable was created. - */ - __GLXvisualConfig *pGlxVisual; - - /* - ** cached drawable size and origin - */ - GLint xorigin, yorigin; - GLint width, height; - - /* - ** list of contexts bound to this drawable - */ - struct __GLXcontextRec *glxc; - - /* - ** "methods" that the drawble should be able to respond to. - */ - void (*freeBuffers)(struct __GLXdrawablePrivateRec *); - void (*updatePalette)(struct __GLXdrawablePrivateRec *); - GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *); - - /* - ** The GL drawable (information shared between GLX and the GL core) - */ - __GLdrawablePrivate glPriv; - - /* - ** reference count - */ - int refCount; -}; - typedef struct { DrawablePtr pDraw; int type; diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index db5be4365..021d4c1de 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -58,9 +58,6 @@ #include #include -/* For glxscreens.h */ -typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate; - #include "glxscreens.h" #include "glxdrawable.h" #include "glxcontext.h" From af20485ec370801f2aabfaeae17bbd030a849bd1 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 2 Feb 2007 19:14:46 +0000 Subject: [PATCH 05/20] Remove array_cache for recent Mesa changes --- GL/symlink-mesa.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh index 9687ce85b..420560614 100755 --- a/GL/symlink-mesa.sh +++ b/GL/symlink-mesa.sh @@ -85,15 +85,6 @@ symlink_mesa_math() { done } -symlink_mesa_ac() { - src_dir src/mesa/array_cache - dst_dir mesa/array_cache - - for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do - action `basename $src` - done -} - symlink_mesa_swrast() { src_dir src/mesa/swrast dst_dir mesa/swrast @@ -203,7 +194,6 @@ symlink_mesa_x8664() { symlink_mesa() { symlink_mesa_main symlink_mesa_math - symlink_mesa_ac symlink_mesa_swrast symlink_mesa_ss symlink_mesa_tnl From e6a505be84f5f72349d6860dc5a5058367516019 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 2 Feb 2007 20:53:01 +0000 Subject: [PATCH 06/20] The array_cache sources don't exist anymore in the Mesa tree, so we shouldn't try to build them. --- GL/mesa/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am index 18eebfc92..539362846 100644 --- a/GL/mesa/Makefile.am +++ b/GL/mesa/Makefile.am @@ -1,11 +1,10 @@ -SUBDIRS = main math array_cache swrast swrast_setup tnl shader X glapi +SUBDIRS = main math swrast swrast_setup tnl shader X glapi noinst_LTLIBRARIES = libGLcore.la libGLcore_la_SOURCES = dummy.c libGLcore_la_LIBADD = main/libmain.la \ math/libmath.la \ - array_cache/libac.la \ swrast/libswrast.la \ swrast_setup/libss.la \ tnl/libtnl.la \ From 170a55022ebc7b148bff93886eda152a0d5ce79a Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 2 Feb 2007 20:56:12 +0000 Subject: [PATCH 07/20] remove file --- GL/mesa/array_cache/Makefile.am | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 GL/mesa/array_cache/Makefile.am diff --git a/GL/mesa/array_cache/Makefile.am b/GL/mesa/array_cache/Makefile.am deleted file mode 100644 index 5016b73b0..000000000 --- a/GL/mesa/array_cache/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -noinst_LTLIBRARIES = libac.la - -AM_CFLAGS = \ - $(DIX_CFLAGS) \ - -DXFree86Server \ - @GLX_DEFINES@ - -INCLUDES = -I@MESA_SOURCE@/include \ - -I../X \ - -I../array_cache \ - -I../glapi \ - -I../main \ - -I../math \ - -I../shader \ - -I../swrast \ - -I../swrast_setup \ - -I../tnl \ - -I.. \ - -I$(top_srcdir)/hw/xfree86/os-support - -nodist_libac_la_SOURCES = ac_context.c ac_import.c From 5dcad9e9d7d9993d65f989219bee94a060bbf476 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 2 Feb 2007 14:44:55 -0800 Subject: [PATCH 08/20] Fix bus error on startup in 64-bit Xephyr hostx_get_visual_masks takes unsigned long * arguments, but was being passed pointers to CARD32's. --- hw/kdrive/ephyr/ephyr.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 7db8675d8..2ca51c30b 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -81,7 +81,8 @@ Bool ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv) { int width = 640, height = 480; - + unsigned long redMask, greenMask, blueMask; + if (hostx_want_screen_size(&width, &height) || !screen->width || !screen->height) { @@ -133,30 +134,24 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv) { screen->fb[0].depth = 15; screen->fb[0].bitsPerPixel = 16; - - hostx_get_visual_masks (&screen->fb[0].redMask, - &screen->fb[0].greenMask, - &screen->fb[0].blueMask); - } else if (screen->fb[0].depth <= 16) { screen->fb[0].depth = 16; screen->fb[0].bitsPerPixel = 16; - - hostx_get_visual_masks (&screen->fb[0].redMask, - &screen->fb[0].greenMask, - &screen->fb[0].blueMask); } else { screen->fb[0].depth = 24; screen->fb[0].bitsPerPixel = 32; - - hostx_get_visual_masks (&screen->fb[0].redMask, - &screen->fb[0].greenMask, - &screen->fb[0].blueMask); } + + hostx_get_visual_masks (&redMask, &greenMask, &blueMask); + + screen->fb[0].redMask = (Pixel) redMask; + screen->fb[0].greenMask = (Pixel) greenMask; + screen->fb[0].blueMask = (Pixel) blueMask; + } scrpriv->randr = screen->randr; From d8e148ec841d340327e6813127b0e0ffc4db712d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 4 Feb 2007 18:39:04 +1100 Subject: [PATCH 09/20] update xserver for vbo code in mesa --- GL/mesa/Makefile.am | 3 ++- GL/mesa/tnl/Makefile.am | 15 +++------------ GL/mesa/vbo/Makefile.am | 36 ++++++++++++++++++++++++++++++++++++ GL/symlink-mesa.sh | 10 ++++++++++ configure.ac | 1 + 5 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 GL/mesa/vbo/Makefile.am diff --git a/GL/mesa/Makefile.am b/GL/mesa/Makefile.am index 539362846..99d3834ac 100644 --- a/GL/mesa/Makefile.am +++ b/GL/mesa/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = main math swrast swrast_setup tnl shader X glapi +SUBDIRS = main math swrast swrast_setup tnl shader X glapi vbo noinst_LTLIBRARIES = libGLcore.la @@ -11,4 +11,5 @@ libGLcore_la_LIBADD = main/libmain.la \ shader/libshader.la \ shader/grammar/libgrammar.la \ shader/slang/libslang.la \ + vbo/libvbo.la \ X/libX.la diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am index 717e6fd53..b59a5faa9 100644 --- a/GL/mesa/tnl/Makefile.am +++ b/GL/mesa/tnl/Makefile.am @@ -19,13 +19,9 @@ INCLUDES = -I@MESA_SOURCE@/include \ -I.. \ -I$(top_srcdir)/hw/xfree86/os-support -nodist_libtnl_la_SOURCES = t_array_api.c \ - t_array_import.c \ - t_context.c \ +nodist_libtnl_la_SOURCES = t_context.c \ + t_draw.c \ t_pipeline.c \ - t_save_api.c \ - t_save_loopback.c \ - t_save_playback.c \ t_vb_arbprogram.c \ t_vb_arbprogram_sse.c \ t_vb_arbshader.c \ @@ -42,9 +38,4 @@ nodist_libtnl_la_SOURCES = t_array_api.c \ t_vertex.c \ t_vertex_generic.c \ t_vertex_sse.c \ - t_vp_build.c \ - t_vtx_api.c \ - t_vtx_eval.c \ - t_vtx_exec.c \ - t_vtx_generic.c \ - t_vtx_x86.c + t_vp_build.c diff --git a/GL/mesa/vbo/Makefile.am b/GL/mesa/vbo/Makefile.am new file mode 100644 index 000000000..09046bb12 --- /dev/null +++ b/GL/mesa/vbo/Makefile.am @@ -0,0 +1,36 @@ +noinst_LTLIBRARIES = libvbo.la + +AM_CFLAGS = \ + $(DIX_CFLAGS) \ + -DXFree86Server \ + @GLX_DEFINES@ + +INCLUDES = -I@MESA_SOURCE@/include \ + -I../X \ + -I../array_cache \ + -I../glapi \ + -I../main \ + -I../math \ + -I../shader \ + -I../shader/slang \ + -I../shader/slang \ + -I../swrast \ + -I../swrast_setup \ + -I../tnl \ + -I.. \ + -I$(top_srcdir)/hw/xfree86/os-support + +nodist_libvbo_la_SOURCES = vbo_context.c \ + vbo_exec_api.c \ + vbo_exec_array.c \ + vbo_exec.c \ + vbo_exec_draw.c \ + vbo_exec_eval.c \ + vbo_rebase.c \ + vbo_save_api.c \ + vbo_save.c \ + vbo_save_draw.c \ + vbo_save_loopback.c \ + vbo_split.c \ + vbo_split_copy.c \ + vbo_split_inplace.c diff --git a/GL/symlink-mesa.sh b/GL/symlink-mesa.sh index 420560614..7d1e06ec8 100755 --- a/GL/symlink-mesa.sh +++ b/GL/symlink-mesa.sh @@ -148,6 +148,15 @@ symlink_mesa_shader_slang_library() { done } +symlink_mesa_vbo() { + src_dir src/mesa/vbo + dst_dir mesa/vbo + + for src in $REAL_SRC_DIR/*.c $REAL_SRC_DIR/*.h; do + action `basename $src` + done +} + symlink_mesa_x() { src_dir src/mesa/drivers/x11 dst_dir mesa/X @@ -205,6 +214,7 @@ symlink_mesa() { symlink_mesa_glapi symlink_mesa_ppc symlink_mesa_sparc + symlink_mesa_vbo symlink_mesa_x86 symlink_mesa_x8664 } diff --git a/configure.ac b/configure.ac index c0a27704a..d23c3c9f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1848,6 +1848,7 @@ GL/mesa/shader/slang/Makefile GL/mesa/swrast/Makefile GL/mesa/swrast_setup/Makefile GL/mesa/tnl/Makefile +GL/mesa/vbo/Makefile GL/mesa/X/Makefile include/Makefile afb/Makefile From fb1bc1c65b88527b42a0e4abed23e5ddaae711b7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 4 Feb 2007 18:39:58 +1100 Subject: [PATCH 10/20] add vbo to .gitignore --- GL/mesa/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GL/mesa/.gitignore b/GL/mesa/.gitignore index 82ab82747..44e273331 100644 --- a/GL/mesa/.gitignore +++ b/GL/mesa/.gitignore @@ -30,3 +30,5 @@ tnl/*.c tnl/*.h x86 x86-64 +vbo/*.c +vbo/*.h From eb228e8d1eaa78911541b2fec5d04a74c1299718 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Sun, 4 Feb 2007 22:06:59 +0000 Subject: [PATCH 11/20] clean up more of the vbo fallout --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index d23c3c9f9..4a33ac022 100644 --- a/configure.ac +++ b/configure.ac @@ -1838,7 +1838,6 @@ Makefile GL/Makefile GL/glx/Makefile GL/mesa/Makefile -GL/mesa/array_cache/Makefile GL/mesa/glapi/Makefile GL/mesa/main/Makefile GL/mesa/math/Makefile From 236f04b638e7d4d1656c6bedd8a6e8d7cec285ec Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 5 Feb 2007 09:09:12 +1100 Subject: [PATCH 12/20] remove array_cache from everywhere --- GL/mesa/.gitignore | 2 -- GL/mesa/X/Makefile.am | 1 - GL/mesa/glapi/Makefile.am | 1 - GL/mesa/main/Makefile.am | 1 - GL/mesa/math/Makefile.am | 1 - GL/mesa/shader/Makefile.am | 1 - GL/mesa/shader/grammar/Makefile.am | 1 - GL/mesa/shader/slang/Makefile.am | 1 - GL/mesa/swrast/Makefile.am | 1 - GL/mesa/swrast_setup/Makefile.am | 1 - GL/mesa/tnl/Makefile.am | 1 - GL/mesa/vbo/Makefile.am | 1 - 12 files changed, 13 deletions(-) diff --git a/GL/mesa/.gitignore b/GL/mesa/.gitignore index 44e273331..a00885d6d 100644 --- a/GL/mesa/.gitignore +++ b/GL/mesa/.gitignore @@ -2,8 +2,6 @@ X/drivers X/glxheader.h X/xmesaP.h X/xm*.c -array_cache/*.c -array_cache/*.h mesa/drivers mesa/glxheader.h mesa/xm*.c diff --git a/GL/mesa/X/Makefile.am b/GL/mesa/X/Makefile.am index 2a9f4225a..45345a7e3 100644 --- a/GL/mesa/X/Makefile.am +++ b/GL/mesa/X/Makefile.am @@ -2,7 +2,6 @@ noinst_LTLIBRARIES = libX.la INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/glapi/Makefile.am b/GL/mesa/glapi/Makefile.am index de457b988..db791143e 100644 --- a/GL/mesa/glapi/Makefile.am +++ b/GL/mesa/glapi/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/main/Makefile.am b/GL/mesa/main/Makefile.am index 64b383dc9..20b79351e 100644 --- a/GL/mesa/main/Makefile.am +++ b/GL/mesa/main/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/math/Makefile.am b/GL/mesa/math/Makefile.am index 5e99d90c4..c7c564272 100644 --- a/GL/mesa/math/Makefile.am +++ b/GL/mesa/math/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/shader/Makefile.am b/GL/mesa/shader/Makefile.am index 4bd57363f..3519545ed 100644 --- a/GL/mesa/shader/Makefile.am +++ b/GL/mesa/shader/Makefile.am @@ -9,7 +9,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/shader/grammar/Makefile.am b/GL/mesa/shader/grammar/Makefile.am index 0974d5b95..332c8e952 100644 --- a/GL/mesa/shader/grammar/Makefile.am +++ b/GL/mesa/shader/grammar/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../../X \ - -I../../array_cache \ -I../../glapi \ -I../../main \ -I../../math \ diff --git a/GL/mesa/shader/slang/Makefile.am b/GL/mesa/shader/slang/Makefile.am index 8f2636ea4..04001c4ba 100644 --- a/GL/mesa/shader/slang/Makefile.am +++ b/GL/mesa/shader/slang/Makefile.am @@ -8,7 +8,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../grammar \ -I../../X \ - -I../../array_cache \ -I../../glapi \ -I../../main \ -I../../math \ diff --git a/GL/mesa/swrast/Makefile.am b/GL/mesa/swrast/Makefile.am index d972af6eb..5ed657631 100644 --- a/GL/mesa/swrast/Makefile.am +++ b/GL/mesa/swrast/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/swrast_setup/Makefile.am b/GL/mesa/swrast_setup/Makefile.am index 8d7040880..1f3c031aa 100644 --- a/GL/mesa/swrast_setup/Makefile.am +++ b/GL/mesa/swrast_setup/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/tnl/Makefile.am b/GL/mesa/tnl/Makefile.am index b59a5faa9..5d9bdb1e6 100644 --- a/GL/mesa/tnl/Makefile.am +++ b/GL/mesa/tnl/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ diff --git a/GL/mesa/vbo/Makefile.am b/GL/mesa/vbo/Makefile.am index 09046bb12..9943f2a5a 100644 --- a/GL/mesa/vbo/Makefile.am +++ b/GL/mesa/vbo/Makefile.am @@ -7,7 +7,6 @@ AM_CFLAGS = \ INCLUDES = -I@MESA_SOURCE@/include \ -I../X \ - -I../array_cache \ -I../glapi \ -I../main \ -I../math \ From 17d85387d1e6851d35474b65929e268ca64ef65b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 18 Jan 2007 15:23:57 +1100 Subject: [PATCH 13/20] dmx, vfb, xnest: fix fbcmap compilation Don't always define XFree86Server, but only for damn fbcmap.c. Split fbcmap.c into its own library to achieve this. --- hw/dmx/Makefile.am | 24 ++++++++++++------------ hw/vfb/Makefile.am | 25 +++++++++++++------------ hw/xnest/Makefile.am | 22 +++++++++++----------- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index 89136b904..17d27ed39 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -2,6 +2,7 @@ DIST_SUBDIRS = input config glxProxy examples doc SUBDIRS = input config examples bin_PROGRAMS = Xdmx +noinst_LIBRARIES = libfbcmap.a if XINERAMA PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c @@ -16,13 +17,20 @@ GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod \ GLX_DEFS = @GL_CFLAGS@ endif -# It's essential that fbcmap.c be compiled with this flag for DMX to work!! -DMX_CFLAGS = -DXFree86Server=1 - if BUILDDOCS SUBDIRS += doc endif +AM_CFLAGS = \ + -DHAVE_DMX_CONFIG_H \ + $(DIX_CFLAGS) \ + $(GLX_INCS) \ + $(GLX_DEFS) \ + @DMXMODULES_CFLAGS@ + +libfbcmap_a_SOURCES = libfbcmap.a +libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server + Xdmx_SOURCES = dmx.c \ dmxcb.c \ dmxcb.h \ @@ -67,7 +75,6 @@ Xdmx_SOURCES = dmx.c \ dmxvisual.h \ dmxwindow.c \ dmxwindow.h \ - $(top_srcdir)/fb/fbcmap.c \ $(top_srcdir)/mi/miinitext.c \ $(GLX_SRCS) @@ -82,16 +89,9 @@ Xdmx_LDADD = $(XORG_CORE_LIBS) \ $(GLX_LIBS) \ input/libdmxinput.a \ config/libdmxconfig.a \ + libfbcmap.a \ @DMXMODULES_LIBS@ -Xdmx_CFLAGS = \ - -DHAVE_DMX_CONFIG_H \ - $(DIX_CFLAGS) \ - $(GLX_INCS) \ - $(GLX_DEFS) \ - $(DMX_CFLAGS) \ - @DMXMODULES_CFLAGS@ - # Man page appmandir = $(APP_MAN_DIR) diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 4f711fde7..40c385434 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -1,12 +1,21 @@ bin_PROGRAMS = Xvfb +noinst_LIBRARIES = libfbcmap.a + +AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ + -DNO_HW_ONLY_EXTS \ + -DNO_MODULE_EXTS \ + $(XVFBMODULES_CFLAGS) \ + $(DIX_CFLAGS) SRCS = InitInput.c \ InitOutput.c \ lk201kbd.h \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ - $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap.c + $(top_srcdir)/mi/miinitext.c + +libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server +libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c Xvfb_SOURCES = $(SRCS) @@ -14,16 +23,8 @@ Xvfb_LDADD = $(XORG_CORE_LIBS) \ $(XVFB_LIBS) \ $(XSERVER_LIBS) \ $(EXTENSION_LIBS) \ - $(XVFBMODULES_LIBS) - -Xvfb_LDFLAGS = - -AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ - -DNO_MODULE_EXTS \ - -DXFree86Server \ - $(XVFBMODULES_CFLAGS) \ - $(DIX_CFLAGS) + $(XVFBMODULES_LIBS) \ + libfbcmap.a # Man page include $(top_srcdir)/cpprules.in diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index cce1fef94..b89761651 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -1,4 +1,10 @@ bin_PROGRAMS = Xnest +noinst_LIBRARIES = libfbcmap.a + +AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ + -DNO_HW_ONLY_EXTS \ + $(DIX_CFLAGS) \ + $(XNESTMODULES_CFLAGS) SRCS = Args.c \ Args.h \ @@ -37,23 +43,17 @@ SRCS = Args.c \ xnest-config.h \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ - $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap.c + $(top_srcdir)/mi/miinitext.c +libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap.c +libfbcmap_a_CFLAGS = $(AM_CFLAGS) -DXFree86Server Xnest_SOURCES = $(SRCS) Xnest_LDADD = $(XORG_CORE_LIBS) \ $(XNEST_LIBS) \ - $(XNESTMODULES_LIBS) - -Xnest_LDFLAGS = - -AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ - -DXFree86Server \ - $(DIX_CFLAGS) \ - $(XNESTMODULES_CFLAGS) + $(XNESTMODULES_LIBS) \ + libfbcmap.a EXTRA_DIST = os2Stub.c \ icon \ From 760a38c4c7ab66ae653d3acb92f5cda4bd44edd6 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 5 Feb 2007 03:39:36 +0200 Subject: [PATCH 14/20] XkbCopyKeymap: fix copy-and-waste accident When we reallocated modmap, we accidentally clobbered syms with the result, leaving syms definitely too small, and modmap also potentially too small (as well as not actually allocated anymore). --- xkb/xkbUtils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 400306a22..062159ec6 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -1220,7 +1220,7 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies) tmp = xalloc(src->max_key_code + 1); if (!tmp) return FALSE; - dst->map->syms = tmp; + dst->map->modmap = tmp; } memcpy(dst->map->modmap, src->map->modmap, src->max_key_code + 1); } From b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 6 Feb 2007 16:43:37 -0500 Subject: [PATCH 15/20] Fix for AMD cpu detection. Bug 9614, Dan Williams. Credit for the fixes in this patch goes to: Marco Gritti Jordan Crouse --- fb/fbpict.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 28503c0cf..39d8d9f35 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -189,6 +189,23 @@ fbCompositeSolidMask_nx8888x8888C (CARD8 op, fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1); + { + comp_image_t src, msk, dst; + comp_pixel_t src_pixel; + comp_format_t msk_format = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff }; + + src_pixel.red = src & 0x000000ff; + src_pixel.green = src & 0x0000ff00; + src_pixel.blue = src & 0x00ff0000; + src_pixel.alpha = src & 0xff000000; + + comp_image_init_solid (&src, &src_pixel); + comp_image_init_bits (&msk, maskLine, maskStride, &msk_format); + comp_image_init_bits (&dst, dstLine, dstStride, &dst_format); + + comp_over_c (src, msk, dst, srcX, srcY, mskX, mskY, dstX, dstY); + } + while (height--) { dst = dstLine; @@ -1516,7 +1533,9 @@ static unsigned int detectCPUFeatures(void) { features |= SSE; if (result & (1 << 26)) features |= SSE2; - if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) { + if ((features & MMX) && !(features & SSE) && + (strcmp(vendor, "AuthenticAMD") == 0 || + strcmp(vendor, "Geode by NSC") == 0)) { /* check for AMD MMX extensions */ unsigned int result; From 5a3334410367a2186b2c667fa1eb6cf0baf93e95 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 6 Feb 2007 17:11:01 -0500 Subject: [PATCH 16/20] Add new fbCompositeSrc_8888x0565mmx() function, based on patch by Dan Williams. Bug 9682. --- fb/fbmmx.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ fb/fbmmx.h | 12 +++++++ 2 files changed, 110 insertions(+) diff --git a/fb/fbmmx.c b/fb/fbmmx.c index f74930a39..5bbede10b 100644 --- a/fb/fbmmx.c +++ b/fb/fbmmx.c @@ -1338,6 +1338,104 @@ fbCompositeSrc_8888x8888mmx (CARD8 op, _mm_empty(); } +void +fbCompositeSrc_8888x0565mmx (CARD8 op, + PicturePtr pSrc, + PicturePtr pMask, + PicturePtr pDst, + INT16 xSrc, + INT16 ySrc, + INT16 xMask, + INT16 yMask, + INT16 xDst, + INT16 yDst, + CARD16 width, + CARD16 height) +{ + CARD16 *dstLine, *dst; + CARD32 *srcLine, *src; + FbStride dstStride, srcStride; + CARD16 w; + + CHECKPOINT(); + + fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1); + fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1); + + assert (pSrc->pDrawable == pMask->pDrawable); + + while (height--) + { + dst = dstLine; + dstLine += dstStride; + src = srcLine; + srcLine += srcStride; + w = width; + + CHECKPOINT(); + + while (w && (unsigned long)dst & 7) + { + __m64 vsrc = load8888 (*src); + ullong d = *dst; + __m64 vdest = expand565 ((__m64)d, 0); + + vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0); + + *dst = (ullong)vdest; + + w--; + dst++; + src++; + } + + CHECKPOINT(); + + while (w >= 4) + { + __m64 vsrc0, vsrc1, vsrc2, vsrc3; + __m64 vdest; + + vsrc0 = load8888(*(src + 0)); + vsrc1 = load8888(*(src + 1)); + vsrc2 = load8888(*(src + 2)); + vsrc3 = load8888(*(src + 3)); + + vdest = *(__m64 *)dst; + + vdest = pack565(over(vsrc0, expand_alpha(vsrc0), expand565(vdest, 0)), vdest, 0); + vdest = pack565(over(vsrc1, expand_alpha(vsrc1), expand565(vdest, 1)), vdest, 1); + vdest = pack565(over(vsrc2, expand_alpha(vsrc2), expand565(vdest, 2)), vdest, 2); + vdest = pack565(over(vsrc3, expand_alpha(vsrc3), expand565(vdest, 3)), vdest, 3); + + *(__m64 *)dst = vdest; + + w -= 4; + dst += 4; + src += 4; + } + + CHECKPOINT(); + + while (w) + { + __m64 vsrc = load8888 (*src); + ullong d = *dst; + __m64 vdest = expand565 ((__m64)d, 0); + + vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0); + + *dst = (ullong)vdest; + + w--; + dst++; + src++; + } + } + + _mm_empty(); +} + void fbCompositeSolidMask_nx8x8888mmx (CARD8 op, PicturePtr pSrc, diff --git a/fb/fbmmx.h b/fb/fbmmx.h index 34718e3c0..b3e4d71ef 100644 --- a/fb/fbmmx.h +++ b/fb/fbmmx.h @@ -130,6 +130,18 @@ void fbCompositeSrc_8888RevNPx8888mmx (CARD8 op, INT16 yDst, CARD16 width, CARD16 height); +void fbCompositeSrc_8888x0565mmx (CARD8 op, + PicturePtr pSrc, + PicturePtr pMask, + PicturePtr pDst, + INT16 xSrc, + INT16 ySrc, + INT16 xMask, + INT16 yMask, + INT16 xDst, + INT16 yDst, + CARD16 width, + CARD16 height); void fbCompositeSrc_8888RevNPx0565mmx (CARD8 op, PicturePtr pSrc, PicturePtr pMask, From 13568d2aa43da4216bbcb46e1125ff28c323ac54 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 6 Feb 2007 17:12:01 -0500 Subject: [PATCH 17/20] Revert "Fix for AMD cpu detection. Bug 9614, Dan Williams." This reverts commit b2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 since unrelated changes in fbpict.c broke the build. --- fb/fbpict.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 39d8d9f35..28503c0cf 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -189,23 +189,6 @@ fbCompositeSolidMask_nx8888x8888C (CARD8 op, fbComposeGetStart (pDst, xDst, yDst, CARD32, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, CARD32, maskStride, maskLine, 1); - { - comp_image_t src, msk, dst; - comp_pixel_t src_pixel; - comp_format_t msk_format = { 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff }; - - src_pixel.red = src & 0x000000ff; - src_pixel.green = src & 0x0000ff00; - src_pixel.blue = src & 0x00ff0000; - src_pixel.alpha = src & 0xff000000; - - comp_image_init_solid (&src, &src_pixel); - comp_image_init_bits (&msk, maskLine, maskStride, &msk_format); - comp_image_init_bits (&dst, dstLine, dstStride, &dst_format); - - comp_over_c (src, msk, dst, srcX, srcY, mskX, mskY, dstX, dstY); - } - while (height--) { dst = dstLine; @@ -1533,9 +1516,7 @@ static unsigned int detectCPUFeatures(void) { features |= SSE; if (result & (1 << 26)) features |= SSE2; - if ((features & MMX) && !(features & SSE) && - (strcmp(vendor, "AuthenticAMD") == 0 || - strcmp(vendor, "Geode by NSC") == 0)) { + if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) { /* check for AMD MMX extensions */ unsigned int result; From 876b806ec09d5ff0c6cd19df91006c4eefedfaa6 Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 6 Feb 2007 17:16:23 -0500 Subject: [PATCH 18/20] Reapply patch to fix AMD CPU detection --- fb/fbpict.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 28503c0cf..3ff609f77 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -1516,7 +1516,9 @@ static unsigned int detectCPUFeatures(void) { features |= SSE; if (result & (1 << 26)) features |= SSE2; - if ((result & MMX) && !(result & SSE) && (strcmp(vendor, "AuthenticAMD") == 0)) { + if ((features & MMX) && !(features & SSE) && + (strcmp(vendor, "AuthenticAMD") == 0 || + strcmp(vendor, "Geode by NSC") == 0)) { /* check for AMD MMX extensions */ unsigned int result; From 262b9b104a04e55969593ef96a16004e53ecd00a Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 6 Feb 2007 17:30:22 -0500 Subject: [PATCH 19/20] Use the new 8888x0565mmx function in fbpict.c --- fb/fbpict.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 3ff609f77..cd6cac277 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -1175,7 +1175,12 @@ fbComposite (CARD8 op, func = fbCompositeSrc_8888x0888; break; case PICT_r5g6b5: - func = fbCompositeSrc_8888x0565; +#ifdef USE_MMX + if (fbHaveMMX()) + func = fbCompositeSrc_8888x0565mmx; + else +#endif + func = fbCompositeSrc_8888x0565; break; default: break; @@ -1221,7 +1226,12 @@ fbComposite (CARD8 op, func = fbCompositeSrc_8888x0888; break; case PICT_b5g6r5: - func = fbCompositeSrc_8888x0565; +#ifdef USE_MMX + if (fbHaveMMX()) + func = fbCompositeSrc_8888x0565mmx; + else +#endif + func = fbCompositeSrc_8888x0565; break; default: break; From c4b7e9d1c16797c3e4b1200b40aceab5696a7fb8 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Tue, 6 Feb 2007 14:57:22 -0800 Subject: [PATCH 20/20] Add an RDTSC implementation to the x86 emulator. This instruction is being used in some debug VBIOSes. This implementation doesn't even try to be accurate. Instead, it just increments the counter by a fixed amount every time an rdtsc instruction in encountered, to avoid divides by zero. --- hw/xfree86/x86emu/ops2.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c index 7b0156aaa..8c6c53539 100644 --- a/hw/xfree86/x86emu/ops2.c +++ b/hw/xfree86/x86emu/ops2.c @@ -63,6 +63,40 @@ static void x86emuOp2_illegal_op( #define xorl(a,b) ((a) && !(b)) || (!(a) && (b)) +/**************************************************************************** +REMARKS: +Handles opcode 0x0f,0x31 +****************************************************************************/ +static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2)) +{ +#ifdef __HAS_LONG_LONG__ + static u64 counter = 0; +#else + static u32 counter = 0; +#endif + + counter += 0x10000; + + /* read timestamp counter */ + /* + * Note that instead of actually trying to accurately measure this, we just + * increase the counter by a fixed amount every time we hit one of these + * instructions. Feel free to come up with a better method. + */ + START_OF_INSTR(); + DECODE_PRINTF("RDTSC\n"); + TRACE_AND_STEP(); +#ifdef __HAS_LONG_LONG__ + M.x86.R_EAX = counter & 0xffffffff; + M.x86.R_EDX = counter >> 32; +#else + M.x86.R_EAX = counter; + M.x86.R_EDX = 0; +#endif + DECODE_CLEAR_SEGOVR(); + END_OF_INSTR(); +} + /**************************************************************************** REMARKS: Handles opcode 0x0f,0x80-0x8F @@ -2580,7 +2614,7 @@ void (*x86emu_optab2[256])(u8) = /* 0x2f */ x86emuOp2_illegal_op, /* 0x30 */ x86emuOp2_illegal_op, -/* 0x31 */ x86emuOp2_illegal_op, +/* 0x31 */ x86emuOp2_rdtsc, /* 0x32 */ x86emuOp2_illegal_op, /* 0x33 */ x86emuOp2_illegal_op, /* 0x34 */ x86emuOp2_illegal_op,