glamor_pixmap_type_t type = GLAMOR_TEXTURE_ONLY;
glamor_pixmap_private *pixmap_priv;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
- glamor_pixmap_fbo *fbo;
+ glamor_pixmap_fbo *fbo = NULL;
int pitch;
GLenum format;
pixmap_priv->base.box.x2 = w;
pixmap_priv->base.box.y2 = h;
fbo = glamor_create_fbo(glamor_priv, w, h, format, usage);
- }
- else {
- DEBUGF("Create LARGE pixmap %p width %d height %d\n", pixmap, w, h);
+ } else {
+ int tile_size = glamor_priv->max_fbo_size;
+ DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n", pixmap, w, h, tile_size);
pixmap_priv->type = GLAMOR_TEXTURE_LARGE;
fbo = glamor_create_fbo_array(glamor_priv, w, h, format, usage,
- glamor_priv->max_fbo_size,
- glamor_priv->max_fbo_size, pixmap_priv);
+ tile_size, tile_size, pixmap_priv);
}
if (fbo == NULL) {
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
- glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0);
+ if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0))
+ return -1;
return glamor_egl_dri3_fd_name_from_tex(screen,
pixmap,
pixmap_priv->base.fbo->tex,
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
- glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0);
+ if (!glamor_pixmap_ensure_fbo(pixmap, GL_RGBA, 0))
+ return -1;
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
pixmap,
pixmap_priv->base.fbo->tex,
#endif
}
-static void
+static int
glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo)
{
- int status;
+ int status, err = 0;
glamor_make_current(fbo->glamor_priv);
break;
}
- FatalError("destination is framebuffer incomplete: %s [%x]\n",
- str, status);
+ glamor_fallback("glamor: Failed to create fbo, %s\n", str);
+ err = -1;
}
+
+ return err;
}
glamor_pixmap_fbo *
goto done;
}
- if (flag != GLAMOR_CREATE_FBO_NO_FBO)
- glamor_pixmap_ensure_fb(fbo);
+ if (flag != GLAMOR_CREATE_FBO_NO_FBO) {
+ if (glamor_pixmap_ensure_fb(fbo) != 0) {
+ glamor_purge_fbo(fbo);
+ fbo = NULL;
+ }
+ }
done:
return fbo;
pixmap->drawable.height, format);
if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->base.fbo->fb == 0)
- glamor_pixmap_ensure_fb(pixmap_priv->base.fbo);
+ if (glamor_pixmap_ensure_fb(pixmap_priv->base.fbo) != 0)
+ return FALSE;
}
return TRUE;