aboutsummaryrefslogtreecommitdiffstats
path: root/src/loader
Commit message (Collapse)AuthorAgeFilesLines
* Revert "loader/dri3: Check for window destruction in dri3_wait_for_event_locked"Michel Dänzer2020-07-032-38/+1
| | | | | | | | | | | This reverts commit d7d7687829875e401690219d4a72458fb2bbe4de. It caused freezes with e.g. kwin_x11 due to hitting the 1s timeout. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3214 Reopens: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 Acked-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5722>
* loader/dri3: Check for window destruction in dri3_wait_for_event_lockedMichel Dänzer2020-06-292-1/+38
| | | | | | | | | | | | | | | | | | | | | | | If the underlying X11 window gets destroyed, the event we're waiting for may never be delivered, in which case xcb_wait_for_special_event would hang indefinitely. Solution: 1. Use xcb_poll_for_special_event to check if an event has arrived yet. 2. If not, Wait up to ~1s for XCB's file descriptor to become readable; if it does, go back to step 1. 3. If the file descriptor didn't become readable, make a round-trip to the X server to check that the window still exists. Go back to step 1 if it does, otherwise bail. Also add an early bail-out when it's known that the window was destroyed. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* loader/dri3: Use dri3_wait_for_event_locked in loader_dri3_wait_for_mscMichel Dänzer2020-06-291-7/+1
| | | | | | | | | | | | | | | | | | | | Before, if one thread ended up waiting in dri3_wait_for_event_locked and another one in loader_dri3_wait_for_msc at the same time, one thread could end up processing an event the other thread was waiting for, which could result in the latter thread waiting longer than necessary (possibly indefinitely). Noticed by inspection. v2: * Drop xcb_flush call from loader_dri3_wait_for_msc in favour of the one in dri3_wait_for_event_locked (Kenneth Graunke) Fixes: 7b0e8264dd21 "loader/dri3: Try to make sure we only process our own NotifyMSC events" Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* loader/dri3: Add dri3_wait_for_event_locked full_sequence out parameterMichel Dänzer2020-06-292-3/+10
| | | | | | | | Preparation for the next commit, no functional change intended. Cc: mesa-stable Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5368>
* util: rename xmlpool.h to driconf.hEric Engestrom2020-06-222-2/+2
| | | | | | | To make it clearer what it is and does. Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* driconf: drop now unused translation facilityEric Engestrom2020-06-222-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5440>
* meson: use gnu_symbol_visibility argumentDylan Baker2020-06-011-2/+3
| | | | | | | | | | This uses a meson builtin to handle -fvisibility=hidden. This is nice because we don't need to track which languages are used, if C++ is suddenly added meson just does the right thing. Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
* loader: fallback to kernel name, if PCI failsEmil Velikov2020-04-011-23/+33
| | | | | | | | | | | | | | Currently, if the PCI machinery fails, we return a NULL driver name. In the past this has resulted in various workarounds. To avoid those, fallback to loader_get_kernel_driver_name(). It's not perfect, yet perfectly reasonable. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* loader: move "using driver..." message to loader_get_kernel_driver_nameEmil Velikov2020-04-011-2/+2
| | | | | | | | | | | | Move the message to the function which fetches the name. While here use the same DEBUG/WARNING approach like in the PCI case. The current method spam a tad much, plus isn't consistent. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* loader: simplify codeflow in drm_get_pci_id_for_fdEmil Velikov2020-04-011-16/+12
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* loader: simplify loader_get_user_preferred_fd()Emil Velikov2020-04-011-31/+20
| | | | | | | | | Reoder the function a bit to make the code-flow more obvious and short. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* loader: use a maximum of 64 drmDevicesEmil Velikov2020-04-011-26/+11
| | | | | | | | | | | | | | | Currently that's the hard-coded maximum in the kernel, even though the libdrm API allows for more. Latter is done with extendability in mind. Allocate 64 pointers^Wdevices on stack for now. Making for shorter and ever-so-slightly faster code. v2: Use single MAX_DRM_DEVICES #define (Eric) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* loader: Warn when we fail to open a device node due to permissions.Eric Anholt2020-04-011-0/+4
| | | | | | | | | | | | | | | | | | | This is definitely not the first time I've debugged why I'm getting swrast on a device only to find out I'm not a member of the render node's group. This does mean that you'll get a warning print even without EGL_LOG_LEVEL set. This may be an issue if we expect people outside of the DRI node's group to actually be using swrast instead of getting their permissions fixed. Right now surfaceless throws a "libEGL warning: No hardware driver found, falling back to software rendering" in that case anyway, so this is just more informative. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3703> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3703>
* loader: Fix leak of kernel driver nameKenneth Graunke2020-01-301-1/+4
| | | | | | | | | | | This is strdup'd, it needs to be freed. CID: 1458032 Fixes: f93bb2fb102 ("loader: Check if the kernel driver is i915 before loading iris") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3630> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3630>
* loader: Check if the kernel driver is i915 before loading irisKenneth Graunke2020-01-282-1/+9
| | | | | | | | To prevent it from trying to load on say gma500 hardware. Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3595> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3595>
* loader: #define PATH_MAX when undefined (eg. Hurd)Samuel Thibault2020-01-221-0/+5
| | | | | | | Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Samuel Thibault <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3228> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3228>
* intel: Use similar brand strings to the Windows driversKenneth Graunke2020-01-131-1/+1
| | | | | | | | | | | | | | | This updates our product name strings to match the ones reported by the Windows driver, which is typically the marketing name. We retain a platform abbreviation and GT level in parenthesis so that we're able to distinguish similar parts more easily, helping us better understand at a glance which GPU a bug reporter has. Acked-by: Matt Turner <[email protected]> Acked-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3371> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3371>
* loader: fix close on uninitialized file descriptor valueLionel Landwerlin2019-12-191-1/+4
| | | | | | | | | | | | | | | | | | | | Using a drm syscall layer faking a kernel driver : ==581460== Conditional jump or move depends on uninitialised value(s) ==581460== by 0x48A4C2B: close (drm-hooks.cpp:185) ==581460== by 0x5A815F1: dri3_alloc_render_buffer (loader_dri3_helper.c:1469) ==581460== by 0x5A82050: dri3_get_buffer (loader_dri3_helper.c:1827) ==581460== by 0x5A82662: loader_dri3_get_buffers (loader_dri3_helper.c:2028) ==581460== by 0x6C78109: intel_update_image_buffers (brw_context.c:1870) ==581460== by 0x6C77805: intel_update_renderbuffers (brw_context.c:1499) ==581460== by 0x6C7789D: intel_prepare_render (brw_context.c:1520) ==581460== by 0x6C773D4: intelMakeCurrent (brw_context.c:1341) Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 069fdd5f9fac ("egl/x11: Support DRI3 v1.1") Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3152> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3152>
* dri: add __DRI_IMAGE_FORMAT_SXRGB8Tapani Pälli2019-12-171-0/+2
| | | | | | | | | Add format definition and required plumbing to create images. Cc: <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3077>
* meson: Add a "prefer_iris" build optionKenneth Graunke2019-12-021-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling this option makes Intel Gen8-11 hardware load the 'iris' driver by default instead of the older 'i965' driver. Regardless of how this option is set, users can still override which driver the loader selects via two methods. The first is to create a ~/.drirc or /etc/drirc file with the following snippet: <driconf> <device driver="loader" kernel_driver="i915"> <option name="dri_driver" value="i965" /> </device> </driconf> The other option is to set an environment variable: export MESA_LOADER_DRIVER_OVERRIDE=i965 For now, "prefer_iris" defaults to i965 (the historical choice). A separate future patch will change the default driver to iris. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1893 Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* loader: replace xmlpool_options_h with idep_xmlconfig_headersEric Engestrom2019-10-311-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Dylan Baker <[email protected]>
* loader: default to iris for all future PCI IDsEric Engestrom2019-10-281-20/+1
| | | | | | | | | | The existing "fallback" code didn't actually do anything, so this removes it, and instead we just always fallback to `iris` for future PCI IDs. Suggested-by: Kenneth Graunke <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* loader: Simplify handling of the radeonsi driverMichel Dänzer2019-10-082-16/+1
| | | | | | | The list of AMD/ATI devices supported by radeon/r200/r300/r600 is complete, so anything else must use radeonsi. Reviewed-by: Marek Olšák <[email protected]>
* meson/loader: drop unneeded *.h fileEric Engestrom2019-10-071-3/+2
| | | | | | | | | Meson automatically tracks any file included by a file it already tracks, and `pci_id_driver_map.h` & `loader.h` are included by `loader.c`, while `loader_dri3_helper.h` is included by `loader_dri3_helper.c`. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* loader: use ARRAY_SIZE instead of NULL sentinelEric Engestrom2019-10-072-6/+3
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* loader: s/int/bool/ for predicate resultEric Engestrom2019-10-072-5/+8
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* loader: replace int/1/0 with bool/true/falseEric Engestrom2019-10-072-10/+9
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* dri: Avoid swapbuffer throttling in glXCopySubBufferMESAKenneth Graunke2019-10-051-1/+1
| | | | | | | | | | We were supplying __DRI2_THROTTLE_SWAPBUFFER, rather than the obvious choice of __DRI2_THROTTLE_COPYSUBBUFFER. This meant that we hit the swap-based frame throttling. glXCopySubBuffer doesn't seem like it's intended to be a frame boundary, so we'd like to avoid this throttling. Tested-by: Michel Dänzer <[email protected]> # DRI3 only Reviewed-by: Michel Dänzer <[email protected]>
* dri3: Pass __DRI2_THROTTLE_COPYSUBBUFFER from loader_dri3_copy_drawableMichel Dänzer2019-10-041-1/+1
| | | | | | | | | | 0 is __DRI2_THROTTLE_SWAPBUFFER, which doesn't really make sense here. Avoids dri_flush() throttling twice for the same glFlush call with front buffer rendering, as described in https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2057 . Reviewed-by: Kenneth Graunke <[email protected]>
* loader/dri3: do not blit outside old/new buffersErik Faye-Lund2019-10-031-1/+3
| | | | | Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* loader: Avoid use-after-free / use of uninitialized local variablesMichel Dänzer2019-09-261-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per the valgrind output below, we were returning the pointer to freed memory if none of the later conditional pointer assignments were executed. This caused dEQP CI jobs to crash on certain runners, presumably due to a double-free down the line. Also, we were skipping to the out: label before the vendor_id & chip_id variables used by it were initialized, resulting in broken LIBGL_DEBUG=verbose output such as libGL: pci id for fd 4: 51108f00:51108f00, driver radeonsi Fixes: 5a545e355b23 "loader: always map the "amdgpu" kernel driver name to radeonsi (v2)" ==403== Invalid read of size 1 ==403== at 0x4AFD576: surfaceless_probe_device (platform_surfaceless.c:316) ==403== by 0x4AFD915: dri2_initialize_surfaceless (platform_surfaceless.c:391) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:984) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:958) ==403== by 0x4AF1EEC: _eglMatchAndInitialize (egldriver.c:75) ==403== by 0x4AF1F3B: _eglMatchDriver (egldriver.c:96) ==403== by 0x4AE9367: eglInitialize (eglapi.c:617) ==403== by 0x1D99C9: tcu::surfaceless::EglRenderContext::EglRenderContext(glu::RenderConfig const&, tcu::CommandLine const&) [clone .constprop.57] (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x1DABB0: tcu::surfaceless::ContextFactory::createContext(glu::RenderConfig const&, tcu::CommandLine const&, glu::RenderContext const*) const (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x53EBD1: glu::createRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::RenderConfig const&, glu::RenderContext const*) (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x53EFE9: glu::createDefaultRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::ApiType) (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x1DE07A: deqp::gles2::Context::Context(tcu::TestContext&) (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x1DB5EF: deqp::gles2::TestPackage::init() (in /deqp/modules/gles2/deqp-gles2) ==403== Address 0x56bd340 is 0 bytes inside a block of size 4 free'd ==403== at 0x48369AB: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==403== by 0x4B01767: loader_get_driver_for_fd (loader.c:464) ==403== by 0x4AFD553: surfaceless_probe_device (platform_surfaceless.c:308) ==403== by 0x4AFD915: dri2_initialize_surfaceless (platform_surfaceless.c:391) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:984) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:958) ==403== by 0x4AF1EEC: _eglMatchAndInitialize (egldriver.c:75) ==403== by 0x4AF1F3B: _eglMatchDriver (egldriver.c:96) ==403== by 0x4AE9367: eglInitialize (eglapi.c:617) ==403== by 0x1D99C9: tcu::surfaceless::EglRenderContext::EglRenderContext(glu::RenderConfig const&, tcu::CommandLine const&) [clone .constprop.57] (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x1DABB0: tcu::surfaceless::ContextFactory::createContext(glu::RenderConfig const&, tcu::CommandLine const&, glu::RenderContext const*) const (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x53EBD1: glu::createRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::RenderConfig const&, glu::RenderContext const*) (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x53EFE9: glu::createDefaultRenderContext(tcu::Platform&, tcu::CommandLine const&, glu::ApiType) (in /deqp/modules/gles2/deqp-gles2) ==403== Block was alloc'd at ==403== at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==403== by 0x4EE5E09: strndup (strndup.c:43) ==403== by 0x4B010B1: loader_get_kernel_driver_name (loader.c:101) ==403== by 0x4B016AF: loader_get_driver_for_fd (loader.c:462) ==403== by 0x4AFD553: surfaceless_probe_device (platform_surfaceless.c:308) ==403== by 0x4AFD915: dri2_initialize_surfaceless (platform_surfaceless.c:391) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:984) ==403== by 0x4AF5EEA: dri2_initialize (egl_dri2.c:958) ==403== by 0x4AF1EEC: _eglMatchAndInitialize (egldriver.c:75) ==403== by 0x4AF1F3B: _eglMatchDriver (egldriver.c:96) ==403== by 0x4AE9367: eglInitialize (eglapi.c:617) ==403== by 0x1D99C9: tcu::surfaceless::EglRenderContext::EglRenderContext(glu::RenderConfig const&, tcu::CommandLine const&) [clone .constprop.57] (in /deqp/modules/gles2/deqp-gles2) ==403== by 0x1DABB0: tcu::surfaceless::ContextFactory::createContext(glu::RenderConfig const&, tcu::CommandLine const&, glu::RenderContext const*) const (in /deqp/modules/gles2/deqp-gles2) Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* loader: always map the "amdgpu" kernel driver name to radeonsi (v2)Jiang, Sonny2019-09-231-0/+9
| | | | | | | | v2: cleanup Signed-off-by: Sonny Jiang <[email protected]> Signed-off-by: Marek Olšák <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
* driconfig: add a new engine name/version parameterLionel Landwerlin2019-09-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan applications can register with the following structure : typedef struct VkApplicationInfo { VkStructureType sType; const void* pNext; const char* pApplicationName; uint32_t applicationVersion; const char* pEngineName; uint32_t engineVersion; uint32_t apiVersion; } VkApplicationInfo; This enables the Vulkan implementations to apply workarounds based off matching this description. Here we add a new parameter for matching the driconfig options with the following : <device driver="anv"> <application engine_name_match="MyOwnEngine.*" engine_versions="10:12,40:42"> <option name="blaaah" value="true" /> </application> </device> v2: switch engine name match to use regexps v3: Verify that the regexec returns REG_NOMATCH for match failure (Eric) v4: Add missing bit that went to the following commit (Eric) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: 19.2 <[email protected]>
* dri: Use DRM_FORMAT_* instead of defining our own copy.Eric Anholt2019-09-111-14/+14
| | | | | | | | | | | | We have only two defines that aren't from DRM_FORMAT_*: SARGB and SABGR. Keep only those as __DRI_IMAGE_FOURCC and garbage collect the rest. While this header is also used from the X server, the X server doesn't use any __DRI_IMAGE enums. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* loader: include limits.h for PATH_MAXnia2019-09-021-0/+1
| | | | | | | | | This is needed to build on illumos. The location of the PATH_MAX definition in limits.h seems to be fairly standard: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html Reviewed-by: Eric Engestrom <[email protected]>
* pci_id_driver_map: Support preferring iris over i965Jordan Justen2019-08-281-3/+14
| | | | | | | | | | | | This adds the ability for intel devices that: * Only load on i965 * Only load on iris * First attempt i965, and try iris next * First attempt iris, and try i965 next Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri: Add fp16 formatsKevin Strasser2019-08-211-0/+5
| | | | | | | | | | | Add dri formats for RGBA ordered 64 bpp IEEE 754 half precision floating point. Leverage existing offscreen render support for MESA_FORMAT_RGBA_FLOAT16 and MESA_FORMAT_RGBX_FLOAT16. Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Rename GLX_USE_TLS to USE_ELF_TLS.Bas Nieuwenhuizen2019-08-031-1/+1
| | | | | | | These days it is not GLX only and it does not work with all TLS implementations. Reviewed-by: Eric Engestrom <[email protected]>
* Delete autotoolsDylan Baker2019-04-151-57/+0
| | | | | | | | | | Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Marek Olšák <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Matt Turner <[email protected]>
* loader: use loader_open_device() to handle O_CLOEXECEmil Velikov2019-02-261-1/+1
| | | | | | | | Some platforms lack O_CLOEXEC. The loader_open_device() handles those appropriately, so use the helper. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* iris: Initial commit of a new 'iris' driver for Intel Gen8+ GPUs.Kenneth Graunke2019-02-211-0/+9
| | | | | | | | | | | | | | | This commit introduces a new Gallium driver for Intel Gen8+ GPUs, named 'iris_dri.so' after the hardware. Developed by: - Kenneth Graunke (overall driver) - Dave Airlie (shaders, conditional render, overflow query, Gen8 port) - Chris Wilson (fencing, pinned memory, ...) - Jordan Justen (compute shaders) - Jason Ekstrand (image load store) - Caio Marcelo de Oliveira Filho (tessellation control passthrough) - Rafael Antognolli (auxiliary buffer fixes) - The rest of the i965 contributors and the Mesa community
* drm-uapi: use local files, not system libdrmEric Engestrom2019-02-143-3/+2
| | | | | | | | | There was an issue recently caused by the system header being included by mistake, so let's just get rid of this include path and always explicitly #include "drm-uapi/FOO.h" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* loader/dri3: Use strlen instead of sizeof for creating VRR property atomMichel Dänzer2019-02-051-1/+1
| | | | | | | | | | | sizeof counts the terminating null character as well, so that also contributed to the ID computed for the X11 atom. But the convention is for only the non-null characters to contribute to the atom ID. Fixes: 2e12fe425fe3 "loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH property" Reviewed-by: Nicholas Kazlauskas <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* loader: fix the no-modifiers caseRob Clark2019-01-221-6/+14
| | | | | | | | | | | Normally modifiers take precendence over use flags, as they are more explicit. But if the driver supports modifiers, but the xserver does not, then we should fallback to the old mechanism of allocating a buffer using 'use' flags. Fixes: 069fdd5f9facbd72fb6a289696c7b74e3237e70f Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* dri3: initialize adaptive_sync as false before configQuerybTapani Pälli2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes following errors from valgrind output: ==23388== Conditional jump or move depends on uninitialised value(s) ==23388== at 0x48B4924: loader_dri3_drawable_init (loader_dri3_helper.c:381) ==23388== by 0x48A97D2: dri3_create_drawable (dri3_glx.c:386) ==23388== by 0x489E190: driFetchDrawable (dri_common.c:369) ==23388== by 0x48A9187: dri3_bind_context (dri3_glx.c:195) ==23388== by 0x488B75C: MakeContextCurrent (glxcurrent.c:220) ==23388== by 0x488B8DB: glXMakeCurrent (glxcurrent.c:267) ==23388== by 0x10A987: ??? (in /usr/bin/glxgears) ==23388== by 0x4BEB412: (below main) (in /usr/lib64/libc-2.28.so) ==23388== ==23388== Conditional jump or move depends on uninitialised value(s) ==23388== at 0x48B5A40: loader_dri3_swap_buffers_msc (loader_dri3_helper.c:923) ==23388== by 0x48A9B7E: dri3_swap_buffers (dri3_glx.c:587) ==23388== by 0x4887A81: glXSwapBuffers (glxcmds.c:857) ==23388== by 0x10ADED: ??? (in /usr/bin/glxgears) ==23388== by 0x4BEB412: (below main) (in /usr/lib64/libc-2.28.so) Fixes: 2e12fe425fe "loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH property" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]>
* loader/dri3: Enable adaptive_sync via _VARIABLE_REFRESH propertyNicholas Kazlauskas2018-12-282-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DDX driver can be notified of adaptive sync suitability by flagging the application's window with the _VARIABLE_REFRESH property. This property is set on the first swap the application performs when adaptive_sync is set to true in the drirc. It's performed here instead of when the loader is initialized for two reasons: (1) The window's drawable can be missing during loader init. This can be observed during the Unigine Superposition benchmark. (2) Adaptive sync will only be enabled closer to when the application actually begins rendering. If adaptive_sync is false then the _VARIABLE_REFRESH property is deleted on loader init. The property is only managed on the glx DRI3 backend for now. This should cover most common applications and games on modern hardware. Vulkan support can be implemented in a similar manner but would likely require splitting the function out into a common helper function. Reviewed-by: Michel Dänzer <[email protected]> Signed-off-by: Nicholas Kazlauskas <[email protected]>
* loader: free error state, when checking the drawable typeKirill Burtsev2018-12-101-0/+1
| | | | | | | | | | | | | | Currently we distinguish if the drawable is a window or pixmap by checking xcb_present_select_input throws an error or not. Yet, we don't always free the error state returned by xcb. Cc: Kirill Burtsev <[email protected]> Cc: Boyan Ding <[email protected]> Fixes: 6bd9ba7d074 ("loader: Add dri3 helper") Reviewed-by: Emil Velikov <[email protected]> [Emil: add commit message, fixes tag] Signed-off-by: Emil Velikov <[email protected]>
* loader: deduplicate logger function declarationEric Engestrom2018-12-042-3/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: Factor out the common driver opening logic from each loader.Eric Anholt2018-11-165-1/+103
| | | | | | | | | | | | | I copied the code from egl_dri2.c, but the functionality was equivalent between all the loaders other than their particular environment variables. v2: Drop the logging function equivalent to loader_default_logger() (requested by Eric, Emil). Move the SCons workaround across. Drop the now-unused driGetDriverExtensions() declaration that was lost in a rebase. Reviewed-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Emil Velikov <[email protected]> (v1)
* loader: Stop using a local definition for an in-tree headerEric Anholt2018-11-161-8/+2
| | | | | | | | I need other types from the header now, and "gl.h is big" is not a good reason to duplicate definitions. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>