summaryrefslogtreecommitdiff
path: root/glx
AgeCommit message (Collapse)AuthorFilesLines
2013-09-11glx: Fill in some missing attributes from DoGetFBConfigsAdam Jackson1-2/+12
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Remove a dead commentAdam Jackson1-4/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Catch another failure case in drawable creationAdam Jackson1-0/+4
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Remove screen number from __GLXconfigAdam Jackson1-2/+0
Not used. There's no real reason to match against this instead of matching against fbconfig or visual ID anyway. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Remove pixmapMode from __GLXconfigAdam Jackson1-2/+0
This has never been filled in with anything meaningful afaict, and you can't get to it from the client in any event. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Remove support for NV_vertex_program and NV_fragment_programAdam Jackson1-4/+0
Mesa doesn't implement these anymore, never really did outside of swrast anyway. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: realloc style fix in RenderLargeAdam Jackson1-9/+6
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Eliminate a small malloc from QueryContextAdam Jackson1-15/+8
No reason to have that be a failure path. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Handle failure to create the pixmap backing the pbufferAdam Jackson1-0/+2
We happen not to sanitize the width/height we pass to CreatePixmap here, oops. It's not exploitable, but it's certainly a crash, so let's just throw BadAlloc instead. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Implement GLX_PRESERVED_CONTENTS drawable attributeAdam Jackson1-2/+10
We back pixmaps with pbuffers so they're never actually clobbered. Say so when asked. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Implement GLX_FBCONFIG_ID in GetDrawableAttributesAdam Jackson1-1/+4
Required by GLX 1.4, section 3.3.6, "Querying Attributes". Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Implement GLX_{WIDTH,HEIGHT} in GetDrawableAttributesAdam Jackson1-1/+7
Required by GLX 1.4, section 3.3.6, "Querying Attributes". Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Compute number of attributes in GetDrawableAttributes on the flyAdam Jackson1-9/+11
This doesn't have any effect yet, but is needed to properly build the reply for pbuffers. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Style fixesAdam Jackson1-3/+7
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Pull GLX vendor string out of __GLXscreenAdam Jackson3-5/+3
Given how we're currently implementing GLX this can't meaningfully vary per-screen. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11glx: Remove unused bits from the context structAdam Jackson1-1/+0
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10dri2: Don't bother with xf86LoaderCheckSymbol("DRI2Connect")Adam Jackson1-2/+1
The DRI2 code is now built-in to the server, even for Xorg. The only thing this could protect against is trying to run a libglx built with DRI2 support against an Xorg built without it, which is firmly in "doctor it hurts when I do this" territory. Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-08-06Replace INCLUDES with AM_CPPFLAGSPeter Hutterer1-2/+2
newer automake gets quite noisy about this. hw/xfree86/ddc/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') and many more of these. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-05-07os: Use ErrorFSigSafe from FatalError and it's friendsPeter Hutterer2-2/+2
Backtrace logging etc. is already sigsafe, but the actual FatalError message in response is not yet, leading to amusing logs like this: (EE) Segmentation fault at address 0x0 (EE) BUG: triggered 'if (inSignalContext)' (EE) BUG: log.c:499 in LogVMessageVerb() (EE) Warning: attempting to log data in a signal unsafe manner while in signal context. Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or ErrorFSigSafe(). The offending log format message is: Fatal server error: Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24__glXDRIscreenProbe: free screen when DRI2Connect fails, instead of leaking itAlan Coopersmith1-1/+1
Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 V2: goto existing error handler, instead of replicating more of it here Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2013-04-24__glXDRIscreenCreateContext: free context on failure, instead of leaking itAlan Coopersmith1-2/+6
Reported with other leaks found by cppcheck in bugzilla #50281 https://bugs.freedesktop.org/show_bug.cgi?id=50281 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-03-18glx: fix uninitialized var in __glXDRIscreenProbePiotr Dziwinski1-0/+2
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59825 Signed-off-by: Piotr Dziwinski <piotrdz@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18GLX/DRI2: Do not expose INTEL_swap_event without swap controlZack Rusin1-2/+2
Swap events depent on the implementation of ScheduleSwap. By unconditionally enabling GLX_INTEL_swap_event we're breaking the system with drivers that don't support it because the apps are forever stuck waiting for an event that will never be delivered. So lets enable the extension only if the hooks it depends on are actually there. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18Full support of sRGB capable fbconfigs.Tomasz Lis6-5/+42
Changes to correctly initialize the sRGB capability attribute and transfer it between XServer and the client. Modifications include extension string, transferring visual config attribs and fbconfig attribs. Also, attribute is initialized in the modules which do not really use it (xquartz and xwin). This version advertises both ARB and EXT strings, and initializes the capability to default value of FALSE. It has corrected required GLX version and does not influence swrast. The sRGB capable attribute is attached only to those configs which do have this capability. Both ARB and EXT versions share the same GLX extension enabling bit. Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-19Merge remote-tracking branch 'yselkowitz/master'Keith Packard8-34/+34
I checked this patch with diff -w to check that it only affected whitespace.
2012-12-17glx/dri2: initialise api to avoid indirect rendering failing randomlyDave Airlie1-1/+1
Running glxinfo under indirect rendering would randomly fail against the intel driver, as it would create a context with no attribs, and then the api value would be passed to the driver uninitialised. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-12-05Fix formatting of address operatorsYaakov Selkowitz8-34/+34
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-08-15glx: Skip multisampled configs when matching pre-existing X visuals.Paul Berry1-0/+3
In __glXScreenInit() we generate the set of GLX visuals in two steps: first we match each pre-existing X visual with a corresponding FBConfig, then we generate a new X visual to correspond to all the remaining FBConfigs. The first step is used for the two default 24-bit visuals (true color and direct color) and for the 32-bit visual. If windowsystem multisampling is enabled in Mesa, we need to ensure that none of these three visuals gets matched to a multisampled config. Fixes a bug with windowsystem multisampling in gnome-shell. If the X server happens to match up a multisampled FBConfig to the 32-bit visual, gnome-shell will try to use it to read pixels from alpha-blended windows (such as gnome-terminal), resulting in no window appearing on screen. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-08-06Merge remote-tracking branch 'jturney/master'Keith Packard2-2/+2
2012-08-03glx: Do not report the GLX_INTEL_swap_event extension for indirect swrastJon TURNEY1-1/+1
Commit 84956ca4 bogusly adds GLX_INTEL_swap_event to the extensions reported by swrast. "DRI2 supports this now - and already enables it explicitly - but drisw does not and should not. Otherwise toolkits like clutter will only ever SwapBuffers once and wait forever for an event that's not coming." (A similar bug for direct swrast is already fixed in mesa commit 25620eb1) (Note that this may be papering over the cracks somewhat, as if we do report GLX_INTEL_swap_event, some clutter apps fail with GLXBadDrawable calling GLXChangeDrawableAttributes to change the setting of GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK in the GLX_EVENT_MASK, apparently after the drawable is destroyed, which suggests a bug with GLXDrawable lifetimes) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-08-03glx: Don't note GLX_INTEL_swap_event as being required by GLX 1.4, it isn't.Jon TURNEY1-1/+1
Don't note GLX_INTEL_swap_event as being required by GLX 1.4, it isn't. (This data is not currently used in the server) (A similar change is made in mesa commit d3f7597bc9f6d5) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-07-25glx: drop GLX_LIBS from X server and workaround sdksyms.Dave Airlie1-0/+1
We've had reports of two copies of the GLX bits, one in the server and one in libglx.so causing problems, I didn't understand why the X server needed a copy so drop it, however then we have to fix a missing GlxExtensionInit that comes from sdksyms, so work around it by moving that one declaration into a header that sdksyms doesn't scan. Thanks to Jon Turney for debugging the actual problem. (copyright header from extinit.h that seems most appropriate put on top). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52402 Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-13glx: Fix checking GL versionBartosz Brachaczek1-1/+1
Signed-off-by: Bartosz Brachaczek <b.brachaczek@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2012-07-13glx/dri2: don't return NULL in a function with no return.Dave Airlie1-1/+1
Reported by gcc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: use correct define from dri attribs.Dave Airlie1-1/+1
Looks like idr renamed this and pushed the wrong one. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: fix incorrect == vs =Dave Airlie1-1/+1
glxdri2.c:486: warning: statement with no effect Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: fix typo in the notification reset for robustness.Dave Airlie1-1/+1
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx: pass screen into the convert functionDave Airlie1-2/+3
when robustness is enabled, this is required. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-12Merge remote-tracking branch 'jturney/xwin-extmod-removal-fixes'Keith Packard2-4/+1
2012-07-12glx: Free DRI2 drawable reference to destroyed GLX drawable.Michel Dänzer1-2/+6
Otherwise the reference can lead to use after free in __glXDRIinvalidateBuffers(). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-12Restore extern to the declaration of __glXDRISWRastProviderJon TURNEY1-1/+1
b86aa74 dropped the 'extern' from the declaration of __glXDRISWRastProvider This turns out to be important to me, as without it, the final link only gets the tentative definition of __glXDRISWRastProvider implied by the declaration, and not the proper one from glxdriswrast.c, presumably because nothing else references anything in the object that file generates. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-12Revert bogus GlxPushProvider() in commit a1d41e3Jon TURNEY1-3/+0
a1d41e3 "Move extension initialisation prototypes into extinit.h" also includes a change to GlxExtensionInit to install the swrast GLX provider. Since b86aa74 "GLX: Insert swrast provider from GlxExtensionInit" already does this (correctly, by installing the swrast provider at the end of the chain, rather than at the beginning), and since this would seem to have the effect of making the swrast provider the most preferred provider, I'm guessing this wasn't intended. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-10Move DRI1 from external module to built-inDaniel Stone1-2/+0
Rather than building the tiny amount of code required for XFree86-DRI as an external module, build it in if it's enabled at configure time. v2: Fix test/Makefile.am to only link libdri.la if DRI is set Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com> fixup for DRI1 move Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Move extension initialisation prototypes into extinit.hDaniel Stone2-2/+4
Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to hold all our extension initialisation prototypes, rather than duplicating them everywhere. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09GLX: Insert swrast provider from GlxExtensionInitDaniel Stone2-1/+8
Rather than making poor old miinitext.c do it, including making DMX have fake symbols just to keep it happy. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Stéphane Marchesin <stephane.marchesin@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Add a common ARRAY_SIZE macro to dix.hDaniel Stone1-2/+0
Does what it says on the box, replacing those from Xi/ and glx/. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Use C99 designated initializers in extension EventsAlan Coopersmith1-2/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in glx RepliesAlan Coopersmith3-55/+75
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use calloc to zero fill buffers being allocated for replies & eventsAlan Coopersmith1-2/+2
Ensures padding bytes are zero-filled Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Remove unneccesary casts from WriteToClient callsAlan Coopersmith6-40/+37
Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>