示例#1
0
static void
glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv,
                            glamor_pixmap_fbo *fbo)
{
    struct xorg_list *cache;
    int n_format;

#ifdef NO_FBO_CACHE
    glamor_purge_fbo(fbo);
    return;
#else
    n_format = cache_format(fbo->format);

    if (fbo->fb == 0 || fbo->external || n_format == -1
        || glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
        glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX;
        glamor_fbo_expire(glamor_priv);
        glamor_purge_fbo(glamor_priv, fbo);
        return;
    }

    cache = &glamor_priv->fbo_cache[n_format]
        [cache_wbucket(fbo->width)]
        [cache_hbucket(fbo->height)];
    DEBUGF
        ("Put cache entry %p to cache %p w %d h %d format %x fbo %d tex %d \n",
         fbo, cache, fbo->width, fbo->height, fbo->format, fbo->fb, fbo->tex);

    glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
    xorg_list_add(&fbo->list, cache);
    fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
#endif
}
示例#2
0
void
glamor_block_handler(ScreenPtr screen)
{
    glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);

    glamor_make_current(glamor_priv);
    glamor_priv->tick++;
    glFlush();
    glamor_fbo_expire(glamor_priv);
}