summaryrefslogtreecommitdiffstats
path: root/src/glx
Commit message (Collapse)AuthorAgeFilesLines
* glx: drop obsolete _XUnlock_Mutex in __glXInitialize error pathEmil Velikov2014-04-091-3/+1
| | | | | | | | | | | | | | With commit 1f1928db001(glx: Drop _Xglobal_lock while we create and initialize glx display) we've split the big _Xglobal_lock handling in a more fine grained manner. Unfortunatelly we forgot to drop the unlock_mutex on the error paths, leading to undefined behaviour as the mutex is already unlocked. Cc: Kristian Høgsberg <[email protected]> Cc: "9.2 10.0 10.1" <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* automake: don't enable -Wl,--no-undefined on OpenBSDJonathan Gray2014-04-051-1/+1
| | | | | | | | | | | | | | | | OpenBSD does not have DT_NEEDED entries for libc by design, over concerns how the symbols would be referenced after changing the major version of the library. So avoid -no-undefined checks on OpenBSD as they will fail. v2: don't include the -no-undefined libtool option in the variable and change -Wl,--no-undefined references in Automake.inc as well. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76856 Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glx: Do not advertise buffer_age on dri2Adel Gadllah2014-04-021-1/+1
| | | | | | | | | | | | | Previously GLX_EXT_buffer_age has always been advertised as supported because both client_glx_support and client_glx_only where set. So it did not matter that direct_support is only set when running dri3 and we ended up always advertising it. Fix that by not setting client_glx_only for buffer_age in known_glx_extensions. Signed-off-by: Adel Gadllah <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glx: add extra null check in getFBConfigsJuha-Pekka Heikkila2014-04-021-0/+4
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: remove unused __glXClientInfo()Juha-Pekka Heikkila2014-04-021-13/+0
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* automake: ask the linker to do garbage collectionEmil Velikov2014-03-311-0/+1
| | | | | | | | | | | | | | By doing GC the linker removes all the symbols that are not referenced and/or used by the final library. This results in a saving of ~100K up-to ~600K per (stripped) binary (classic vs gallium drivers). If interested one can ask the compiler to print the sections that are removed using -Wl,--print-gc-sections. v2: Check if ld supports the flag before using it. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> (v1)
* automake: add -Wl,--no-undefined to all librariesEmil Velikov2014-03-311-1/+3
| | | | | | | | | ... apart from the dri drivers. With this final change we can build mesa without fear that the resulting libraries will have unresolved symbols. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* loader: add special logic to distinguish nouveau from nouveau_vieuxIlia Mirkin2014-03-191-10/+10
| | | | | | | | | | | There are a lot of different pci ids supported by nouveau, and more are added all the time. The relevant distinguisher between drivers is the chipset id. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: "10.1" <[email protected]>
* glx: Fix incorrect pdp assignment in dri2_bind_context().Charmaine Lee2014-03-181-1/+2
| | | | | | | pdp should be set to dpyPriv->dri2Display. Fixes blank frame failure running glretrace ClearView. Reviewed-by: Brian Paul <[email protected]>
* dri3: Add GLX_EXT_buffer_age supportAdel Gadllah2014-03-137-3/+55
| | | | | | | | | | | v2: Indent according to Mesa style, reuse sbc instead of making a new swap_count field, and actually get a usable back before returning the age of the back (fixing updated piglit tests). Changes by anholt. Signed-off-by: Adel Gadllah <[email protected]> Reviewed-by: Robert Bragg <[email protected]> (v1) Reviewed-by: Adel Gadllah <[email protected]> (v2) Reviewed-by: Eric Anholt <[email protected]>
* dri3: Prefer the last chosen back when finding a new one.Eric Anholt2014-03-131-10/+7
| | | | | | | | | | | | | | With the buffer_age code, I need to be able to potentially call this more than once per frame, and it would be bad if a new special event showing up meant I chose a different back mid-frame. Now, once we've chosen a back for the frame, another find_back will choose it again since we know that it won't have ->busy set until swap. Note that this makes find_back return a buffer id instead of a backbuffer index. That's kind of a silly distinction anyway, since it's an identity mapping between the two (it's the front buffer that is at an offset). Reviewed-By: Adel Gadllah <[email protected]>
* glx: cleanup unneeded headersEmil Velikov2014-03-117-11/+1
| | | | | | | | | | | - xf86dri.h is the old dri1 header, not required by dri2 nor dri3 - fold xf86drm.h inclusiong inside dri2.h - dri3_glx does not have any drm specific dependencies - glapi.h is not required by the dri2 and dri3 codepaths Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jon TURNEY <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/tests: honor enable-driglx-direct configure flagJon TURNEY2014-03-111-0/+4
| | | | | | | | | | | | | | | Recent commit fixed build issues in dri2_query_renderer.c by wrapping in defined(direct_rendering) && !defined(applegl) This patch targets the query_renderer tests, so that make check passes on platforms such as hurd and cygwin. v2: (Emil) - Rebase and update commit message. Signed-off-by: Jon TURNEY <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* configure: use LIB_EXT rather than hardcoded .soEmil Velikov2014-03-111-4/+4
| | | | | | | | | | | | | | | Some platforms different library extension - dll, dylib, a. Honor that when we are creating the required links. Rename LIB_EXTENSION to LIB_EXT while we're here. With libglapi linking aside, building classic drivers on non-linux platforms should be possible now. v2: Resolve conflicts. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jon TURNEY <[email protected]>
* automake: do not use symbols names for static glapi.laEmil Velikov2014-03-111-5/+3
| | | | | | | | | | | | In the cases where one links against the static glapi.la there is no need to create temporary variables only to explicitly link agaist it. Instead use SHARED_GLAPI_LIB to explicitly indicate when one is building and linking with the shared glapi provider. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jon TURNEY <[email protected]>
* configure: remove old makefile variablesEmil Velikov2014-03-111-5/+4
| | | | | | | | | | | | All the variables were used before the automake conversion and do not make sense (nor are used) currently. Replace GL_LIB_NAME with lib$(GL_LIB).$(LIB_EXTENSION) for apple-glx. The build has been broken for ages, but this will ease the recovery process as it happens. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jon TURNEY <[email protected]>
* glx_pbuffer: Refactor GetDrawableAttributeAdel Gadllah2014-03-071-5/+6
| | | | | | | | Move the pdraw != NULL check out so that they don't have to be duplicated. Signed-off-by: Adel Gadllah <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove remaining uses of _glthread_GetID()Brian Paul2014-03-051-10/+0
| | | | | | | | | | | | | | | It was really only used in the radeon driver for a debug printf. And evidently, libGL.so referenced it just to work around some sort of linker issue. This patch removes the two calls to the function and the function itself. Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'. Though, the missing symbol doesn't cause any issues on my system but it does cause glxinfo to fail on one of our test systems. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove empty glthread.h fileBrian Paul2014-03-031-1/+0
| | | | Reviewed-by: José Fonseca <[email protected]>
* glx/dri2: fix build failure on HURDJulien Cristau2014-03-031-0/+5
| | | | | | | Patch from Debian package. Cc: "10.0 10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/apple: Fixed glx context memory leak in case of failure.Siavash Eliasi2014-02-281-0/+1
| | | | | Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Jeremy Huddleston Sequoia: <[email protected]>
* glx: Fix the GLXFBConfig attrib sort prioritiesFredrik Höglund2014-02-261-7/+4
| | | | | | | | | The sort priorites for GLX_SAMPLES and GLX_SAMPLE_BUFFERS are not defined in GL_ARB_multisample, but they are defined in the GLX 1.4 specification. Cc: "9.2 10.0 10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx: Fix the default values for GLXFBConfig attributesFredrik Höglund2014-02-261-7/+2
| | | | | | | | | | | | The default values for GLX_DRAWABLE_TYPE and GLX_RENDER_TYPE are GLX_WINDOW_BIT and GLX_RGBA_BIT respectively, as specified in the GLX 1.4 specification. This fixes the glx-choosefbconfig-defaults piglit test. Cc: "9.2 10.0 10.1" <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/drisw: use the implemented version of __DRIswrastLoaderExtensionEmil Velikov2014-02-231-5/+6
| | | | | | | | ... over the one provided by the headers. Explicitly set extension members to improve clarity. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/dri: use the implemented version of __DRIdamageExtensionEmil Velikov2014-02-231-2/+3
| | | | | | | | ... over the one provided by the headers. Explicitly set extension members to improve clarity. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/dri_common: use the implemented version of __DRIsystemTimeExtensionEmil Velikov2014-02-231-3/+4
| | | | | | | | ... over the one provided by the headers. Explicitly set extension members to improve clarity. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/dri: use the implemented version of __DRIgetDrawableInfoExtensionEmil Velikov2014-02-231-2/+3
| | | | | | | ... over the one provided by the headers. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/dri3: set the implemented version of __DRIimageLoaderExtensionEmil Velikov2014-02-231-3/+4
| | | | | | | | | ... over the one provided by the spec. Currently both versions are identical, but that is not guaranteed to be the case in the future. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx/dri2: set the implemented version of __DRIdri2LoaderExtensionEmil Velikov2014-02-231-8/+10
| | | | | | | | ... over the version number provided by the headers. Explicitly set extension members to improve clarity. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx: Add missing null check in __glX_send_client_info()Juha-Pekka Heikkila2014-02-071-0/+4
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Add some missing null checks in glx_pbuffer.cJuha-Pekka Heikkila2014-02-071-4/+15
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Add missing null check in __glXCloseDisplayJuha-Pekka Heikkila2014-02-071-1/+2
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Add missing null checks in glxcmds.cJuha-Pekka Heikkila2014-02-071-8/+20
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Pass NULL DRI drawables into the DRI driver for None GLX drawablesKristian Høgsberg2014-02-062-5/+15
| | | | | | | | | | | | | | GLX_ARB_create_context allows making a GLX context current with None drawable and readables, but this was never implemented correctly in GLX. We would create a __DRIdrawable for the None GLX drawable and pass that to the DRI driver and that would somehow work. Now it's somehow broken. The way this should have worked is that we pass a NULL DRI drawable to the DRI driver when the GLX user calls glXMakeContextCurrent() with None for drawable and readables. https://bugs.freedesktop.org/show_bug.cgi?id=74143 Signed-off-by: Kristian Høgsberg <[email protected]>
* dri3: Track current Present swap mode and adjust buffer countsKeith Packard2014-01-302-24/+35
| | | | | | | | | | | | | | | | | | | | | | | | This automatically adjusts the number of buffers that we want based on what swapping mode the X server is using and the current swap interval: swap mode interval buffers copy > 0 1 copy 0 2 flip > 0 2 flip 0 3 Note that flip with swap interval 0 is currently limited to twice the underlying refresh rate because of how the kernel manages flipping. Moving from 3 to 4 buffers would help, but that seems ridiculous. v2: Just update num_back at the point that the values that change num_back change. This means we'll have the updated value at the point that the freeing of old going-to-be-unused backbuffers happens, which might not have been the case before (change by anholt, acked by keithp). Signed-off-by: Keith Packard <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888Keith Packard2014-01-301-0/+1
| | | | | | | | | | | | | | | | The __DRIimage createImageFromFds function takes a fourcc code, but there was no fourcc code that match __DRI_IMAGE_FORMAT_SARGB8. This adds a define for that format, adds a translation in DRI3 from __DRI_IMAGE_FORMAT_SARGB8 to __DRI_IMAGE_FOURCC_SARGB8888 and then adds translations *back* to __IMAGE_FORMAT_SARGB8 in both the i915 and i965 drivers. I'll refrain from comments on whether I think having two separate sets of format defines in dri_interface.h is a good idea or not... Fixes piglit glx-tfp and glx-visuals-depth Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri3: Flush XCB before blocking for special eventsKeith Packard2014-01-301-0/+2
| | | | | | | | XCB doesn't flush the output buffer automatically, so we have to call xcb_flush ourselves before waiting. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri3: Enable GLX_INTEL_swap_eventKeith Packard2014-01-301-17/+1
| | | | | | | | | Now that we're tracking SBC values correctly, and the X server has the ability to send the GLX swap events from a PresentPixmap request, enable this extension. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri3: Fix dri3_wait_for_sbc to wait for completion of requested SBCKeith Packard2014-01-301-16/+39
| | | | | | | | | | | | | | | | | Eric figured out that glXWaitForSbcOML wanted to block until the requested SBC had been completed, which means to wait until the PresentCompleteNotify event for that SBC had been received. This replaces the simple sleep(1) loop (which was bogus) with a loop that just checks to see if we've seen the specified SBC value come back in a PresentCompleteNotify event yet. The change is a bit larger than that as I've broken out a piece of common code to wait for and process a single Present event for the target drawable. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri3: Track full 64-bit SBC numbers, instead of just 32-bitsKeith Packard2014-01-302-20/+30
| | | | | | | | | | Tracking the full 64-bit SBC values makes it clearer how those values are being used, and simplifies the wait_msc code. The only trick is in re-constructing the full 64-bit value from Present's 32-bit serial number that we use to pass the SBC value from request to event. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* build: Share the all-local rule for linking libraries into the build dirKristian Høgsberg2014-01-291-6/+1
| | | | | | | | | | This consolidates how we link the libraries into the build directory. It works for lib_LTLIBRARIES but not custom shared libraries like DRI drivers or gallium state trackers which needs special casing (cf dri mega drivers, for example) Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* loader: Add missing \n on message printingEmil Velikov2014-01-271-4/+4
| | | | | | | | Cover both loader and glx/dri_glx Drop \n from the default loader logger Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* dri: Reuse dri_message to implement our other message handlers.Eric Anholt2014-01-272-63/+4
| | | | | Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri: Fix the logger error message handling.Eric Anholt2014-01-273-3/+34
| | | | | | | | | | | Since the loader changes, there has been a compiler warning that the prototype didn't match. It turns out that if a loader error message was ever thrown, you'd segfault because of trying to use the warning level as a format string. Reviewed-by: Keith Packard <[email protected]> Tested-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri2: Trust our own driver name lookup over the server's.Eric Anholt2014-01-272-2/+12
| | | | | | | | | | This allows Mesa to choose to rename driver .sos (or split drivers), without needing a flag day with the corresponding 2D driver. v2: Undo the loader-only-for-dri3 change. Reviewed-by: Keith Packard <[email protected]> [v1] Reviewed-by: Kristian Høgsberg <[email protected]> [v1]
* dri2: Open the fd before loading the driver.Eric Anholt2014-01-271-14/+14
| | | | | | | | I want to stop trusting the server for the driver name, and instead decide on our own based on the fd, so I needed this code motion. Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri3: Fix two little memory leaks.Eric Anholt2014-01-271-2/+2
| | | | | | | Noticed when valgrinding an unrelated bug. Reviewed-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* glx: link loader util lib only when building with dri3Emil Velikov2014-01-231-1/+1
| | | | | | | | | | | | | | | | Otherwise we pull libudev as a dependency and crash games/programs that ship their own version of libudev. Either way we should link the loader lib only when needed. This fixes a regression caused by commit eac776cf779b705cbfb8d41812f1d171fb09c76f Author: Emil Velikov <[email protected]> Date: Sat Jan 11 02:24:43 2014 +0000 glx: use the loader util lib Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73854 Signed-off-by: Emil Velikov <[email protected]>
* glx: use the loader util libEmil Velikov2014-01-185-153/+7
| | | | | | | | | | v2 * Set logger to ErrorMessageF. Spotted by Kristian Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* loader: introduce the loader util libEmil Velikov2014-01-182-0/+2
| | | | | | | | | | | | | | | | | | | | | | All the various window system integration layers duplicate roughly the same code for figuring out device and driver name, pci-id's, etc. Which is sad. So extract it out into a loader util lib. v2 (Emil) * Separate the introduction of libloader from the code de-duplication. * Strip out non-pci devices support. * Add scons + Android build system support. * Add VISIBILITY_CFLAGS to avoid exporting the loader funcs. v3 (Emil) * PIPE_OS_ANDROID is undefined at this scope, use ANDROID * Make sure we define _EGL_NO_DRM when building only swrast Signed-off-by: Rob Clark <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Ian Romanick <[email protected]>