[Mesa-dev] [PATCH 1/3] targets/gbm: exit gracefully if pipe_loader_drm_probe_fd is not available

Tom Stellard tom at stellard.net
Mon Feb 24 06:36:15 PST 2014


These four patches fix the OpenCL build errors.

Tested-by: Tom Stellard <thomas.stellard at amd.com>

On Sat, Feb 22, 2014 at 04:53:47PM +0000, Emil Velikov wrote:
> When one builds without gallium_drm_loader, the above function will
> not be available, thus we'll segfault in gallium_screen_create due
> to memory access violation.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75335
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/gallium/targets/gbm/gbm.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/targets/gbm/gbm.c b/src/gallium/targets/gbm/gbm.c
> index deaa401..160cbb8 100644
> --- a/src/gallium/targets/gbm/gbm.c
> +++ b/src/gallium/targets/gbm/gbm.c
> @@ -49,13 +49,14 @@ int
>  gallium_screen_create(struct gbm_gallium_drm_device *gdrm)
>  {
>     struct pipe_loader_device *dev;
> -#ifdef HAVE_PIPE_LOADER_DRM
> -   int ret;
> +   int ret = 0;
>  
> +#ifdef HAVE_PIPE_LOADER_DRM
>     ret = pipe_loader_drm_probe_fd(&dev, gdrm->base.base.fd, true);
> +#endif /* HAVE_PIPE_LOADER_DRM */
> +
>     if (!ret)
>        return -1;
> -#endif /* HAVE_PIPE_LOADER_DRM */
>  
>     gdrm->screen = pipe_loader_create_screen(dev, get_library_search_path());
>     if (gdrm->screen == NULL) {
> -- 
> 1.9.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list