[Mesa-dev] [PATCH 1/6] st/gbm: retrieve the driver-name via dd_driver_name()
Emil Velikov
emil.l.velikov at gmail.com
Wed Jul 23 17:43:33 PDT 2014
... on static targets. Otherwise we'll crash badly as gdrm->dev is
NULL when we try to copy the string driver_name.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
src/gallium/state_trackers/gbm/gbm_drm.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/state_trackers/gbm/gbm_drm.c b/src/gallium/state_trackers/gbm/gbm_drm.c
index bfd48a0..077d518 100644
--- a/src/gallium/state_trackers/gbm/gbm_drm.c
+++ b/src/gallium/state_trackers/gbm/gbm_drm.c
@@ -282,7 +282,13 @@ gbm_gallium_drm_device_create(int fd)
if (gdrm->screen == NULL)
goto out_no_screen;
+#if GALLIUM_STATIC_TARGETS
+ gdrm->base.driver_name = strdup(dd_driver_name());
+#else
+#ifdef HAVE_PIPE_LOADER_DRM
gdrm->base.driver_name = strdup(gdrm->dev->driver_name);
+#endif /* HAVE_PIPE_LOADER_DRM */
+#endif
return &gdrm->base.base;
out_no_screen:
--
2.0.2
More information about the mesa-dev
mailing list