summaryrefslogtreecommitdiffstats
path: root/src/glx/dri_common.c
Commit message (Collapse)AuthorAgeFilesLines
* dri: Introduce new flags in __DRI_ATTRIB_RENDER_TYPETomasz Lis2013-07-181-1/+7
| | | | | | | | | | | | | | Mark __DRI_ATTRIB_FLOAT_MODE as deprecated, and introduce new flags to __DRI_ATTRIB_RENDER_TYPE for float modes. Both signed float (fbconfig_float) and unsigned (packed_float) are introduced. The old attribute should be set for both float modes. v2 (idr): Require that the render mode from the DRI attributes matches the render mode of the config exactly. This is the behavior of the old code. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glx: Retrieve the value of RENDER_TYPE from GLX attribs arrayTomasz Lis2013-07-181-6/+6
| | | | | | | | | | | | | Make sure that context creation routines are provided with the value of RENDER_TYPE retrieved from GLX attribs. v2 (idr): Minor formatting changes. Change type of dri2_convert_glx_attribs render_type parameter to uint32_t to silence some GCC warnings. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Remove Xcalloc/Xmalloc/Xfree callsMatt Turner2012-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/dri2: Add support for GLX_ARB_create_context_robustnessIan Romanick2012-07-111-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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:dri_common.c: check psc->driScreen->createDrawable return valueWang YanQing2012-03-281-0/+6
| | | | | | | | | | createDrawable may return NULL value, we should check it, or it will make a segment failed. [minor-indent-issue-fixed-by: Yuanhan Liu] Signed-off-by: Wang YanQing <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* dri: Add a CriticalErrorMessageF macro.Carl Worth2012-02-081-0/+24
| | | | | | | | | | | | | 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]>
* 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: Enable GLX_EXT_create_context_es2_profileIan Romanick2012-01-021-0/+16
| | | | | | | | | | | | 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/dri: Add utility function dri2_convert_glx_attribsIan Romanick2012-01-021-0/+102
| | | | | | | 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: Fix indirect fallback when a non-Mesa GLX extension is present.Aaron Plattner2011-12-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* dri: Remove all DRI1 driversIan Romanick2011-08-261-1/+1
| | | | | | | | | | 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: Avoid calling __glXInitialize() in driReleaseDrawables().Henri Verbeet2011-07-191-1/+1
| | | | | | | | | | | | | | 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]
* glx: implement drawable refcounting.Stéphane Marchesin2011-06-171-7/+19
| | | | | | | | | | | | 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]>
* glx/dri: add initial dri interface for GLX_EXT_framebuffer_sRGB.Dave Airlie2011-03-061-1/+3
| | | | This realigns the name of the glx bit to align with the core mesa names.
* glx: Only remove drawables from the hash when we actually delete themKristian Høgsberg2010-09-291-4/+6
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=30457
* glx: Drop broken drawable garbage collectionKristian Høgsberg2010-09-081-0/+25
| | | | | | 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: Move bind and unbind to context vtableKristian Høgsberg2010-07-281-0/+27
|
* glx: Rename glcontextmodes.[ch] to glxconfig.[ch]Kristian Høgsberg2010-07-281-1/+0
|
* glx: Rename __GLcontextModes to struct glx_configKristian Høgsberg2010-07-281-26/+24
| | | | | With this rename, we use 'config' consitently to refer to GLX configurations instead of the modes/configs/visual mess before.
* glx: Move last few dri_interface.h types out of glxclient.h and drop includeKristian Høgsberg2010-07-211-1/+11
|
* glx: Move DRI CopySubBuffer extension to DRI1 codeKristian Høgsberg2010-07-191-25/+0
| | | | We do this in the X server for DRI2.
* glx: Move driver_configs to DRI screen privatesKristian Høgsberg2010-07-191-0/+10
|
* glx: Remove support for MESA_swap_frame_usageKristian Høgsberg2010-07-191-7/+0
| | | | | The extension never worked, the implementation returns GLX_BAD_CONTEXT when enabling the frame tracking.
* glx: Move DRI1 specific extensions and code to DRI1 screen privateKristian Høgsberg2010-07-191-34/+0
|
* glx: Move DRI2 extensions to DRI2 screen privateKristian Høgsberg2010-07-191-36/+0
|
* glx: Drop support for GLX_MESA_allocate_memoryKristian Høgsberg2010-07-191-7/+0
| | | | Only r200 implemented it.
* glx: Add screen privates for dri drivers and moved some fields thereKristian Høgsberg2010-07-191-12/+5
| | | | | | 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.
* 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.
| * apple: Change ifdefs for DRI to be DRI && !APPLEJeremy Huddleston2010-04-011-1/+1
| | | | | | | | Signed-off-by: Jeremy Huddleston <[email protected]>
* | DRI2: add config query extensionJesse Barnes2010-04-221-0/+5
|/ | | | | Add a new DRI2 configuration query extension. Allows for DRI2 client code to query for common DRI2 configuration options.
* Retire miniglx and move the actual glx code up to src/glxKristian Høgsberg2010-02-091-0/+450