From aab5c46ccbe769830cae383330fd62c074a0d2f7 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 4 Apr 2018 16:16:35 +0100 Subject: 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 Reported-by: Adam Jackson Reviewed-by: Adam Jackson --- glamor/glamor_egl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'glamor') 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; -- cgit v1.2.3