142542f5fSchristos/*
242542f5fSchristos * Copyright © 2011-2013 Intel Corporation
342542f5fSchristos *
442542f5fSchristos * Permission is hereby granted, free of charge, to any person obtaining a
542542f5fSchristos * copy of this software and associated documentation files (the "Software"),
642542f5fSchristos * to deal in the Software without restriction, including without limitation
742542f5fSchristos * the rights to use, copy, modify, merge, publish, distribute, sublicense,
842542f5fSchristos * and/or sell copies of the Software, and to permit persons to whom the
942542f5fSchristos * Software is furnished to do so, subject to the following conditions:
1042542f5fSchristos *
1142542f5fSchristos * The above copyright notice and this permission notice (including the next
1242542f5fSchristos * paragraph) shall be included in all copies or substantial portions of the
1342542f5fSchristos * Software.
1442542f5fSchristos *
1542542f5fSchristos * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1642542f5fSchristos * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1742542f5fSchristos * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1842542f5fSchristos * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1942542f5fSchristos * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2042542f5fSchristos * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2142542f5fSchristos * SOFTWARE.
2242542f5fSchristos *
2342542f5fSchristos * Authors:
2442542f5fSchristos *    Chris Wilson <chris@chris-wilson.co.uk>
2542542f5fSchristos *
2642542f5fSchristos */
2742542f5fSchristos
2842542f5fSchristos#ifndef GEN4_COMMON_H
2942542f5fSchristos#define GEN4_COMMON_H
3042542f5fSchristos
3142542f5fSchristos#include "sna.h"
3242542f5fSchristos
3342542f5fSchristosinline static void
3442542f5fSchristosdiscard_vbo(struct sna *sna)
3542542f5fSchristos{
3642542f5fSchristos	kgem_bo_destroy(&sna->kgem, sna->render.vbo);
3742542f5fSchristos	sna->render.vbo = NULL;
3842542f5fSchristos	sna->render.vertices = sna->render.vertex_data;
3942542f5fSchristos	sna->render.vertex_size = ARRAY_SIZE(sna->render.vertex_data);
4042542f5fSchristos	sna->render.vertex_used = 0;
4142542f5fSchristos	sna->render.vertex_index = 0;
4242542f5fSchristos}
4342542f5fSchristos
4442542f5fSchristosvoid gen4_render_flush(struct sna *sna);
4542542f5fSchristosvoid gen4_render_retire(struct kgem *kgem);
4642542f5fSchristosvoid gen4_render_expire(struct kgem *kgem);
4742542f5fSchristos
4842542f5fSchristos#endif /* GEN4_COMMON_H */
4942542f5fSchristos
50