diff options
author | Emil Velikov <[email protected]> | 2014-07-23 18:10:08 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-07-30 16:33:09 +0100 |
commit | d93ae21939a0b12e32263dfc14ad672c78d1c2b2 (patch) | |
tree | decefd2b6a81998a5f7fbdb43f8ceea4261c315b /src | |
parent | 85109bc5072391d3ef988f3ebaea66b6579b2b16 (diff) |
st/gbm: retrieve the driver-name via dd_driver_name()
... 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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/gbm/gbm_drm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/gbm/gbm_drm.c b/src/gallium/state_trackers/gbm/gbm_drm.c index bfd48a001bd..077d51806c5 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: |