summaryrefslogtreecommitdiffstats
path: root/src/glx/drisw_glx.c
Commit message (Collapse)AuthorAgeFilesLines
* glx: move the glFlush call one layer downMarek Olšák2012-12-021-1/+6
|
* Remove useless memset after callocMatt Turner2012-09-051-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* Use calloc instead of malloc/memset-0Matt Turner2012-09-051-6/+3
| | | | | | | | | | | | | | | | 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-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* Remove Xcalloc/Xmalloc/Xfree callsMatt Turner2012-09-051-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.Kenneth Graunke2012-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | If the application has requested reset notification, then dri2_convert_glx_attribs will initialize this to the correct value. Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but doesn't when num_attribs == 0. (The consensus seems to be that we should make it do so, but that's more invasive, so I'm pushing this for now.) Fixes a regression since a8724d85f8cb2f0fb73b9c6c1f268f9084c6d473 where trying to run OilRush_x86 or apitrace heaven_x64 would result in: dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get here."' failed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glx/dri2: Add support for GLX_ARB_create_context_robustnessIan Romanick2012-07-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the infrastructure required for this extension. There is no xserver support and no driver support yet. Drivers can enable this be advertising DRI2 version 4 and accepting the __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the __DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context. Some additional Mesa infrastructure is needed before drivers can do this. The GL_ARB_robustness spec, which all Mesa drivers already advertise, requires: "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset will result in the loss of all context state, requiring the recreation of all associated objects." It is necessary to land this infrastructure now so that the related infrastructure can land in the xserver. The xserver has very long release schedules, and the remaining Mesa parts should land long, long before the next xserver merge window opens. v2: Expose robustness as a DRI2 extension rather than bumping __DRI_DRI2_VERSION. v3: Add a comment explaining why dri2->base.version >= 3 is also required for GLX_ARB_create_context_robustness. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glx/drisw: avoid segfaults when we fail to get visualDave Airlie2012-03-241-2/+9
| | | | | | | | piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen, it now fails instead of segfaulting, much prettier. Signed-off-by: Dave Airlie <[email protected]>
* 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]>
* 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: Enable GLX_EXT_create_context_es2_profileIan Romanick2012-01-021-0/+5
| | | | | | | | | | | | 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: 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: Don't create a shared context if the other context isn't the same kindIan Romanick2011-12-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* glx: Fix indirect fallback when a non-Mesa GLX extension is present.Aaron Plattner2011-12-071-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* 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]>
* 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?
* drisw: Remove cargo culting that breaks GLX 1.3 ctorsAdam Jackson2011-06-291-4/+0
| | | | Signed-off-by: Adam Jackson <[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: implement drawable refcounting.Stéphane Marchesin2011-06-171-2/+4
| | | | | | | | | | | | 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]>
* drisw: Namespace better for ease of navigationAdam Jackson2011-05-241-14/+14
| | | | Signed-off-by: Adam Jackson <[email protected]>
* drisw: dead store removalAdam Jackson2011-05-241-3/+1
| | | | Signed-off-by: Adam Jackson <[email protected]>
* glx: Fix leaks in DRISW screen creation error paths.Henri Verbeet2011-01-311-2/+5
| | | | Signed-off-by: Brian Paul <[email protected]>
* glx: Drop broken drawable garbage collectionKristian Høgsberg2010-09-081-2/+2
| | | | | | 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: Fix use after free in drisw error pathKristian Høgsberg2010-08-041-2/+1
|
* glx: We no longer need screen extensions for driswKristian Høgsberg2010-08-041-2/+0
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=29177
* glx: Move bind and unbind to context vtableKristian Høgsberg2010-07-281-13/+19
|
* glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types.Kristian Høgsberg2010-07-281-7/+7
|
* glx: Rename __GLXscreenConfigs to struct glx_screenKristian Høgsberg2010-07-281-5/+5
| | | | Because double underscores in private type names is painful.
* glx: Rename __GLcontextModes to struct glx_configKristian Høgsberg2010-07-281-4/+4
| | | | | With this rename, we use 'config' consitently to refer to GLX configurations instead of the modes/configs/visual mess before.
* glx: Drop duplicate psc field in drisw context structKristian Høgsberg2010-07-241-3/+3
| | | | Causing a crash in drisw MakeCurrent.
* glx: Don't destroy context with XID 0Kristian Høgsberg2010-07-231-1/+2
| | | | | We use XID 0 to indicate the context has already been destroyed, but it's currently bound.
* glx: zero out drawable structs after allocationKristian Høgsberg2010-07-231-0/+1
|
* glx: Refactor and simplify context creationKristian Høgsberg2010-07-231-4/+8
| | | | | This lets us better separate context creation between the different backends.
* glx: Move context destroy to context vtableKristian Høgsberg2010-07-231-2/+9
|
* glx: Move WaitGL, WaitX, UseXFont to context vtable functionsKristian Høgsberg2010-07-221-2/+9
|
* glx: Allocate the __GLXcontext in the DRI driversKristian Høgsberg2010-07-221-12/+18
|
* glx: Move DRI CopySubBuffer extension to DRI1 codeKristian Høgsberg2010-07-191-1/+0
| | | | We do this in the X server for DRI2.
* glx: Move driver_configs to DRI screen privatesKristian Høgsberg2010-07-191-1/+4
|
* glx: Move __DRIdrawable pointers to DRI drawable privatesKristian Høgsberg2010-07-191-14/+14
|
* glx: Move __driScreen into the dri screen privatesKristian Høgsberg2010-07-191-9/+10
|
* glx: Move DRI1 specific extensions and code to DRI1 screen privateKristian Høgsberg2010-07-191-1/+0
|
* glx: Add screen privates for dri drivers and moved some fields thereKristian Høgsberg2010-07-191-51/+75
| | | | | | GLXscreenConfigs is badly named and a dumping ground for a lot of stuff. This patch creates private screen structs for the dri drivers and moves some of their fields over there.
* glx: Rename various DRI structs away from obnoxious __GLXfooRec conventionKristian Høgsberg2010-07-191-20/+16
| | | | Enough is enough.
* Merge branch '7.8'Brian Paul2010-04-281-1/+1
|\ | | | | | | | | | | | | Conflicts: src/glx/dri2_glx.c src/glx/glx_pbuffer.c
| * apple: Change ifdefs for DRI to be DRI && !APPLEJeremy Huddleston2010-04-271-1/+1
| | | | | | | | Signed-off-by: Jeremy Huddleston <[email protected]>
| * Revert accidental commits from the xquartz treeJeremy Huddleston2010-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 9aadc793f3db64cefa0b08f18abad424a659dacc. This reverts commit 69ea4e7718efb60b6b0d795a355cebd6712ceac1. This reverts commit dbe8b013936d977ec63d6607bfd2fc6772d29787. This reverts commit 23215ef4d60a86d9f3b3fdc08e3fdadc59e98890. This reverts commit 9495e3703062d1ddaf3161f4efc23f0b51284d9b. This reverts commit 0594cf70883b64692ba617d85f4f9b4e636e5c2b. This reverts commit 86a7978d37393ee34f876569ac06ffdb8d7289ae. This reverts commit 437902ce978cde9a0e1aa260f12dc232a8501c42.