summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2014-02-09 09:13:08 -0800
committerChad Versace <[email protected]>2014-03-17 15:39:23 -0700
commit1787f5632fa40a67e29dc99dc4ff7515b169793b (patch)
tree833571aef745c0bd592ec4371649dd9154a40027 /src/egl/drivers
parent6d1f83ec09164bd805c90785635bbcf861b403e5 (diff)
egl/gbm: Emit EGL_BAD_PARAMETER for eglCreatePlatformPixmapSurface
From the EGL_MESA_platform_gbm spec, version 5: It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy> that belongs to the GBM platform. Any such call fails and generates EGL_BAD_PARAMETER. Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 785139e0eb3..2f7edb9f277 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -149,6 +149,21 @@ dri2_drm_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
native_window, attrib_list);
}
+static _EGLSurface *
+dri2_drm_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
+ _EGLConfig *conf, void *native_window,
+ const EGLint *attrib_list)
+{
+ /* From the EGL_MESA_platform_gbm spec, version 5:
+ *
+ * It is not valid to call eglCreatePlatformPixmapSurfaceEXT with a <dpy>
+ * that belongs to the GBM platform. Any such call fails and generates
+ * EGL_BAD_PARAMETER.
+ */
+ _eglError(EGL_BAD_PARAMETER, "cannot create EGL pixmap surfaces on GBM");
+ return NULL;
+}
+
static EGLBoolean
dri2_drm_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
{
@@ -445,7 +460,7 @@ dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
static struct dri2_egl_display_vtbl dri2_drm_display_vtbl = {
.authenticate = dri2_drm_authenticate,
.create_window_surface = dri2_drm_create_window_surface,
- .create_pixmap_surface = dri2_fallback_create_pixmap_surface,
+ .create_pixmap_surface = dri2_drm_create_pixmap_surface,
.create_pbuffer_surface = dri2_fallback_create_pbuffer_surface,
.destroy_surface = dri2_drm_destroy_surface,
.create_image = dri2_drm_create_image_khr,