From e3ea609ce660caae673eba9da0a567ecbb735f0e Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Thu, 26 Nov 2015 16:40:16 +0100 Subject: [PATCH] i965: More verbose errors for dmabuf creation. --- src/mesa/drivers/dri/i965/intel_screen.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index cc90efe..51bad65 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -733,8 +733,21 @@ intel_create_image_from_dma_bufs(__DRIscreen *screen, /* For now only packed formats that have native sampling are supported. */ if (!f || f->nplanes != 1) { - *error = __DRI_IMAGE_ERROR_BAD_MATCH; - return NULL; + char* error_string = NULL; + int ret; + if (!f) + ret = asprintf(&error_string, "DRM format for fourcc %.4s (%d) unsupported", + (char *)&fourcc, fourcc); + else if (f->nplanes != 1) + ret = asprintf(&error_string, "More than one plane is unsupported. " + "Requested %d. Use one EGL image per plane " + "for multi planar formats.", f->nplanes); + if (ret != -1) { + _mesa_warning(NULL, error_string); + free(error_string); + } + *error = __DRI_IMAGE_ERROR_BAD_MATCH; + return NULL; } image = intel_create_image_from_fds(screen, width, height, fourcc, fds, -- 2.6.2