summaryrefslogtreecommitdiff
path: root/src/glx
AgeCommit message (Collapse)AuthorFilesLines
2024-08-20glx/dri2: strdup driver nameMike Blumenkrantz1-1/+1
this is freed by the caller cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30619> (cherry picked from commit 046728f47a0557a23d8603700a6f748ae880dc7d)
2024-08-04glx: include src/gallium for appleMike Blumenkrantz1-1/+1
Fixes: 91e1ea52c9d ("mesa_interface: Move out of GL/internal/") Reviewed-by: Eric Engestrom <eric@igalia.com> Reported-by: Yurii Kolesnykov <root@yurikoles.com> Tested-by: Yurii Kolesnykov <root@yurikoles.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30449> (cherry picked from commit c5c0c1215b9faf478181ecf4f1ee7fd1aae2448f)
2024-07-24gallium: install gallium-$version.so to libdirMike Blumenkrantz1-1/+0
Installing this private library into the default library search path avoids needing to rely on -Wl,-rpath, which is inconsistently implemented as either DT_RUNPATH or DT_RPATH on different distributions; in particular, on distributions that implement it as DT_RPATH, it interferes with use of LD_LIBRARY_PATH and has semantics that are difficult to reason about, and is incompatible with Steam's container runtime (which has the known limitation that it only implements DT_RUNPATH and not DT_RPATH). To avoid third-party developers being tempted to link to the unstable libgallium, give it a name that varies with each Mesa release, so that there is no obvious way for third-party software to link to it. This is similar to the way the proprietary Nvidia driver sets up its similar implementation-detail libraries such as libnvidia-glcore.so.535.183.01. Fixes: 50fc7cc2 ("glx: directly link to gallium") Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30328> (cherry picked from commit 9b7bb6cc9fa410fb783e7a99d9eadcc31668f298)
2024-07-23egl,gbm,glx: fix log message spamPierre-Eric Pelloux-Prayer1-2/+2
Based on the other similar logs we only want to log when extensions is NULL. Use this opportunity to indicate the source of the log and remove the extra ')' at the end of each line. Fixes: 50fc7cc290d ("glx: directly link to gallium") Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30257> (cherry picked from commit 159a3edd80a988dec263708f851ed35eec881a78)
2024-07-18loader/glx: move multibuffers check to loaderMike Blumenkrantz3-77/+2
make this code more reusable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30128>
2024-07-18glx: directly link to galliumMike Blumenkrantz10-33/+23
this eliminates the loader interface, which avoids an entire class of issues and simplifies a bunch of code Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29771>
2024-07-18dri: Consistently use createImageFromDmabufs() not createImageFromFds()Emma Anholt1-2/+2
They're calling the same thing in the backend, so reduce the proliferation of interfaces consumed within our implementation. driVkImageExtensionSw now sets dri2_from_dma_bufs, which means that egl_dri2 will now expose EXT_image_dma_buf_import. Given that it previously set dri2_from_fds suggesting that it can import dmabufs, this is presumably OK. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245>
2024-07-17mesa_interface: Move out of GL/internal/Adam Jackson9-9/+8
Move it into src/gallium/include/ to make it absolutely clear this is a Mesa detail. While we're at it, clean up its include sites, including some places where we can just include kopper_interface.h instead since it includes mesa_interface.h as its first act. Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378>
2024-07-17treewide: Include mesa_interface.h not dri_interface.hAdam Jackson4-4/+4
We're about to split the latter off as a compatibility detail for older versions of Xorg, and the former includes the latter at this point, so this should be just to prove no functional change. Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378>
2024-06-29build: pass licensing information in SPDX formDavid Heidelberg4-72/+4
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Acked-by: Dylan Baker <dylan.c.baker@intel.com> Acked-by: Eric Engestrom <eric@igalia.com> Acked-by: Daniel Stone <daniels@collabora.com> Signed-off-by: David Heidelberg <david@ixit.cz> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29972>
2024-06-14glx: fix build -D glx-direct=falseEric Engestrom1-1/+1
Fixes: 014bbae4bf3f0bd87ab0 ("glx: pass implicit load param through allocation") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29732>
2024-05-13glxext: don't try zink if not enabled in mesaRomain Naour1-0/+2
Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") added an automatic zink fallback even when the zink gallium is not enabled at build time. It leads to unexpected error log while loading drisw driver and zink is not installed on the rootfs: MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") Signed-off-by: Romain Naour <romain.naour@smile.fr> Reviewed-by: Antoine Coutant <antoine.coutant@smile.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478>
2024-05-13drisw: fix build without dri3Antoine Coutant1-0/+2
commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") added dri3_priv.h header and dri3_check_multibuffer() function in drisw that can be build without dri3. Commit 4477139ec2e added a guard around dri3_check_multibuffer() function but not around dri3_priv.h header. Add HAVE_DRI3 guard around dri3_priv.h header. Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") v2: Remove the guard around dri3_check_multibuffer() function. Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Antoine Coutant <antoine.coutant@smile.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478>
2024-05-10loader: silence implicit-load zink error by the loaderLuc Ma5-7/+8
Since commit 7d9ea77b4598 ("glx: add automatic zink fallback loading between hw and sw drivers"), zink could be tried as a fallback. It'd better silence if the zink loading is implicit and on fail as what commit 4cc975c6e912 ("glx: silence more implicit-load zink errors") has done. But there seems to be one left bebind, which is spit when building swrast but no zink with -Dglx=dri. v2: plumb the flag through from egl/glx to the loader (zmike) Signed-off-by: Luc Ma <luc@sietium.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28970>
2024-05-07dri: rename 'implicit' param from earlier seriesMike Blumenkrantz6-19/+19
I accidentally merged the wrong version of this, and this was supposed to be the correct and more informative name Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29066>
2024-04-30egl+glx: fix two #ifdef that should be #if like the restEric Engestrom1-1/+1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28947>
2024-04-22glx: silence more implicit-load zink errorsMike Blumenkrantz1-2/+3
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
2024-04-22dri: plumb a 'implicit' param through createNewScreen interfacesMike Blumenkrantz3-17/+17
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
2024-04-22glx: pass implicit load param through allocationMike Blumenkrantz1-7/+7
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
2024-04-22glx: add an 'implicit' param to createScreenMike Blumenkrantz6-9/+9
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
2024-04-22glx: fix some indentationMike Blumenkrantz1-3/+3
ifdefs are hard Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
2024-04-04glx/egl: fix LIBGL_KOPPER_DISABLEMike Blumenkrantz2-2/+4
when set, this disables the use of vk swapchains and lets the dri frontend manage buffers like any other driver also document some kopper env vars Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28137>
2024-03-22treewide: Replace usage of macro DEBUG with MESA_DEBUG when possibleYonggang Luo1-1/+1
This is achieved by the following steps: #ifndef DEBUG => #if !MESA_DEBUG defined(DEBUG) => MESA_DEBUG #ifdef DEBUG => #if MESA_DEBUG This is done by replace in vscode excludes docs,*.rs,addrlib,src/imgui,*.sh,src/intel/vulkan/grl/gpu These are safe because those files should keep DEBUG macro is already excluded; and not directly replace DEBUG, as we have some symbols around it. Use debug or NDEBUG instead of DEBUG in comments when proper This for reduce the usage of DEBUG, so it's easier migrating to MESA_DEBUG These are found when migrating DEBUG to MESA_DEBUG, these are all comment update, so it's safe Replace comment /* DEBUG */ and /* !DEBUG */ with proper /* MESA_DEBUG */ or /* !MESA_DEBUG */ manually DEBUG || !NDEBUG -> MESA_DEBUG || !NDEBUG !DEBUG && NDEBUG -> !(MESA_DEBUG || !NDEBUG) Replace the DEBUG present in comment with proper new MESA_DEBUG manually Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: David Heidelberg <david.heidelberg@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28092>
2024-03-18apple: Extended Apple feature support using GLX_USE_APPLE.duncan.hopkins14-24/+32
On MacOS/Apple/Dawin you can only get MESA to forward the GL funtions to the systems OpenGL.framework or run SWRast directly. There is no way to use a gallium driver, even if they have been compiled. The two gallium drivers of interest are SWRast and Zink, as the rest are hardware drivers and not relavent on MacOS. The code changes add a new define GLX_USE_APPLE. This is used in combination with the existing GLX_USE_APPLEGL. GLX_USE_APPLEGL calls the systems OpenGL.framework, Apple's OpenGL. GLX_USE_APPLE calls the non-system OpenGL code, i.e. Gallium, hence the subtle naming difference. Apple systems are still used, just not the GL ones. When GLX_USE_APPLE is defined the code will use the DRI/gallium driver sub-system so SWRast and Zink can selected at runtime on MacOS. This also allows Zink to be run on MacOS, once it is fixed up. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18meson: relaxed some meson restrictions on MacOS/Apple allowing for wider ↵duncan.hopkins1-2/+2
build support. This patch allows the meson build files, on MacOS, to build the DRI2 and EGL code paths. This is needed to activate the gallium drivers for swrast and zink to be used. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-18glx: Switched DRI2 functions over to use Apple specific alternatives and ↵duncan.hopkins1-0/+18
extension name. DRI2 calls are different between Linux and MacOS. Calling these Linux version on MacOS using xquartz fails with 'unknown' codes. This patch hardwires a number of the utility DRI2 functions to use the MacOS specific version that already exist for APPLEGL. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28205>
2024-03-15gallium/dri: Switch xf86drm.h for util/libdrm.h to allow for the no-op shim ↵duncan.hopkins1-1/+1
to be used. This patch allows MacOS to compile the dri[2] systems by switching from direct xf86drm.h to the pre-existing util/libdrm.h. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-15egl: Added DRI3 code guards.duncan.hopkins1-0/+2
MacOS does not have any DRI3 libraries, these code guards hide the code paths the fail to compile without DRI3. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28130>
2024-03-11glx: Remove DEBUG code in xfont.cYonggang Luo1-85/+0
This is the result of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21946#note_1836697 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28093>
2024-02-29glx: only print zink failure-to-load messages if explicitly requestedMike Blumenkrantz4-7/+17
if zink is inferred, let it fail silently ref #10293 Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27836>
2024-02-21glx/dri3: handle zink fallback if loader picks it.Dave Airlie3-4/+17
if we get a zink driver selected for the fd then don't bind it to dri3 return a special error and this should stop dri2 binding it. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27628>
2023-12-18glx: Handle IGNORE_GLX_SWAP_METHOD_OML regardless of GLX_USE_APPLEGLMichel Dänzer1-2/+1
Avoids tons of WARNING: unknown fbconfig attribute from server: tag 0x8060 value 0x8063 messages with LIBGL_DEBUG=verbose. Fixes: e64ab3e4a94c ("glx: Delete support for GLX_OML_swap_method.") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26685>
2023-11-21mesa/st, dri2, wgl, glx: Restore flush_objects interop backward compatSylvain Munaut6-11/+12
In commit 1396dc1c a new output field was added as a parameter, but this is a problem since the signature of the function are not versionned. The flush function didn't have a versionned output struct. So what I'm proposing here is that if the version of the input argument is new enough (bumped to 2 here), then we re-use the existing argument, which until now was directly a pointer to GLsync, and instead use it as a pointer to a versioned struct. We're just changing one pointer type to another, so in C, this should be fine AFAIK. Fixes: 1396dc1c Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26315>
2023-11-04mesa/st, dri2, wgl, glx: Modify flush_objects interop func to export a fence_fdAntonio Gomes6-14/+14
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305>
2023-11-02glx: fix automatic zink fallback loading between hw and sw drivers on MacOSduncan.hopkins1-2/+8
The combination of defines used when compile the code on MacOS is hiding variables. Patch allows basic MacOS build to compile and run. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25992>
2023-11-02dri: added build dependencies for systems using non-standard prefixed X11 libs.duncan.hopkins1-1/+1
To get MacOS to build, some extra dependencies need to be added to a couple of build targets. This mainly shows up when not installing the dependencies in the default prefix locations. On MacOS, this happens when using a custom build of brew to install the dependencies to 'odd' locations. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25992>
2023-10-20glx: Delete support for GLX_OML_swap_method.Emma Anholt7-38/+0
This was an ill-advised extension. While we advertised SWAP_COPY support, we might implement it with a back-copy from the front buffer. And we never advertised EXCHANGE because we couldn't guarantee it. So, if you actually used this extension to try to reduce app redraws of the back buffer, you might actually increase the bandwidth you used. Whoops. Instead, GLX_EXT_buffer_age and the similar EGL extension give you feedback on what's left in your back buffer, letting you do minimum redraws. This reduces our GLX visual+fbconfig count from 1410 to 940 on an llvmpipe X server. Reducing visual counts will improve test runtime for visual-iterating tests like piglit's glx-visuals-*. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25650>
2023-10-19glx: add automatic zink fallback loading between hw and sw driversMike Blumenkrantz1-8/+25
if loading the default hardware driver fails, implicitly loading zink should now be preferable to hitting the software fallback now that zink has all the same capabilities Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-10-19egl/glx: don't load non-sw zink without dri3 supportMike Blumenkrantz1-5/+11
this is going to be broken, so don't bother trying also add LIBGL_KOPPER_DRI2 so people can continue to footgun if they really really want to Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25640>
2023-09-28glx: XFree visual infoMike Blumenkrantz1-1/+1
cc: mesa-stable Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25441>
2023-09-18glx: drop the 'libGL' log prefixPierre-Eric Pelloux-Prayer1-1/+0
Suggested by @ajax in !24750. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24750>
2023-09-14glx: Increment dpy->request before issuing an error that had no requestDaniel van Vugt1-0/+2
This ensures the sequence number is unique and recent enough for callers of `glXQueryDrawable` using `XNextRequest` to selectively trap errors. The same approach is already used in `glXCreateContextAttribsARB`. Suggested-by: Sebastian Keller <skeller@gnome.org> Related-to: https://gitlab.gnome.org/GNOME/mutter/-/issues/3007 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25173>
2023-08-19glx: Advertise GLX_MESA_gl_interop extension if support presentSylvain Munaut4-0/+8
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: Antonio Gomes <antoniospg100@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19glx: Remove MESA_depth_float_bit from enumSylvain Munaut1-1/+0
This is not used anywhere. Been there from the beginning of this file but with no related code in glxextensions.c Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: Antonio Gomes <antoniospg100@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19glx: Export the MESA GL Interop functions through glXGetProcAddressSylvain Munaut3-0/+75
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: Antonio Gomes <antoniospg100@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-19glx: Add missing MesaGLInteropGLXFlushObjectsSylvain Munaut1-0/+26
All the plumbing was added in 8d55fb54b15381d7fa950f448e5c67d0556088db but for some reason the top level access method was not ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Acked-by: Antonio Gomes <antoniospg100@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24573>
2023-08-03glx: There is no need to psc++xurui1-1/+1
Signed-off-by: xurui <xurui@kylinos.cn> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24360>
2023-08-03glx: decouple from galliumYonggang Luo1-1/+1
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23438>
2023-07-27kopper: pass modifier availability to drawable creationMike Blumenkrantz1-0/+1
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
2023-07-27glx/sw: check for modifier support in the kopper pathMike Blumenkrantz2-0/+8
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>