summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2018-04-04 16:16:35 +0100
committerAdam Jackson <ajax@redhat.com>2018-04-04 13:46:57 -0400
commitaab5c46ccbe769830cae383330fd62c074a0d2f7 (patch)
tree08762c8f4bdb1e63bb15354207a6fad33ae08c28
parent1b9fa3b64ca420eb54b5e5f28074c326e1fbe825 (diff)
glamor: Push make_exportable into callers
Rather than calling make_exportable from the get_bo entrypoint, make sure that someone has already explicitly requested the pixmap be exportable. This is technically an ABI break in that it changes observable behaviour, but no driver other than modesetting has ever used get_bo. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--glamor/glamor_egl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 0e771b6d2..dd6a9a2df 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -351,7 +351,7 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
struct glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
- if (!glamor_make_pixmap_exportable(pixmap))
+ if (!pixmap_priv->image)
return NULL;
return gbm_bo_import(glamor_egl->gbm, GBM_BO_IMPORT_EGL_IMAGE,
@@ -411,6 +411,9 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
+ if (!glamor_make_pixmap_exportable(pixmap))
+ goto failure;
+
bo = glamor_gbm_bo_from_pixmap(screen, pixmap);
if (!bo)
goto failure;