1ab47cfaaSmrg/* savage_sarea.h -- Public header for the savage driver (SAREA)
2ab47cfaaSmrg *
3ab47cfaaSmrg * Copyright 2004  Felix Kuehling
4ab47cfaaSmrg * All Rights Reserved.
5ab47cfaaSmrg *
6ab47cfaaSmrg * Permission is hereby granted, free of charge, to any person obtaining a
7ab47cfaaSmrg * copy of this software and associated documentation files (the "Software"),
8ab47cfaaSmrg * to deal in the Software without restriction, including without limitation
9ab47cfaaSmrg * the rights to use, copy, modify, merge, publish, distribute, sub license,
10ab47cfaaSmrg * and/or sell copies of the Software, and to permit persons to whom the
11ab47cfaaSmrg * Software is furnished to do so, subject to the following conditions:
12ab47cfaaSmrg *
13ab47cfaaSmrg * The above copyright notice and this permission notice (including the
14ab47cfaaSmrg * next paragraph) shall be included in all copies or substantial portions
15ab47cfaaSmrg * of the Software.
16ab47cfaaSmrg *
17ab47cfaaSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18ab47cfaaSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19ab47cfaaSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20ab47cfaaSmrg * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21ab47cfaaSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22ab47cfaaSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23ab47cfaaSmrg * DEALINGS IN THE SOFTWARE.
24ab47cfaaSmrg */
25ab47cfaaSmrg
26aa9e3350Smrg#ifndef SAVAGE_SAREA_H
27aa9e3350Smrg#define SAVAGE_SAREA_H
28ab47cfaaSmrg
29aa9e3350Smrg#ifndef SAVAGE_SAREA_DEFINES
30aa9e3350Smrg#define SAVAGE_SAREA_DEFINES
31ab47cfaaSmrg
322b2b4fcbSmrg/* 2 heaps (1 for card, 1 for agp), each divided into up to 128
33ab47cfaaSmrg * regions, subject to a minimum region size of (1<<16) == 64k.
34ab47cfaaSmrg *
35ab47cfaaSmrg * Clients may subdivide regions internally, but when sharing between
36ab47cfaaSmrg * clients, the region size is the minimum granularity.
37ab47cfaaSmrg */
38ab47cfaaSmrg
39ab47cfaaSmrg#define SAVAGE_CARD_HEAP		0
40ab47cfaaSmrg#define SAVAGE_AGP_HEAP			1
41ab47cfaaSmrg#define SAVAGE_NR_TEX_HEAPS		2
42ab47cfaaSmrg#define SAVAGE_NR_TEX_REGIONS		16
43ab47cfaaSmrg#define SAVAGE_LOG_MIN_TEX_REGION_SIZE	16
44ab47cfaaSmrg
45aa9e3350Smrg#endif /* SAVAGE_SAREA_DEFINES */
46ab47cfaaSmrg
47ab47cfaaSmrgtypedef struct {
48ab47cfaaSmrg	/* LRU lists for texture memory in agp space and on the card.
49ab47cfaaSmrg	 */
50ab47cfaaSmrg	drm_tex_region_t texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS+1];
51ab47cfaaSmrg	unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
52ab47cfaaSmrg
53ab47cfaaSmrg	/* Mechanism to validate card state.
54ab47cfaaSmrg	 */
55ab47cfaaSmrg	int ctxOwner;
56ab47cfaaSmrg}  SAVAGESAREAPrivRec, *SAVAGESAREAPrivPtr;
57ab47cfaaSmrg
58aa9e3350Smrg#endif /* SAVAGE_SAREA_H */
59