aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldevice.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: move fallthrough comment so gcc can see itTimothy Arceri2020-07-021-1/+1
| | | | | Acked-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5714>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | | Suggested-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: Don't add hardware device if there is no render node v2.Mathias Fröhlich2019-06-191-2/+2
| | | | | | | | | | | | | | | Do not offer a hardware drm backed egl device if no render node is available. The current implementation will fail on this egl device. On top it issues a warning that is actually missleading. There are finally more error paths that can fail on the way to a hardware backed egl device. Fixing all of them would kind of require opening the drm device and see if there is a usable driver associated with the device. The taken approach avoids a full probe and fixes at least this kind of problem on kvm virtualization hosts I observe here. Fixes: dbb4457d985 ("egl: add EGL_EXT_device_drm support") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* egl: add EGL_platform_device supportEmil Velikov2019-06-051-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new 'platform' is added by default with no guards. It is effectively a copy of the surfaceless one, with updated function names and brand new probe function. Due to the reuse, some of the ifdef HAVE_SURFACELESS_PLATFORM guards have been dropped. A worthy mention are the changes in _egFindDisplay, since the original and dup'd fd are required, we make use of the plat_opt argument. Note that no hacks for eglGetDisplay are added - the API works only with the eglGetPlatformDisplay* API. v2: - s/_eglCompareDeviceDisplay/_eglSameDeviceDisplay/ (Eric) - let ^^ return bool (Eric) - fixup meson build, move files() further up (Eric) - copy from plat. surfaceless w/o the visual cleanups - close and free when destroying the dpy - sprinkle a few _eglDeviceSupports - split fd handling into separate function - use directly the render node if no FD is given (Mathias) v3: - s/dpy/disp/g - drop swap_buffers* callbacks - drop loader_set_logger() - drop local define - re-introduce _eglGetDRMDeviceRenderNode() - EGL_WARN on ForceSoftware with HW device - continue using the HW device - bail out for "EGL_MESA_device_software" until it's fixed - wire-up the Android build v4: - use new style _eglFindDisplay() - split hw vs sw code paths - don't close the internal fd (already handled in FiniDisplay()) - make swrast work (bit hacky bit will do for now) - Android for real, drop autotools - Correct HW + LIBGL_ALWAYS_SOFTWARE check - use the dri2_create_drawable() helper v5: - enhance comment around fd checks (Mathias) - rebase for dri2_init_surface() changes Cc: Mathias Fröhlich <Mathias.Froehlich@gmx.net> Acked-by: Marek Olšák <marek.olsak@amd.com> (v4) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
* egl: keep the software device at the end of the listEmil Velikov2019-06-051-1/+13
| | | | | | | | | | | | | By default, the user is likely to pick the first device so it should not be the least performant (aka software) one. v2: Drop odd comment (Marek) Suggested-by: Marek Olšák <maraeo@gmail.com> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de> (v1) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
* egl: fix libdrm-less buildsEric Engestrom2019-03-051-12/+0
| | | | | | | | | | | | This function was never used, and isn't properly guarded by HAVE_LIBDRM, breaking the build on systems that don't have libdrm. Let's just remove it. Fixes: 7552fcb7b9b98392e6a8 "egl: add base EGL_EXT_device_base implementation" Reported-by: Timo Aaltonen <tjaalton@debian.org> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Emil Velikov <emil.velikov@collabora.com>
* egl: add EGL_EXT_device_drm supportEmil Velikov2018-11-011-0/+113
| | | | | | | | | | | | | | | | | | | | Add implementation based around the drmDevice API. As such it's only available only when building with libdrm. With the latter already a requirement when using !SW code paths in the platform code. Note: the current code will work if a device is hot-plugged. Yet hot-unplugged is not implemented, since I have no ways of testing it. v2: - ddd some _eglDeviceSupports checks - require DRM_NODE_RENDER - add _eglGetDRMDeviceRenderNode helper v3: - flip inverted asserts (Mathias) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* egl: add EGL_MESA_device_software supportEmil Velikov2018-11-011-0/+27
| | | | | | | | | | | | | | | | | | | | | | | Add a plain software device, which is always available. We can safely assign it as the first/initial device in _eglGlobals, although we ensure that's the case with a handful of _eglDeviceSupports checks throughout the code. v2: - s/_eglFindDevice/_eglAddDevice/ (Eric) - s/_eglLookupAllDevices/_eglRefreshDeviceList/ (Eric) - move ^^ helpers into a earlier patch (Eric, Mathias) - set the SW device on _eglGlobal init. (Eric) - add a number of _eglDeviceSupports checks (Mathias) - split Device/Display attach to a separate patch v3: - flip inverted asserts (Mathias) - s/on-stack/static/ (Mathias) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* egl: add base EGL_EXT_device_base implementationEmil Velikov2018-11-011-0/+179
Introduce the API for device query and enumeration. Those at the moment produce nothing useful since zero devices are actually available. That contradicts with the spec, so the extension isn't advertised just yet. With later commits we'll add support for software (always) and hardware devices. Each one exposing the respective extension string. v2: - fold API boilerplate into this patch - move _eglAddDevice, _eglDeviceSupports, _eglRefreshDeviceList to this patch (Eric, Mathias) - make _eglFiniDevice the one called last v3: - comment on the dummy _egl_device_extension enum entry (Eric) - annotate dev as MAYBE_UNUSED (Mathias) Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>