summaryrefslogtreecommitdiffstats
path: root/src/glx
Commit message (Collapse)AuthorAgeFilesLines
* glx: Remove GLX_USE_APPLEGL cruft in extension string handlingIan Romanick2011-12-191-36/+2
| | | | | | | | | | | | | All of the extensions require that both libGL and either the server or the direct rendering driver (or both) enable the extension before it's advertised. It seems safe to assume that none of the other components on OS X will enable these extensions, so all the #ifdef blocks here just clutter the code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jeremy Huddleston <[email protected]>
* glx: GLX 1.4 does not require GLX_INTEL_swap_eventIan Romanick2011-12-191-1/+1
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Remove some extensions that are not, and never will be, supportedIan Romanick2011-12-192-20/+0
| | | | | | | | | | There are a few unsupported extensions (e.g., the ATI and NV float extensions) that are still in the list. There is some small chance that these may be supported some day. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Explicitly reject servers that only support GLX 1.0Ian Romanick2011-12-191-4/+6
| | | | | | | | | | | | | __glXInitialize calls AllocAndFetchScreenConfigs. AllocAndFetchScreenConfigs unconditionally sends a glXQuerySeverString request to the server. This request is only supported with GLX 1.1 or later, so we were already implicitly incompatible with GLX 1.0 servers. How many more similar bugs lurk in the code that nobody has noticed in years? Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Initialize share_xid in CreateContextIan Romanick2011-12-191-0/+1
| | | | | | | | | | | | | Previously the share_xid was only set in the glXImportContextEXT path, and it was left set to None in all of the other create-context paths. Fixes the piglit test glx-query-context-info-ext. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Make parameter types for __glXSendError match protocol typesIan Romanick2011-12-192-4/+6
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jeremy Huddleston <[email protected]>
* glx: Make __glXSendError available in non-Apple buildsIan Romanick2011-12-194-1/+2
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jeremy Huddleston <[email protected]>
* glx: Send DestroyContext protocol at the correct timesIan Romanick2011-12-196-26/+31
| | | | | | | | | | | | | | | | | | | | | | | Send the DestroyContext protocol immediately when glXDestroyContext is called, and never call it when glXFreeContextEXT is called. In both cases, either destroy the client-side structures or, if the context is current, set xid to None so that the client-side structures will be destroyed later. I believe this restores the behavior of the original SGI code. See src/glx/x11 around commit 5df82c8. The spec doesn't say anything about glXDestroyContext not really destroying imported contexts (it acts like glXFreeContextEXT instead), but that's what the original code did. Note that glXFreeContextEXT on a non-imported context does not destroy it either. Fixes the piglit test glx-free-context. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Don't segfault if glXGetContextIDEXT is pased a NULL contextIan Romanick2011-12-191-1/+1
| | | | | | | | | | Fixes the piglit test glx-get-context-id. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Fix handling of property list received from the server in ↵Ian Romanick2011-12-191-13/+32
| | | | | | | | | | | | | | | glXImportContextEXT The primary problem was that the number of reply bytes read is clamped to sizeof(propList), but the loop that processes the properties tries to examine all of the properties sent by the server. If the server sends 47,000 properties, we only read 3 but process all 47,000. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Don't segfault if xcb_glx_is_direct_reply returns NULLIan Romanick2011-12-191-1/+1
| | | | | | | | NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx: Don't create a shared context if the other context isn't the same kindIan Romanick2011-12-193-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each of the DRI, DRI2, and DRISW backends contain code like the following in their create-context routine: if (shareList) { pcp_shared = (struct dri2_context *) shareList; shared = pcp_shared->driContext; } This assumes that the glx_context *shareList is actually the correct derived type. However, if shareList was created as an indirect-rendering context, it will not be the expected type. As a result, shared will contain garbage. This garbage will be passed to the driver, and the driver will probably segfault. This can be observed with the following GLX code: ctx0 = glXCreateContext(dpy, visinfo, NULL, False); ctx1 = glXCreateContext(dpy, visinfo, ctx0, True); Create-context is the only case where this occurs. All other cases where a context is passed to the backend, it is the 'this' pointer (i.e., we got to the backend by call something from ctx->vtable). To work around this, check that the shareList->vtable->destroy method is the same as the destroy method of the expected type. We could also check that shareList->vtable matches the vtable or by adding a "tag" to glx_context to identify the derived type. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* drisw: remove unused variableMarek Olšák2011-12-171-1/+2
|
* Regenerate files from previous commitsIan Romanick2011-12-133-704/+690
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* glx: Fix indirect fallback when a non-Mesa GLX extension is present.Aaron Plattner2011-12-074-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When driCreateScreen calls driConvertConfigs to try to convert the configs for swrast, it fails and returns NULL. Instead of checking, it just clobbers psc->base.configs. Then, when the application asks for the FBconfigs, there aren't any. Instead, make the caller responsible for freeing the old modes lists if both calls to driConvertConfigs succeed. Without the second fix, glxinfo fails unless you run it with LIBGL_ALWAYS_INDIRECT: $ glxinfo name of display: :0.0 Error: couldn't find RGB GLX visual or fbconfig $ LIBGL_ALWAYS_INDIRECT=1 glxinfo name of display: :0.0 display: :0 screen: 0 direct rendering: No (LIBGL_ALWAYS_INDIRECT set) server glx vendor string: NVIDIA Corporation server glx version string: 1.4 [...] Signed-off-by: Aaron Plattner <[email protected]> Reviewed-and-tested-by: Ian Romanick <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* drisw: Enable SGI_make_current_read for direct contextsAdam Jackson2011-11-011-0/+2
| | | | | | | Equivalent to glXMakeContextCurrent, which had better already work since we advertise GLX 1.3. Signed-off-by: Adam Jackson <[email protected]>
* glx: Don't enable INTEL_swap_event unconditionallyAdam Jackson2011-10-281-1/+1
| | | | | | | | 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. Signed-off-by: Adam Jackson <[email protected]>
* apple: Implement applegl_unbind_contextJeremy Huddleston2011-10-241-0/+18
| | | | | | | | | glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context causing subsequent GLX requests to fail in peculiar ways http://xquartz.macosforge.org/trac/ticket/514 Signed-off-by: Jeremy Huddleston <[email protected]>
* apple: Use the correct (OpenGL.framework) glViewport and glScissor during initJeremy Huddleston2011-10-215-10/+15
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* apple: Silence some debug spewJeremy Huddleston2011-10-211-3/+3
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* dri2: Implement a throttle dri extension.Thomas Hellstrom2011-10-141-3/+50
| | | | | | | | | | | | | | | | | | | | The X server has limited throttle support on the server side, but doing this in the client has some benefits: 1) X server throttling is per client. Client side throttling can be done per drawable. 2) It's easier to control the throttling based on what client is run, for example using "driconf". 3) X server throttling requires drm swap complete events. So implement a dri2 throttling extension intended to be used by direct rendering clients. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* scons: MacOSX build fixes.José Fonseca2011-09-201-3/+0
|
* Remove unneeded xdamages header from dri2_glx.c.Matt Turner2011-09-191-1/+0
| | | | | | | It's needed for dri1 but not dri2. Signed-off-by: Matt Turner <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.Michel Dänzer2011-09-141-0/+4
| | | | | | | | | | | | | | | As already done in dri2CopySubBuffer(). Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=36371 https://bugs.freedesktop.org/show_bug.cgi?id=40533 Might fix: https://bugs.freedesktop.org/show_bug.cgi?id=32589 Signed-off-by: Michel Dänzer <[email protected]>
* GLX: Say something if we cannot connect via DRI2Andrew Deason2011-09-141-0/+1
| | | | See https://bugs.freedesktop.org/show_bug.cgi?id=40437
* Enable GLX_EXT_texture_from_pixmap in software.nobled2011-09-061-2/+81
| | | | | | Signed-off-by: nobled <[email protected]> Signed-off-by: Stuart Abercrombie <[email protected]> Signed-off-by: Stéphane Marchesin <[email protected]>
* dri: Remove all DRI1 driversIan Romanick2011-08-262-3/+3
| | | | | | | | | | Acked-by: Kristian Høgsberg <[email protected]> Acked-by: Marek Olšák <[email protected]> Acked-by: Alan Coopersmith <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]> Acked-by: Dave Airlie <[email protected]> Build-Tested-by: Jakob Bornecrantz <[email protected]> Tested-by: Eugeni Dodonov <[email protected]>
* glx: use a block to fix declarations after code warningBrian Paul2011-08-191-7/+9
|
* glx: Don't flush twice if we fallback to dri2CopySubBufferKristian Høgsberg2011-08-181-11/+10
| | | | | | | The flush extensions flush call indicates end of frame and should only be called once per frame. However, in the dri2SwapBuffer fallback path, we call flush and then call dri2CopySubBuffer, which also calls flush. Refactor the code to only call flush once.
* glx: move declarations before codeBrian Paul2011-08-091-3/+7
|
* glx/dri2: Paper over errors in DRI2Connect when indirectChristopher James Halse Rogers2011-08-051-0/+9
| | | | | | | | | | | | DRI2 will throw BadRequest for this when the client is not local, but DRI2 is an implementation detail and not something callers should have to know about. Silently swallow errors in this case, and just propagate the failure through DRI2Connect's return code. Note: This is a candidate for the stable release branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125 Signed-off-by: Christopher James Halse Rogers <[email protected]>
* glx: Avoid calling __glXInitialize() in driReleaseDrawables().Henri Verbeet2011-07-192-9/+4
| | | | | | | | | | | | | | This fixes a regression introduced by commit a26121f37530619610a78a5fbe5ef87e44047fda (fd.o bug #39219). Since the __glXInitialize() call should be unnecessary anyway, this is probably a nicer fix for the original problem too. NOTE: This is a candidate for the 7.10 and 7.11 branches. Signed-off-by: Henri Verbeet <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: [email protected]
* darwin: Include glxhash.c in libGL on darwinJeremy Huddleston2011-07-161-0/+1
| | | | | | Fixes a build regression introduced by 4df137691ee29bb812347fa2c5f19095243ede22 Signed-off-by: Jeremy Huddleston <[email protected]>
* drisw: Fix 24bpp software rendering, take 2Marc Pignat2011-07-151-0/+7
| | | | | | | | This patch add the support for 24bpp in the dri/swrast implementation. See http://bugs.freedesktop.org/show_bug.cgi?id=23525 Signed-off-by: Marc Pignat <marc at pignat.org> Signed-off-by: Brian Paul <[email protected]>
* Rename swrastg_dri to swrast_driMarek Olšák2011-07-141-3/+0
| | | | | I prefer it this way and it has been suggested earlier by others too. Opinions?
* GLX/DRI2: handle swap event swap count wrappingJesse Barnes2011-07-085-2/+108
| | | | | | | | | | | Create a new GLX drawable struct to track client related info, and add a wrap counter to it drawable and track it as we receive events. This allows us to support the full 64 bits of the event structure we pass to the client even though the server only gives us a 32 bit count. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* DRI2/GLX: use new swap event typesJesse Barnes2011-07-082-4/+4
| | | | | | | | Use the new swap event type so we get valid SBC values. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jeremy Huddleston <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
* scons: Actually add src/glx/SConscript.José Fonseca2011-07-011-0/+85
|
* drisw: Remove cargo culting that breaks GLX 1.3 ctorsAdam Jackson2011-06-291-4/+0
| | | | Signed-off-by: Adam Jackson <[email protected]>
* glx: Verify that drawable creation on the client side actually workedAdam Jackson2011-06-292-26/+63
| | | | | | ... and clean up if it didn't. Signed-off-by: Adam Jackson <[email protected]>
* glx: Alias glXFreeContextEXT to glXDestroyContextAdam Jackson2011-06-291-14/+6
| | | | Signed-off-by: Adam Jackson <[email protected]>
* glx: Fix compile.Stéphane Marchesin2011-06-201-1/+1
|
* glx: Bind to our context before __glXSetCurrentContextJeremy Huddleston2011-06-201-9/+16
| | | | | | | We want to bind to our context before calling __glXSetCurrentContext or messing with the gc rect in order to properly handle error conditions. Signed-off-by: Jeremy Huddleston <[email protected]>
* glx: Destroy the old context only after the new one has been boundJeremy Huddleston2011-06-201-7/+7
| | | | | | This fixes a regression introduced by 49d7e48b33264d94e30af6129c281b6acafa9427 Signed-off-by: Jeremy Huddleston <[email protected]>
* glx: Allow a context-specific fallback for glXGetProcAddressJeremy Huddleston2011-06-207-1/+20
| | | | | | | | In applegl, GLX advertises the same extensions provided by OpenGL.framework even if such extensions are not provided by glapi. This allows a client to get access to such API. Signed-off-by: Jeremy Huddleston <[email protected]>
* apple: Use apple_cgl_get_dl_handle() rather than opening a new handleJeremy Huddleston2011-06-171-22/+2
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* glx: implement drawable refcounting.Stéphane Marchesin2011-06-176-21/+37
| | | | | | | | | | | | The current dri context unbind logic will leak drawables until the process dies (they will then get released by the GEM code). There are two ways to fix this: either always call driReleaseDrawables every time we unbind a context (but that costs us round trips to the X server at getbuffers() time) or implement proper drawable refcounting. This patch implements the latter. Signed-off-by: Antoine Labour <[email protected]> Signed-off-by: Stéphane Marchesin <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* apple: Set the glapi dispatch table on context bindJeremy Huddleston2011-06-144-3/+4
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* glx: Remove check for gc->vtable->destroyJeremy Huddleston2011-06-131-2/+1
| | | | | | | gc->vtable->destroy is always set and is used unconditionally in other places, so don't bother checking for it first. Signed-off-by: Jeremy Huddleston <[email protected]>
* apple: applegl_destroy_context: Pass along the correct displayJeremy Huddleston2011-06-131-1/+1
| | | | Signed-off-by: Jeremy Huddleston <[email protected]>