summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorJean Hertel <[email protected]>2019-09-10 21:00:07 +0200
committerAdam Jackson <[email protected]>2019-09-11 19:28:09 +0000
commit2c1983f75767765686e8308a5841c5c26b5a0348 (patch)
treeac34631f12e9966508465a279c699d451a0947a2 /src/egl/drivers
parent729de1488f49033bc181b8123af5658228a51bf1 (diff)
Fix missing dri2_load_driver on platform_drm
Signed-off-by: Jean Hertel <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index f2491054fe6..7b13129ee3a 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -739,6 +739,21 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
disp->Device = dev;
dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->driver_name);
+ dri2_dpy->is_render_node = drmGetNodeTypeFromFd(dri2_dpy->fd) == DRM_NODE_RENDER;
+
+ /* render nodes cannot use Gem names, and thus do not support
+ * the __DRI_DRI2_LOADER extension */
+ if (!dri2_dpy->is_render_node) {
+ if (!dri2_load_driver(disp)) {
+ err = "DRI2: failed to load driver";
+ goto cleanup;
+ }
+ } else {
+ if (!dri2_load_driver_dri3(disp)) {
+ err = "DRI3: failed to load driver";
+ goto cleanup;
+ }
+ }
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;