summaryrefslogtreecommitdiff
path: root/glx
AgeCommit message (Collapse)AuthorFilesLines
2011-03-28glx: minor cast cleanupAdam Jackson1-4/+3
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: dead variable removalAdam Jackson2-10/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Remove some obfuscatory macrosAdam Jackson6-25/+17
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Remove ->forceCurrent from the context vtableAdam Jackson5-45/+1
All the implementations of makeCurrent and forceCurrent are identical, so just use makeCurrent everywhere. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Reimplement context tagsAdam Jackson3-112/+24
This would let you do a constant-time context lookup, but if that's your performance problem you have two problems. Just use the context's XID as the tag value instead. In order to do this, we have to defer destroying a context until it actually goes unreferenced, as you're allowed to mention a context tag after you've (ostensibly) destroyed the context, as long as it's still your current context. Thus, change DestroyContext to merely mark the context as dead if it's a current context, and call down to actual resource destruction (and XID reclamation) in StopUsingContext. Also, stop trying to delete context state from DrawableGone. This was always broken, as GLX does not say that contexts are destroyed when their drawables are destroyed. But with the above change to defer context destruction, this would trigger a server crash on client exit as we'd free the context state twice. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Fix _glapi_add_dispatchAdam Jackson1-200/+20
We never need to generate stubs, because those conditions can't happen in the server. Yank that code out, but keep the bookkeeping for which extension functions are registered so the DRI driver doesn't get confused. As a pleasant bonus, we're now friendlier for environments like selinux that make runtime code generation difficult, and we're portable to more arches since we don't have to port the assembly stubs. Fixes the following clutter conformance tests (indirect rendering, llvmpipe driver): test-cogl-backface-culling test-cogl-materials test-cogl-readpixels test-cogl-texture-mipmaps test-cogl-texture-get-set-data test-cogl-viewport test-cogl-offscreen Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Flatten -DXFree86ServerAdam Jackson2-44/+0
Always defined by the makefile, so, just get rid of it. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Update some glapi commentsAdam Jackson1-32/+6
Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Lobotomize _glapi_get_proc_addressAdam Jackson1-34/+7
This isn't a meaningful thing in the indirect glx loader, so just warn if it ever happens and move on. But also, mark it PUBLIC, so if the driver does ever call it we merely warn instead of aborting because ld.so can't find the symbol. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Remove noop dispatch tableAdam Jackson4-6752/+2
We can never hit this, because the indirect GLX dispatch code always forces a current context and checks that it's non-NULL before calling into the dispatch table. If it's _not_ null, then _glapi_set_context will call into the driver, which is responsible for calling _glapi_set_dispatch to make sure the dispatch table is non-NULL. Also remove _glapi_set_warning_func and friends, since we can no longer call them even from dead code. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-23GLX: Support TLS with better portabilityJeremy Huddleston3-4/+4
AX_TLS detects when toolchains support __thread or __declspec(thread), but existing code assumed __thread. This also adds a check to configure.ac to error out if TLS is requested but unsupported. Found-by: Tinderbox http://tinderbox.x.org/builds/2011-03-22-0007 Regression-from: 82b1eaa6cad20f39dbf15573bdb3d62acbcd91f9 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Tom Fogal <tfogal@alumni.unh.edu> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-03-14glx: Use PATH_MAX as size of filename bufferChristopher James Halse Rogers1-1/+1
Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-03-14glx: Factor out glxProbeDriver function.Christopher James Halse Rogers5-110/+77
DRI, DRI2 and swrast all had near-identical driver probing logic. Pull it into glxdricommon. [ajax: warning fix] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-03-14glx: Add texbuffer2 support to swrastAdam Jackson1-0/+8
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: Remove unused _glapi_get_proc_nameAdam Jackson2-52/+0
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: Simplify _glapi_check_multithreadAdam Jackson1-45/+4
We can guarantee that the X server does not call DRI driver services from multiple threads, so _glapi_check_multithread need never do anything special. As a result, ThreadSafe is always false, so remove it and simplify expressions where it appeared to match. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: unifdef BEOS_THREADSAdam Jackson2-42/+1
We don't support BeOS, so, no. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: unifdef USE_XTHREADSAdam Jackson2-96/+1
xthreads is an ancient wrapper around a half dozen or so common thread APIs, including pthreads. Just use pthreads directly if you have it; if you don't, get with the times. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: unifdef SOLARIS_THREADSAdam Jackson2-94/+1
Solaris 7 and older are not supported; Solaris 8 and later have (and use) pthreads. Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08glx: Remove unused _glapi_get_proc_offset and friendsAdam Jackson2-126/+0
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-15glx: Work around wrong request lengths sent by mesaJulien Cristau2-9/+22
mesa used to send too long requests for GLXDestroyPixmap, GLXDestroyWindow, GLXChangeDrawableAttributes, GLXGetDrawableAttributes and GLXGetFBConfigsSGIX. Fixes a regression introduced in ec9c97c6bf70b523bc500bd3adf62176f1bb33a4 X.Org bug#33324 <https://bugs.freedesktop.org/show_bug.cgi?id=33324> Reported-by: xunx.fang@intel.com Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15glx: fix BindTexImageEXT length checkJulien Cristau2-2/+14
The request is followed by a list of attributes. X.Org bug#33449 Reported-and-tested-by: meng <mengmeng.meng@intel.com> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-02-15glx: fix request length check for CreateGLXPbufferSGIXJulien Cristau2-2/+2
The request is followed by an attribute list. Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-01-10glx: validate numAttribs field before using itJulien Cristau2-0/+45
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10glx: swap the request arrays entirely, not just half of themJulien Cristau1-5/+5
Various glx requests include a list of pairs of attributes. We were only swapping the first half. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10glx: check request length before swappingJulien Cristau1-5/+130
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10glx: validate request lengthsJulien Cristau2-9/+135
Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-10glx: make sure screen is non-negative in validGlxScreenJulien Cristau1-1/+1
Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
2010-12-31glx: warning fixesAdam Jackson1-1/+1
render2.c: In function ‘__glXDisp_Map2d’: render2.c:127: warning: ‘u1’ may be used uninitialized in this function render2.c: In function ‘__glXDisp_Map1d’: render2.c:90: warning: ‘u1’ may be used uninitialized in this function Remove unnecessary test, and change memcpy to memmove as all users were doing overlapping copies. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31GLX: DRI2: Fix mismatched-types warningDaniel Stone1-1/+1
All the DRI extension types have a base extension type as their first member to avoid exactly these types of warning. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Cyril Brulebois <kibi@debian.org>
2010-11-30glx: Remove swap barrier and hyperpipe supportAdam Jackson12-355/+1
Never implemented in any open source driver. The implementation assumed explicit DDX driver knowledge of how the client-side driver worked, since at the time the server's GL renderer was not a DRI driver. But now, it is, so any implementation of these should be done with additional DRI driver API, like the swap control extension. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-10Merge remote branch 'whot/for-keith'Keith Packard3-11/+4
2010-11-10Replace usage of DamageRegionAppend with DamageDamageRegion to fix reportAfter.Eric Anholt1-3/+1
In all these cases, any rendering implied by this damage has already occurred, and we want to get the damage out to the client. Some of the DamageRegionAppend calls were explicitly telling damage to flush the reportAfter damage out, but not all. Bug #30260. Fixes the compiz wallpaper plugin with client damage changed to reportAfter. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-11-11Remove more superfluous if(p!=NULL) checks around free(p).Cyril Brulebois3-9/+3
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); - } + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-11-11Remove more superfluous if(p!=NULL) checks around free(p).Cyril Brulebois1-2/+1
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) - free(E); + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-09-28glx: Fix use after free in DrawableGoneKristian Høgsberg1-6/+5
(note that nearly identical patches were proposed by Kristian and Chris) Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reported-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-09-13glxdriswrast: Use CreateGC, not CreateScratchGC.Jamey Sharp1-12/+8
Since this code was using CreateScratchGC and not GetScratchGC, FreeScratchGC would always call FreeGC, so just call it directly. As long as the drawable provided to CreateGC has the same screen and depth as were passed to CreateScratchGC, these functions are basically identical. There are two differences: - CreateGC gives you a non-null stipple. You probably don't care. - CreateGC passes the gcid and client to XACE. There are several internal GCs allocated in the server, and they all pass 0 and serverClient. I expect XACE will never reject that combination. The callers of createDrawable all verify that pDraw has the same screen that driScreen does. In short, this should have no behavioral change. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-08-19glx: Prevent NULL context deref in __glXGetDrawable() (bug 29184)Chris Wilson1-0/+7
During a SwapBuffers request, we may end up querying an unknown drawable outside of an active context, and so need to report this error prior to attempting to dereference the NULL context. Also fixes: [Bug 29184] glXSwapBuffers with no GLX context crashes X. https://bugs.freedesktop.org/show_bug.cgi?id=29184 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-07-13Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998Keith Packard2-4/+30
Because some EnterVT code needs to remove it self from the call chain, we need to fix all of the wrappers to correctly unwrap/rewrap during the call chain. This is a follow-on to the fix for bug 27114 in commit 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Jesse Barnes <jesse.barnes@intel.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-22dri2: avoid crash with old dri drivers.Dave Airlie1-1/+2
I built latest server and copied over a mesa 7.8 dri2 driver to use with it, and it crashed in here starting compiz. Looks like we need to validate the flush extension is registered before calling invalidate. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-11Get rid of xstrdup when argument is definitely non-NULLMikhail Gusarov2-4/+4
Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-10glxdriswrast bugfix: configure swapgc, not gc.Jamey Sharp1-1/+1
I got this wrong in e2929db7b737413cf93fbebdf4d15abdfebff05c. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-2/+2
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06Remove more superfluous if(p) checks around free(p)Mikhail Gusarov4-15/+10
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ -if(E) { free(E); } +free(E); Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard2-5/+8
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard2-9/+9
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp1-1/+0
TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-1/+1
Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13clientErrorValue is never used outside dix. Stop importing it.Jamey Sharp1-2/+0
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace dixChangeGC with calls directly to the right variant.Jamey Sharp1-2/+2
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>