Commit Graph

29 Commits

Author SHA1 Message Date
Adam Jackson 538356e3e6 glx: Use the new no-error driver interface
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12474>
2022-02-04 18:36:24 +00:00
Adam Jackson a521b502b9 glx/dri: Collect the GLX context attributes in a struct
dri2_convert_glx_attribs had way too many arguments, let's fix that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12456>
2021-08-18 21:11:02 +00:00
Adam Jackson 1cb664c15c glx: s/dri_message/glx_message/
Move this up to the generic glx code, there's nothing DRI-specific about
this and it'll let us clean up some ad-hockery elsewhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10381>
2021-04-22 18:11:52 +00:00
Adam Jackson 63822802ef glx: Handle create_context in terms of create_context_attribs
For the DRI backends we factor this out to a dri_common_create_context
method. Indirect gets the same transformation but doesn't use the common
method since it can't rely on DRI being built.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7660>
2020-12-01 18:40:18 +00:00
Adam Jackson 3bb7ebfc75 glx: move __glXGetUST into the DRI1 code
This is only used from the __DRI_SYSTEM_TIME loader extension, which
only the DRI1 drivers ever looked for.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7219>
2020-10-21 10:24:31 -04:00
Adam Jackson 45d159cb41 glx: Fix build and warnings with -Dglx=dri -Dglx-direct=false
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5958>
2020-07-23 01:23:12 +00:00
Grigori Goronzy acfd88204e glx: add support for GLX_ARB_create_context_no_error (v3)
v2: Only reject no-error contexts for too-old GL if we're actually
trying to create a no-error context (Adam Jackson)
v3: Fix share contexts (Adam Jackson)

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-03-12 19:12:21 -04:00
Eric Anholt c2b515379b glx: Move DRI extensions pointer loading to driOpenDriver().
The only thing you do with a dri driver handle is get the extensions
pointer, so just fold it in to simplify the callers.

v2: Add the declaration of driGetDriverExtensions() that got lost in a
    rebase.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v1)
2018-11-16 15:38:18 -08:00
Neil Roberts ba7679f48d glx: Implement GLX_ARB_context_flush_control
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
2017-11-06 16:09:02 -05:00
Jose Fonseca fa1b3e1501 glx: Include util/macros.h instead of redefining PRINTFLIKE.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2015-04-13 12:03:33 +01:00
Timothy Arceri 5eec7c8ab8 mesa: remove support for GCC older than 3.3.0
GCC >=3.3 has been required since 9aa3aa7138

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-12-17 08:37:05 +11:00
Eric Anholt 867d7c0e10 dri: Reuse dri_message to implement our other message handlers.
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt 4a8da40fc0 dri: Fix the logger error message handling.
Since the loader changes, there has been a compiler warning that the
prototype didn't match.  It turns out that if a loader error message was
ever thrown, you'd segfault because of trying to use the warning level as
a format string.

Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-01-27 09:37:29 -08:00
Eric Anholt fcb57a8210 glx: Add an optional function call for getting the DRI driver interface.
The previous interface relied on a static struct, which meant that the
driver didn't get a chance to edit the struct before the struct got used.
For megadrivers, I want struct specific to the driver being loaded.

v2: Fix the prototype in the docs (caught by Marek).  Since the driver
    name was in the function, we didn't need to also pass it in.
v3: Fix asprintf error checking (caught by Matt's gcc).

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Eric Anholt 80806c98ef glx: Move the driver extension-loading to a helper function.
I'm planning on doing driver extension parsing from 3 places, and making
the extension loading step a bit longer.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-10-24 14:04:20 -07:00
Tomasz Lis a92cd5b245 glx: Retrieve the value of RENDER_TYPE from GLX attribs array
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 <tomasz.lis@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-07-18 16:03:42 -07:00
Ian Romanick a8724d85f8 glx/dri2: Add support for GLX_ARB_create_context_robustness
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 <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 08:54:50 -07:00
Carl Worth 92bef0bfa1 dri: Add a CriticalErrorMessageF macro.
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 <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Ian Romanick b45f77dc4c glx/dri: Add utility function dri2_convert_glx_attribs
This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Kristian Høgsberg 16887d042a glx: Drop broken drawable garbage collection
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.
2010-09-08 09:20:42 -04:00
Kristian Høgsberg c491e585e4 glx: Move bind and unbind to context vtable 2010-07-28 16:45:25 -04:00
Kristian Høgsberg 6ddf66e923 glx: Rename __GLcontextModes to struct glx_config
With this rename, we use 'config' consitently to refer to GLX configurations
instead of the modes/configs/visual mess before.
2010-07-28 16:42:00 -04:00
Kristian Høgsberg 7a66e54958 glx: Move last few dri_interface.h types out of glxclient.h and drop include 2010-07-21 22:17:24 -04:00
Kristian Høgsberg a7292f2920 glx: Move DRI CopySubBuffer extension to DRI1 code
We do this in the X server for DRI2.
2010-07-19 22:45:51 -04:00
Kristian Høgsberg bab13969d8 glx: Move driver_configs to DRI screen privates 2010-07-19 22:45:51 -04:00
Kristian Høgsberg 089fc37c6f glx: Move DRI1 specific extensions and code to DRI1 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg 9e546ecfd4 glx: Move DRI2 extensions to DRI2 screen private 2010-07-19 22:45:50 -04:00
Kristian Høgsberg f972115d33 glx: Add screen privates for dri drivers and moved some fields there
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.
2010-07-19 22:45:50 -04:00
Kristian Høgsberg 6e8897ff9f Retire miniglx and move the actual glx code up to src/glx 2010-02-09 09:58:36 -05:00
Renamed from src/glx/x11/dri_common.h (Browse further)