summaryrefslogtreecommitdiffstats
path: root/src/glx
Commit message (Collapse)AuthorAgeFilesLines
* dri: Emit a critical error if the swrast driver fails to load.Carl Worth2012-02-081-2/+4
| | | | | | | | | | | | | | | | Something has gone wrong if swrast is requested but cannot be loaded. The user really should be made aware of this, (and instructed to set LIBGL_DEBUG for more details). The wording of this error message is updated from "reverting to indirect rendering" to the more objectively descriptive "failed to load driver: swrast". The former wording makes assumptions about what the calling code will decide to do next, rather than simply describing what went wrong within the current function. The new wording is consistent with the critical errors recently added for hardware drivers that fail to load. Reviewed-by: Eugeni Dodonov <[email protected]>
* dri: Emit a critical error if a named driver fails to load.Carl Worth2012-02-082-0/+4
| | | | | | | | | Something has gone wrong if we were asked to load a driver of a specific name, but it failed to load for some reason. The user really should be made aware of this, (and instructed to set LIBGL_DEBUG for more details). Reviewed-by: Eugeni Dodonov <[email protected]>
* dri: Add a CriticalErrorMessageF macro.Carl Worth2012-02-082-0/+26
| | | | | | | | | | | | | Sometimes an error is so sever that we want to print it even when the user hasn't specifically requested debugging by setting LIBGL_DEBUG. Add a CriticalErrorMessageF macro to be used for this case. (The error message can still be slienced with the existing LIBGL_DEBUG=quiet). For critical error messages we also direct the user to set the LIBGL_DEBUG environment variable for more details. Reviewed-by: Eugeni Dodonov <[email protected]>
* dri: Clarify comments on InfoMessageF and ErrorMessageF macros.Carl Worth2012-02-081-1/+6
| | | | | | | | | | | The description of ErrorMessageF was misleading in the case of LIBGL_DEBUG being unset, (the previous comment could be understood to mean the error should be printed, but the code does not print in this case). InfoMessageF previously had no comment at all. Reviewed-by: Eugeni Dodonov <[email protected]>
* Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the ↵Jon TURNEY2012-02-061-0/+1
| | | | | | | | | | | server does There is a mismatch between the way the X server and GLX library calculates the image size for format GL_DEPTH_STENCIL(|_NV|_EXT) See https://bugs.freedesktop.org/show_bug.cgi?id=30102 Signed-off-by: Jon TURNEY <[email protected]>
* Revert "Always build shared glapi"Matt Turner2012-01-245-0/+15
| | | | | | | | | | | This reverts commit adefee50d954151f76150af80207081ae3c247d9. Shared glapi was never tested with --enable-xlib-glx and turns out to cause a lot of problems. Conflicts: configure.ac
* Always build shared glapiMatt Turner2012-01-205-15/+0
| | | | | | | | libglapi.so, libGL.so, libGLESv2.so, libGLESv1_CM.so must all come from the same version of Mesa or bad things may happen. Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Matt Turner <[email protected]>
* scons: Fix libGL.so build.Roland Scheidegger2012-01-131-0/+1
|
* glx/dri: Initialize api even if num_attribs == 0.Kenneth Graunke2012-01-111-1/+3
| | | | | | | | | | | | Both dri2_create_context_attribs and drisw_create_context_attribs call dri2_convert_glx_attribs, expecting it to fill in *api on success. However, when num_attribs == 0, it was returning true without setting *api, causing the caller to use an uninitialized value. Tested-by: Vadim Girlin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glx: Suppress unused variable warning for cmdlenPaul Berry2012-01-111-1/+1
| | | | | | | | | | | | No functional change. In the function __indirect_glAreTexturesResident(), the variable cmdlen is only used if USE_XCB is not defined. This patch avoids a compile warning in the event that USE_XCB is defined. v2: just move cmdlen declaration inside the #else part. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* scons: Fix libGL.so build.José Fonseca2012-01-101-0/+3
|
* glx/dri2: print FPS when env var LIBGL_SHOW_FPS is 1 (v2)Marek Olšák2012-01-051-1/+34
| | | | | | | | | This is useful for apps which don't print FPS. Only enabled in SwapBuffers. v2: track state per drawable, use libGL prefix Reviewed-by: Michel Dänzer <[email protected]>
* glx: More hacking around versions of XCB that lack GLX_ARB_create_context ↵Ian Romanick2012-01-043-4/+7
| | | | | | | | | | | | | | | | support Detect whether a new enough version of XCB is installed at configure time. If it is not, don't enable the extension and don't build the unit tests. v2: Move the AM_CONDIATION outside the case-statement so that it is invoked even for non-GLX builds. This prevents build failures with osmesa, for example. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Tested-by: Robert Hooker <[email protected]>
* drisw: Fix drawable creation against non-default screensAdam Jackson2012-01-041-2/+1
| | | | | | | | | | | | We don't want to match the visual against the default screen. If the drawable is on a non-default screen then the appropriate visual might not exist on the default screen. Conversely, if the same visual is available on multiple screens then simply selecting for the right VID is sufficient, since the server has promised that the same visual is compatible with multiple screens. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: Hack around versions of XCB that lack GLX_ARB_create_context supportIan Romanick2012-01-032-0/+23
| | | | | | | | | A lot of tests in 'make check' will fail under these circumstances, but at least the build should work. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* tests/glx: Add unit tests for GLX_ARB_create_context GLX protocolIan Romanick2012-01-021-1/+4
| | | | | | | | | | This adds a new tests directory at the top-level and some extra build infrastructure. The tests use the Google C++ Testing Framework, and they will only be built if configure can detect its availability. The tests are automatically wired-in to run with 'make check'. Signed-off-by: Ian Romanick <[email protected]> Acked-by: Chad Versace <[email protected]>
* glx: Don't use 'new' as a function parameter nameIan Romanick2012-01-021-1/+1
| | | | | | | | Using 'new' as a function parameter name prevents including glxclient.h the unit tests (future patch) that use the Google C++ Testing Framework. Signed-off-by: Ian Romanick <[email protected]>
* glx: Enable GLX_EXT_create_context_es2_profileIan Romanick2012-01-025-0/+39
| | | | | | | | | | | | This extension is only enabled if the underlying driver advertises support for OpenGL ES 2.0. This happens either through the getAPIMask function in version 2 of the DRI2 extension or implicity through version 2 of the DRISW extension. Since there is no OpenGL ES 2.0 protocol, this extension is marked as only available with direct-rendering. Signed-off-by: Ian Romanick <[email protected]>
* glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contextsIan Romanick2012-01-021-1/+88
| | | | | | | | This also enables GLX_ARB_create_context and GLX_ARB_create_context_profile if the driver supports DRI_DRISW version 3 or greater. Signed-off-by: Ian Romanick <[email protected]>
* glx/dri: Add utility function dri2_convert_glx_attribsIan Romanick2012-01-022-0/+108
| | | | | | | This converts all of the GLX data from glXCreateContextAttribsARB to the values expected by the DRI driver interfaces. Signed-off-by: Ian Romanick <[email protected]>
* glx: Add extension strings for GLX_ARB_create_context and ↵Ian Romanick2012-01-022-1/+5
| | | | | | | | | GLX_ARB_create_context_profile Note that these extensions are not automatically enabled for screens capable of direct-rendering. Signed-off-by: Ian Romanick <[email protected]>
* glx: Connect glXCreateContextAttribsARB to glXGetProcAddressIan Romanick2012-01-021-0/+3
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glx: Initial implementation of glXCreateContextAttribsARBIan Romanick2012-01-024-1/+121
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contextsIan Romanick2012-01-021-1/+91
| | | | | | | | This also enables GLX_ARB_create_context and GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version 3 or greater. Signed-off-by: Ian Romanick <[email protected]>
* glx: Implement glx_screen_vtable::create_context_attribs for indirect contextsIan Romanick2012-01-021-1/+23
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glx: Add glx_screen_vtable::create_context_attribsIan Romanick2012-01-024-3/+14
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glx: Use __glX_send_client_info with XCBIan Romanick2012-01-021-0/+4
| | | | | | | __glX_send_client_info only supports XCB, so use that instead of __glXClientInfo when USE_XCB is defined. Signed-off-by: Ian Romanick <[email protected]>
* glx: Add __glX_send_client_info super functionIan Romanick2012-01-023-0/+160
| | | | | | | | This function picks the correct client-info protocol (based on the server's GLX version and set of extensions) and sends it to the server. Signed-off-by: Ian Romanick <[email protected]>
* glx: Propagate the glXIsDirect protocol error back to the applicationIan Romanick2011-12-231-3/+26
| | | | | | | | | | | | If the server returned BadContext, the error would just get droped on the floor. Fixes the piglit test glx-import-context-single-process NOTE: This is a candidate for the 7.11 branch, but it also requires the previous patch. Signed-off-by: Ian Romanick <[email protected]>
* glx: Deliver an xlib style error to the application from an XCB errorIan Romanick2011-12-232-0/+23
| | | | Signed-off-by: Ian Romanick <[email protected]>
* 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]>