aboutsummaryrefslogtreecommitdiffstats
path: root/src/loader
Commit message (Collapse)AuthorAgeFilesLines
...
* loader/dri3: constify the loader_dri3_vtableEmil Velikov2016-10-142-3/+3
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* loader/dri3: import prime buffers in the currently-bound screenMartin Peres2016-10-071-1/+11
| | | | | | | | | | | | | | | | | | This tries to mirrors the codepath taken by DRI2 in IntelSetTexBuffer2() and fixes many applications when using DRI3: - Totem with libva on hw-accelerated decoding - obs-studio, using Window Capture (Xcomposite) as a Source - gstreamer with VAAPI v2: - introduce get_dri_screen() in the dri3 loader's vtable (krh) Tested-by: Timo Aaltonen <[email protected]> Tested-by: Ionut Biru <[email protected]> Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71759 Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* loader/dri3: add get_dri_screen() to the vtableMartin Peres2016-10-071-0/+1
| | | | | | | | | This allows querying the current active screen from the loader's common code. Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* loader/dri3: Always use at least two back buffersMichel Dänzer2016-09-061-3/+1
| | | | | | | | | | | This can make a significant difference for performance with some extreme test cases such as vblank_mode=0 glxgears. Fixes: 1e3218bc5ba2 ("loader/dri3: Overhaul dri3_update_num_back") Cc: "12.0 11.2" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97549 Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* loader: fix sysfs uevent file parsingFrank Binns2016-09-011-2/+4
| | | | | | | | | | When trying to get a device name for an fd using sysfs, it would always fail as it was expecting key/value pairs to be delimited by '\0', which is not the case. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nouveau: allow NV3x's to be used with nouveau_vieuxIlia Mirkin2016-08-301-1/+3
| | | | | | | | | NV34 and possibly other NV3x hardware has the capability of exposing the NV25 graph class. This allows forcing nouveau_vieux to be used instead of the gallium driver, primarily for testing purposes. (Among other things, NV2x only ever came as AGP or inside an Xbox, never PCI/PCIe). Signed-off-by: Ilia Mirkin <[email protected]>
* loader/dri3: Overhaul dri3_update_num_backMichel Dänzer2016-08-251-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Always use 3 buffers when flipping. With only 2 buffers, we have to wait for a flip to complete (which takes non-0 time even with asynchronous flips) before we can start working on the next frame. We were previously only using 2 buffers for flipping if the X server supports asynchronous flips, even when we're not using asynchronous flips. This could result in bad performance (the referenced bug report is an extreme case, where the inter-frame stalls were preventing the GPU from reaching its maximum clocks). I couldn't measure any performance boost using 4 buffers with flipping. Performance actually seemed to go down slightly, but that might have been just noise. Without flipping, a single back buffer is enough for swap interval 0, but we need to use 2 back buffers when the swap interval is non-0, otherwise we have to wait for the swap interval to pass before we can start working on the next frame. This condition was previously reversed. Cc: "12.0 11.2" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97260 Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* loader/dri3: Destroy Present event context when destroying drawable v2Michel Dänzer2016-08-041-1/+7
| | | | | | | | | | | Without this, the X server may accumulate stale Present event contexts if a client ends up creating and destroying DRI drawables for the same window. v2: Based on Chris Wilson's review: * Use xcb_present_select_input_checked so that protocol errors generated by old X servers can be handled gracefully * Use xcb_discard_reply() instead of free(xcb_request_check())
* loader: fix memory leak in loader_dri3_openJan Ziak2016-08-031-0/+1
| | | | | | | | | Found via "valgrind --leak-check=full glxgears". Signed-off-by: Jan Ziak (http://atom-symbol.net) <[email protected]> Acked-by: Boyan Ding <[email protected]> Cc: "12.0 11.2" <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Use AC_HEADER_MAJOR to include correct header for major().Matt Turner2016-07-261-2/+5
| | | | | | Gentoo has been smoke testing an upcoming change to glibc. Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=580392
* Android: move libdrm settings to top-level Android.common.mkRob Herring2016-06-131-5/+0
| | | | | | | | | | | | | | Fix warnings like these due to HAVE_LIBDRM being inconsistently defined: external/libdrm/include/drm/drm.h:839:30: warning: redefinition of typedef 'drm_clip_rect_t' is a C11 feature [-Wtypedef-redefinition] typedef struct drm_clip_rect drm_clip_rect_t; HAVE_LIBDRM needs to be set project wide to fix this. This change also harmlessly links libdrm with everything, but simplifies the makefiles a bit. Signed-off-by: Rob Herring <[email protected]> Acked-by: Emil Velikov <[email protected]>
* loader: add a libdrm case for loader_get_device_name_for_fdJonathan Gray2016-04-211-1/+25
| | | | | | | | | Use dev_node_from_fd() with HAVE_LIBDRM to provide an implmentation of loader_get_device_name_for_fd() for non-linux systems that use libdrm but don't have udev or sysfs. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* dri: add backbuffer use flagAxel Davy2016-03-091-2/+4
| | | | | | This will be used by the next commit. Reviewed-by: Ian Romanick <[email protected]>
* virtio_gpu: Add PCI ID to driver mapRob Herring2016-01-231-0/+7
| | | | | | | Add the virtio-gpu PCI ID so the driver probing works. Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* loader: unconditionally add AM_CPPFLAGS to libloader_la_CPPFLAGSEmil Velikov2015-11-231-2/+2
| | | | | | | | | | | | | It seems that due to the conditional autotools is getting confused and forgetting to add AM_CPPFLAGS when building libloader (when HAVE_DRICOMMON is not set). Cc: [email protected] Fixes: 5a79e0a8e37 "automake: loader: rework the CPPFLAGS" Reported-by: Pali Rohár <[email protected]> Tested-by: Pali Rohár <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* automake: loader: don't create an empty dri3 helperEmil Velikov2015-11-201-1/+3
| | | | | | | | | | | | | Seems that creating an empty one does not fair too well with MacOSX's ar. Considering that all the users of the helper include it only when needed, let's reshuffle the makefile. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92985 Signed-off-by: Emil Velikov <[email protected]> Tested-by: Vinson Lee <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* automake: loader: honour the XCB_DRI3 cflagsEmil Velikov2015-11-201-0/+1
| | | | | | | | | | Without this the compilation will fail, as the headers are installed in a non-default location. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* automake: loader: rework the CPPFLAGSEmil Velikov2015-11-201-11/+4
| | | | | | | | | | | | | Rather than duplicating things, just use the generic AM_CPPFLAGS. This has the fortunate side-effect of adding VISIBILITY_CFLAGS for the dri3 helper. The latter of which was erroneously exposing some internal symbols. Signed-off-by: Emil Velikov <[email protected]> Reported-by: Kai Wasserbäch <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* loader/dri3: Expose function to create __DRIimage from pixmapBoyan Ding2015-11-172-29/+58
| | | | | | | | | Used to support EGL_KHR_image_pixmap. Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Martin Peres <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: Add dri3 helperBoyan Ding2015-11-173-1/+1622
| | | | | | | | | | | | | | | | | v2: From Martin Peres - Try to fit in the 80-col limit as much as possible v3: From Martin Peres - introduce loader_dri3_helper.la to avoid dragging the xcb dep everywhere (Kristian & Emil) - get rid of the width, height, dri_screen and is_different_gpu vfuncs (Kristian) - replace the create/destroy functions with init/fini for dri3 drawables - prefix static functions with dri3_ and exported ones with loader_dri3 (Emil) - keep the function definition consistent (Emil) Signed-off-by: Boyan Ding <[email protected]> Signed-off-by: Martin Peres <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_HEmil Velikov2015-07-225-15/+8
| | | | | | | | Double negatives in English language are normally avoided, plus the former seems cleaner and more consistent. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* loader: don't leak udev_enumerateGuillaume Desmottes2015-07-111-0/+4
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90073 Signed-off-by: Guillaume Desmottes <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: Look for any version of currently linked libudev.soChris Wilson2015-07-081-18/+28
| | | | | | | | | | | | | | | | | | | | | | Since there was an ABI break and linking twice against libudev.so.0 and libudev.so.1 causes the application to quickly crash, we first check if the application is currently linked against libudev before dlopening a local handle. However for backwards/forwards compatability, we need to inspect the application for current linkage against all known versions first. Not doing so causes a crash when both libraries are present and so mesa chooses libudev.so.1 but the application was linked against libudev.so.0. Signed-off-by: Chris Wilson <[email protected]> Emil Velikov: I'm ever so slightly conserned that RTLD_NOLOAD is not part of the POSIX standard, thus it's missing on some platforms (*BSD seems ok, while Solaris, MacOS are not). Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected]
* loader: move loader_open_device out of HAVE_LIBUDEV blockJulien Isorce2015-06-241-18/+18
| | | | | | | | | | | | | | | | | | Fixes the following build issue, when building without libudev. CCLD libGL.la ./.libs/libglx.a(dri2_glx.o): In function `dri2CreateScreen': src/glx/dri2_glx.c:1186: undefined reference to `loader_open_device' collect2: ld returned 1 exit status CCLD libEGL.la Undefined symbols for architecture x86_64: "_loader_open_device", referenced from: _dri2_initialize_x11_dri2 in libegl_dri2.a(platform_x11.o) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91077 Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: Rename drm_open_device() to loader_open_device() and share itDerek Foreman2015-06-232-3/+6
| | | | | | | | | This is already our common idiom for opening files with CLOEXEC and it's a little ugly, so let's share this one implementation. Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: build xmlconfig to a separate static libraryErik Faye-Lund2015-06-121-7/+3
| | | | | | | | | | | | | | | | | | | | As we use the file from both the dri modules and loader, we end up with multiple definition of the symbols provided in our gallium dri modules. Additionally we compile the file twice. Resolve both issues, effectively enabling the build on toolchains which don't support -Wl,--allow-multiple-definition. v2: [Emil Velikov] - Fix the Scons/Android build. - Resolve libgbm build issues (bring back the missing -lm) Cc: Julien Isorce <[email protected]> Cc: "10.5 10.6" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905 Acked-by: Matt Turner <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* android: loader: export the path to be includedChih-Wei Huang2015-06-091-0/+2
| | | | | Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl: Add needed extern "C" for C++ accessAlexander von Gluck IV2015-05-141-0/+9
| | | | | | * Haiku's egl driver is C++ due to the interface natively being C++ Reviewed-⁠by: Brian Paul <[email protected]>
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* android: use LOCAL_SHARED_LIBRARIES over TARGET_OUT_HEADERSEmil Velikov2015-04-221-1/+1
| | | | | | | | | ... to manage the LIBDRM*_CFLAGS. The former is the recommended approach by the Android build system developers while the latter has been depreciated for quite some time. Cc: "10.4 10.5" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* scons: Don't build loader on Windows.Jose Fonseca2015-03-251-1/+0
| | | | | | EGL was the last user. Reviewed-by: Brian Paul <[email protected]>
* loader: include <sys/stat.h> for non-sysfs buildsEmil Velikov2015-03-161-1/+1
| | | | | | | | | | | Required by fstat(), otherwise we'll error out due to implicit function declaration. Cc: "10.4 10.5" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89530 Signed-off-by: Emil Velikov <[email protected]> Reported-by: Vadim Rutkovsky <[email protected]> Tested-by: Vadim Rutkovsky <[email protected]>
* scons: Use -Werror MSVC compatibility flags per-directory.Jose Fonseca2015-03-041-0/+2
| | | | | | Matching what we already do with autotools builds. Reviewed-by: Brian Paul <[email protected]>
* configure: Leverage gcc warn options to enable safe use of C99 features ↵Jose Fonseca2015-03-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | where possible. The main objective of this change is to enable Linux developers to use more of C99 throughout Mesa, with confidence that the portions that need to be built with MSVC -- and only those portions --, stay portable. This is achieved by using the appropriate -Werror= options only on the places they need to be used. Unfortunately we still need MSVC 2008 on a few portions of the code (namely llvmpipe and its dependencies). I hope to eventually eliminate this so that we can use C99 everywhere, but there are technical/logistic challenges (specifically, newer Windows SDKs no longer bundle MSVC, instead require a full installation of Visual Studio, and that has hindered adoption of newer MSVC versions on our build processes.) Thankfully we have more directy control over our OpenGL driver, which is why we're now able to migrate to MSVC 2013 for most of the tree. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "configure: Leverage gcc warn options to enable safe use of C99 ↵Kenneth Graunke2015-02-271-1/+0
| | | | | | | | | features where possible." This reverts commit 79daa510c7a871a33797308a2ccb4b83a067ffbe. I apparently hadn't done a clean build when testing this; it broke the build for Tom, Ben, and myself. We like the idea; let's try a v2.
* configure: Leverage gcc warn options to enable safe use of C99 features ↵Jose Fonseca2015-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | where possible. The main objective of this change is to enable Linux developers to use more of C99 throughout Mesa, with confidence that the portions that need to be built with MSVC -- and only those portions --, stay portable. This is achieved by using the appropriate -Werror= options only on the places they need to be used. Unfortunately we still need MSVC 2008 on a few portions of the code (namely llvmpipe and its dependencies). I hope to eventually eliminate this so that we can use C99 everywhere, but there are technical/logistic challenges (specifically, newer Windows SDKs no longer bundle MSVC, instead require a full installation of Visual Studio, and that has hindered adoption of newer MSVC versions on our build processes.) Thankfully we have more directy control over our OpenGL driver, which is why we're now able to migrate to MSVC 2013 for most of the tree. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* loader: not having a pci-id should not be a warnRob Clark2015-02-211-3/+6
| | | | | | | | | | If there is no pci-id, which is valid for vc4 and freedreno, just emit an info msg. Keep malformed but existing pci-id's as a warning. Mostly just to clean up a warning that confuses users for the non-pci devices. Signed-off-by: Rob Clark <[email protected]>
* loader: Remove NEED_OPENGL_COMMON check.Matt Turner2015-01-231-2/+0
| | | | HAVE_DRICOMMON is sufficient since OpenGL must be enabled for DRI.
* mesa: Add scons files to distribution.Matt Turner2014-12-121-0/+2
|
* loader: Add headers to distribution.Matt Turner2014-12-121-1/+3
|
* loader: Add missing EXPAT_CFLAGS to libloader.la CPPFLAGSMichael Forney2014-12-081-1/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()Juha-Pekka Heikkila2014-09-231-0/+3
| | | | | Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* loader: fds can be 0Dave Airlie2014-09-061-1/+1
| | | | | | | | Possible resource leak reported by coverity. Reported-by: Coverity scanner. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* android: loader: prefix static libraries with libmesa_*Emil Velikov2014-08-131-2/+2
| | | | | | | Will make it easier on us as CleanSpec.mk comes along and improves consistency across the Android build. Signed-off-by: Emil Velikov <[email protected]>
* android: loader: use the installed libdrm headersEmil Velikov2014-08-131-4/+2
| | | | | | One step closer to the way we handle automake builds. Signed-off-by: Emil Velikov <[email protected]>
* util: Gather some common macrosJason Ekstrand2014-08-041-0/+1
| | | | | | | | | | This gathers macros that have been included across components into util so that the include chain can be more vertical. In particular, this makes util stand on its own without any dependence whatsoever on the rest of mesa. Signed-off-by: "Jason Ekstrand" <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix the condition in src/loader/Makefile.amAxel Davy2014-07-011-0/+2
| | | | | | | | We want to have the dri common files compiled to define USE_DRICONF. We need to check both NEED_OPENGL_COMMON and HAVE_DRICOMMON Signed-off-by: Axel Davy <[email protected]> Tested-by: Brian Paul <[email protected]>
* loader: Use drirc device_id parameter in complement to DRI_PRIMEAxel Davy2014-07-012-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | DRI_PRIME is not very handy, because you have to launch the executable with it set, which is not always easy to do. By using drirc, the user specifies the target executable and the device to use. After that the program will be launched everytime on the target device. For example if .drirc contains: <driconf> <device driver="loader"> <application name="Glmark2" executable="glmark2"> <option name="device_id" value="pci-0000_01_00_0" /> </application> </device> </driconf> Then glmark2 will use if possible the render-node of ID_PATH_TAG pci-0000_01_00_0. v2: Fix compilation issue v3: Add "-lm" and rebase. Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* loader: add gpu selection code via DRI_PRIME.Axel Davy2014-07-012-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: Fix the leak of device_name v3: Rebased It enables to use the DRI_PRIME env var to specify which gpu to use. Two syntax are supported: If DRI_PRIME is 1 it means: take any other gpu than the default one. If DRI_PRIME is the ID_PATH_TAG of a device: choose this device if possible. The ID_PATH_TAG is a tag filled by udev. You can check it with 'udevadm info' on the device node. For example it can be "pci-0000_01_00_0". Render-nodes need to be enabled to choose another gpu, and they need to have the ID_PATH_TAG advertised. It is possible for not very recent udev that the tag is not advertised for render-nodes, then ones need to add a file containing: SUBSYSTEM=="drm", IMPORT{builtin}="path_id" in /etc/udev/rules.d/ Signed-off-by: Axel Davy <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* loader: add optional /sys filesystem method for PCI identification.Gary Wong2014-05-291-0/+112
| | | | | | | | | | | | Introduce a simple PCI identification method of looking up the answer the /sys filesystem (available on Linux). Attempted after libudev, but before DRM. Disabled by default (available only when the --enable-sysfs configure option is specified). Signed-off-by: Gary Wong <[email protected]> Acked-by: Emil Velikov <[email protected]>