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