summaryrefslogtreecommitdiffstats
path: root/src/glx/indirect_glx.c
Commit message (Collapse)AuthorAgeFilesLines
* glx: Lower GLX opcode lookup into SendMakeCurrentRequestAdam Jackson2017-11-131-9/+7
| | | | | | Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: turn LIBGL_NO_DRAWARRAYS into a booleanEric Engestrom2017-09-121-1/+5
| | | | | | | | | Instead of setting based on set/unset, allow users to use boolean values. In the docs, use `NO_DRAWARRAYS=true` instead of `NO_DRAWARRAYS=1` as it's clearer IMO. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glx: Call __glXInitVertexArrayState() with a usable gc.Colin McDonald2016-07-081-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each indirect context the indirect vertex array state must be initialised by __glXInitVertexArrayState in indirect_vertex_array.c. As noted in the routine header it requires that the glx context has been setup prior to the call, in order to test the server version and extensions. Currently __glXInitVertexArrayState is called from indirect_bind_context in indirect_glx.c, as follows: state = gc->client_state_private; if (state->array_state == NULL) { glGetString(GL_EXTENSIONS); glGetString(GL_VERSION); __glXInitVertexArrayState(gc); } But, the gc context is not yet usable at this stage, so the server queries fail, and __glXInitVertexArrayState is called without the server version and extension information it needs. This breaks multi-texturing as glXInitVertexArrayState doesn't get GL_MAX_TEXTURE_UNITS. It probably also breaks setup of other arrays: fog, secondary colour, vertex attributes. To fix this I have moved the call to __glXInitVertexArrayState to the end of MakeContextCurrent in glxcurrent.c, where the glx context is usable. Fixes a regression caused by commit 4fbdde889c. Fixes ARB_vertex_program usage in the arbvparray Mesa demo when run with indirect GLX and also the tex-skipped-unit piglit test when run with indirect GLX. Reviewed-by: Matt Turner <[email protected]> Acked-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61907
* Remove wrongly repeated words in commentsGiuseppe Bilotta2016-06-231-1/+1
| | | | | | | | | | | | | | | | | Clean up misrepetitions ('if if', 'the the' etc) found throughout the comments. This has been done manually, after grepping case-insensitively for duplicate if, is, the, then, do, for, an, plus a few other typos corrected in fly-by v2: * proper commit message and non-joke title; * replace two 'as is' followed by 'is' to 'as-is'. v3: * 'a integer' => 'an integer' and similar (originally spotted by Jason Ekstrand, I fixed a few other similar ones while at it) Signed-off-by: Giuseppe Bilotta <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* Fix build of appleglxJon TURNEY2014-05-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to use the applegl direct renderer Convert src/glx/apple/Makefile to automake Since the applegl libGL is now built by linking libappleglx into libGL, rather than by linking selected files into a special libGL: - Remove duplicate code in apple/glxreply.c and apple/apple_glx.c. This makes apple/glxreply.c empty, so remove it - Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we need to add those guards to indirect_glx.c, indirect_init.c (via it's generator), render2.c and vertarr.c so they don't generate anything Fix and update various includes glapi_gentable.c (which is only used on darwin), should be included in shared glapi as well, to provide _glapi_create_table_from_handle() Note that neither swrast nor indirect is supported in the APPLEGL path at the moment, which makes things more complex than they need to be. More untangling is needed to allow that v2: Correct apple/Makefile.am for srcdir != builddir Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Jeremy Huddleston Sequoia <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glx/indirect: explicitly assign struct components for glx_*_vtableEmil Velikov2014-04-281-12/+14
| | | | | | | | ... to improve readability of code. Set indirect_screen_vtable as a static const. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* glx: Fix return value from indirect_bind_contextAdam Jackson2013-10-251-4/+4
| | | | | | | | | _XReply returns 1 on success, but indirect_bind_context returns 0 on success. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70486 Reviewed-and-tested-by: Ian Romanick <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: Propagate failures from SendMakeCurrentRequest where possibleAdam Jackson2013-10-081-3/+4
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: Hide xGLXMakeCurrentReply inside SendMakeCurrentRequestAdam Jackson2013-10-081-7/+9
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: Validate the GLX_RENDER_TYPE valueTomasz Lis2013-07-181-0/+4
| | | | | | | | | | | | | Correctly handle the value of renderType in GLX context. In case of the value being incorrect, context creation fails. v2 (idr): indirect_create_context is just a memory allocator, so don't validate the GLX_RENDER_TYPE there. Fixes regressions in several GLX_ARB_create_context piglit tests. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx: Store the RENDER_TYPE in indirect renderingTomasz Lis2013-07-181-7/+15
| | | | | | | | | | | | v2 (idr): Open-code the check for GLX_RENDER_TYPE. dri2_convert_glx_attribs can't be called from here because that function only exists in direct-rendering builds. Also add a stub version of indirect_create_context_attribs to tests/fake_glx_screen.cpp to prevent 'make check' regressions. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Replace another malloc/memset-0 combination with callocMatt Turner2012-09-051-2/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* Use calloc instead of malloc/memset-0Matt Turner2012-09-051-4/+2
| | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: @@ expression E; identifier I; @@ - I = malloc(E); + I = calloc(1, E); ... - memset(I, 0, sizeof *I); Reviewed-by: Brian Paul <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + free ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - free((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - } @@ expression E; type T; @@ + free ((T) E); - if (unlikely (E != NULL)) { - free ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* Remove Xcalloc/Xmalloc/Xfree callsMatt Turner2012-09-051-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These calls allowed Xlib to use a custom memory allocator, but Xlib has used the standard C library functions since at least its initial import into git in 2003. It seems unlikely that it will grow a custom memory allocator. The functions now just add extra overhead. Replacing them will make future Coccinelle patches simpler. This patch has been generated by the following Coccinelle semantic patch: // Remove Xcalloc/Xmalloc/Xfree calls @@ expression E1, E2; @@ - Xcalloc (E1, E2) + calloc (E1, E2) @@ expression E; @@ - Xmalloc (E) + malloc (E) @@ expression E; @@ - Xfree (E) + free (E) @@ expression E; @@ - XFree (E) + free (E) Reviewed-by: Brian Paul <[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-021-1/+2
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glx: Send DestroyContext protocol at the correct timesIan Romanick2011-12-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | 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: Allow a context-specific fallback for glXGetProcAddressJeremy Huddleston2011-06-201-0/+1
| | | | | | | | 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]>
* glx: Remove (unused, broken) fastImageUnpack fast pathAdam Jackson2011-06-021-3/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* glx: Drop broken drawable garbage collectionKristian Høgsberg2010-09-081-0/+3
| | | | | | Doesn't work for pixmaps, was looking up the GLX XID and was never thread safe. Instead, just destroy the client side structures when the drawable is no long current for a context.
* glx: Only clear the stored context tag when the context has been unboundJon TURNEY2010-09-071-5/+8
| | | | | | | | | | | | | | The calling order of ->bind and ->unbind changed and then ->unbind would clear the currentContextTag of the old context before ->bind could reuse it in the make current request, in the indirect case. Instead, clear the old currentContextTag if and only if we send a request to the server to actually unbind it or reassign it to another context. https://bugs.freedesktop.org/show_bug.cgi?id=29977 Signed-off-by: Jon TURNEY <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]>
* glx: Compare old ctx against dummyCtx, not NULLKristian Høgsberg2010-07-291-1/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=29302
* glx: Split indirect and applegl implementations into different filesKristian Høgsberg2010-07-281-0/+456