1203288Srnoland/*-
2203288Srnoland * Copyright 2004 The Unichrome Project. All Rights Reserved.
3203288Srnoland *
4203288Srnoland * Permission is hereby granted, free of charge, to any person obtaining a
5203288Srnoland * copy of this software and associated documentation files (the "Software"),
6203288Srnoland * to deal in the Software without restriction, including without limitation
7203288Srnoland * the rights to use, copy, modify, merge, publish, distribute, sub license,
8203288Srnoland * and/or sell copies of the Software, and to permit persons to whom the
9203288Srnoland * Software is furnished to do so, subject to the following conditions:
10203288Srnoland *
11203288Srnoland * The above copyright notice and this permission notice (including the
12203288Srnoland * next paragraph) shall be included in all copies or substantial portions
13203288Srnoland * of the Software.
14203288Srnoland *
15203288Srnoland * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16203288Srnoland * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17203288Srnoland * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18203288Srnoland * THE UNICHROME PROJECT, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19203288Srnoland * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20203288Srnoland * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21203288Srnoland * DEALINGS IN THE SOFTWARE.
22203288Srnoland *
23203288Srnoland * Author: Thomas Hellstr��m 2004.
24203288Srnoland */
25203288Srnoland
26203288Srnoland#include <sys/cdefs.h>
27203288Srnoland__FBSDID("$FreeBSD$");
28203288Srnoland
29203288Srnoland#ifndef _VIA_VERIFIER_H_
30203288Srnoland#define _VIA_VERIFIER_H_
31203288Srnoland
32203288Srnolandtypedef enum {
33203288Srnoland	no_sequence = 0,
34203288Srnoland	z_address,
35203288Srnoland	dest_address,
36203288Srnoland	tex_address
37203288Srnoland} drm_via_sequence_t;
38203288Srnoland
39203288Srnolandtypedef struct {
40203288Srnoland	unsigned texture;
41203288Srnoland	uint32_t z_addr;
42203288Srnoland	uint32_t d_addr;
43203288Srnoland	uint32_t t_addr[2][10];
44203288Srnoland	uint32_t pitch[2][10];
45203288Srnoland	uint32_t height[2][10];
46203288Srnoland	uint32_t tex_level_lo[2];
47203288Srnoland	uint32_t tex_level_hi[2];
48203288Srnoland	uint32_t tex_palette_size[2];
49203288Srnoland	uint32_t tex_npot[2];
50203288Srnoland	drm_via_sequence_t unfinished;
51203288Srnoland	int agp_texture;
52203288Srnoland	int multitex;
53203288Srnoland	struct drm_device *dev;
54203288Srnoland	drm_local_map_t *map_cache;
55203288Srnoland	uint32_t vertex_count;
56203288Srnoland	int agp;
57203288Srnoland	const uint32_t *buf_start;
58203288Srnoland} drm_via_state_t;
59203288Srnoland
60203288Srnolandextern int via_verify_command_stream(const uint32_t * buf, unsigned int size,
61203288Srnoland				     struct drm_device * dev, int agp);
62203288Srnolandextern int via_parse_command_stream(struct drm_device *dev, const uint32_t *buf,
63203288Srnoland				    unsigned int size);
64203288Srnoland
65203288Srnoland#endif
66