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>
This commit is contained in:
Daniel Stone 2018-04-04 16:16:35 +01:00 committed by Adam Jackson
parent 1b9fa3b64c
commit aab5c46ccb

View File

@ -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;