summaryrefslogtreecommitdiffstats
path: root/src/glx
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-173-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* glx: check memory allocations in __glXInitVertexArrayState()Juha-Pekka Heikkila2014-01-061-4/+23
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Simplify __glxGetMscRate, it only needs the screen, not a drawableLauri Kasanen2013-12-203-6/+4
| | | | | | | | | | Useful in its own right, but also needed for adaptive vsync. No regressions in the piglit glx-oml-sync-control-getmscrate test. Signed-off-by: Lauri Kasanen <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Ian Romanick <[email protected]>
* dri3: Rename DRI3_MAX_BACK to DRI3_NUM_BACKKeith Packard2013-12-202-7/+7
| | | | | | | | | It is the maximum number of back buffers, but the name is confusing and is easily read as the maximum back buffer index. Chage to DRI3_NUM_BACK to make the intended usage a bit clearer. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri3: Clean up struct dri3_drawableKeith Packard2013-12-201-5/+1
| | | | | | | | | Move the depth field up with width and height. Remove unused previous_time and frames fields. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri3: Free resources when drawable is destroyed.Keith Packard2013-12-202-2/+20
| | | | | | | Always nice to clean up after ourselves. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri3: Switch to libxshmfence version 1.1Keith Packard2013-12-202-3/+3
| | | | | | | | | | | libxshmfence v1.0 foolishly used 'int32_t *' for the fence type, which works when the fence is a linux futex. However, version 1.1 changes the exported datatype to 'struct xshmfence *' Require libxshmfence version 1.1 and switch the API around. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glx: Fix two identical null check errors in driSet/GetIntervalJuha-Pekka Heikkila2013-12-191-8/+12
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: add missing null check in dri2_bind_tex_imageJuha-Pekka Heikkila2013-12-181-2/+6
| | | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Add missing null check in dri2CreateDrawableJuha-Pekka Heikkila2013-12-181-2/+4
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)Dave Airlie2013-12-131-5/+38
| | | | | | | | | | | | | | | | | | | | | | | This patches add MESA_copy_sub_buffer support to the dri sw loader and then to gallium state tracker, llvmpipe, softpipe and other bits. It reuses the dri1 driver extension interface, and it updates the swrast loader interface for a new putimage which can take a stride. I've tested this with gnome-shell with a cogl hacked to reenable sub copies for llvmpipe and the one piglit test. I could probably split this patch up as well. v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review, add to p_screen doc comments. v3: finish off winsys interfaces, add swrast classic support as well. Reviewed-by: Jose Fonseca <[email protected]> Signed-off-by: Dave Airlie <[email protected]> swrast: add support for copy_sub_buffer
* glx: Add missing null check in DRI2WireToEventJuha-Pekka Heikkila2013-12-111-0/+2
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Add missing null check in gxl/dri2_glx.cJuha-Pekka Heikkila2013-12-031-0/+4
| | | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: Check malloc return value before accessing memory in glx/clientattrib.cJuha-Pekka Heikkila2013-12-031-0/+4
| | | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glx: don't fail out when no configs if we have visualsDave Airlie2013-11-211-1/+1
| | | | | | | | | | GLX 1.2 servers with no SGIX_fbconfigs exist (some citrix thing), and we fail glxinfo completely in those cases. CC: <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glx/tests: Provide __glXGetCurrentContext() stub when neededJon TURNEY2013-11-191-0/+8
| | | | | | | Refine 8c533022. Provide a stub __glXGetCurrentContext() function when $(DEFINES) are such that it is not a macro. Signed-off-by: Jon TURNEY <[email protected]>
* dri: Remove redundant createNewContext function from __DRIimageDriverExtensionKristian Høgsberg2013-11-121-45/+11
| | | | | | | | | | createContextAttribs is a superset of what createNewContext provides. Also remove the function typedef, since createNewContext is deprecated and no longer used in multiple interfaces. Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: "10.0" <[email protected]>
* glx: declare glx_screen struct to silence warningBrian Paul2013-11-111-0/+2
|
* glx: change query_renderer_integer() value param to unsignedBrian Paul2013-11-113-3/+4
| | | | | | | | | When this function was added, the returned value was signed in some places, unsigned in others. v2: also add unsigned in the unit test, per Ian. Reviewed-by: Ian Romanick <[email protected]>
* glx: Fix scons build.José Fonseca2013-11-111-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* glx: conditionaly build dri3 and present loader (v3)Armin K2013-11-092-2/+10
| | | | | | | | | | | | | | | This patch makes it possible to disable DRI3 if desired. Tested with: ./configure --disable-dri3 --with-dri-drivers=i965 \ --with-gallium-drivers= --disable-vdpau --disable-egl \ --disable-gbm --disable-xvmc Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71397 Cc: 10.0 <[email protected]>
* scons: Add dri2_query_renderer.c to sources.José Fonseca2013-11-081-0/+1
|
* dri3: Fix pixmap buf_id computation10.0-branchpointKeith Packard2013-11-071-1/+1
| | | | | | | Looks like some kind of rebase damage to me... Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Add a more informative debug message in a DRI3 error path.Eric Anholt2013-11-071-0/+7
|
* Add DRI3+Present loaderKeith Packard2013-11-076-1/+2195
| | | | | | | | | | | | Uses the __DRIimage loader interfaces. v2: Fix _XIOErrors when DRI3 isn't present (change by anholt). Apparently XCB just terminates your connection if you don't check for extensions before using them, instead of returning an error like you'd expect. Signed-off-by: Keith Packard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx/tests: Add unit tests for the DRI2 part of GLX_MESA_query_rendererIan Romanick2013-11-073-6/+314
| | | | | | | | After adding $(DEFINES) to AM_CPPFLAGS, the __glXGetCurrentContext wrapper function is no longer needed and causes compile errors. Using the correct defines causes it to be a macro! Signed-off-by: Ian Romanick <[email protected]>
* glx/tests: Add unit tests for the GLX part of GLX_MESA_query_rendererIan Romanick2013-11-073-1/+449
| | | | | | | | | | | These tests primarilly ensure that the functions added by this extension don't abuse other interfaces (e.g., glx_screen::query_renderer_integer) when provided bad data. These tests helped me find a couple small bugs in the initial implementation. Signed-off-by: Ian Romanick <[email protected]>
* glx/tests: Add GetGLXScreenConfigs_called flagIan Romanick2013-11-071-0/+4
| | | | | | Tests for the GLX_MESA_query_context extension will use this flag. Signed-off-by: Ian Romanick <[email protected]>
* glx/dri2: Add DRI2 support for GLX_MESA_query_rendererIan Romanick2013-11-075-1/+119
| | | | | | | | | | The new functions for this extension were added to a separate file (dri2_query_renderer.c) to facilitate unit testing. I tried putting them in dri2_glx.c, and it resulting in an unending chain of dependencies. It was the proverbial threading hanging from a sweater. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>