Merge commit 'origin/gallium-0.1'
[mesa.git] / src / mesa / drivers / dri / s3v / s3v_common.h
1 /*
2 * Author: Max Lingua <sunmax@libero.it>
3 */
4
5 /* WARNING: If you change any of these defines, make sure to change
6 * the kernel include file as well (s3v_drm.h)
7 */
8
9 #ifndef _XF86DRI_S3V_H_
10 #define _XF86DRI_S3V_H_
11
12 #ifndef _S3V_DEFINES_
13 #define _S3V_DEFINES_
14 #define S3V_USE_BATCH 1
15
16 /* #define S3V_BUF_4K 1 */
17
18 #ifdef S3V_BUF_4K
19 #define S3V_DMA_BUF_ORDER 12
20 #define S3V_DMA_BUF_NR 256
21 #else
22 #define S3V_DMA_BUF_ORDER 16 /* -much- better */
23 #define S3V_DMA_BUF_NR 16
24 #endif
25 /* on s3virge you can only choose between *
26 * 4k (2^12) and 64k (2^16) dma bufs */
27 #define S3V_DMA_BUF_SZ (1<<S3V_DMA_BUF_ORDER)
28
29 #define S3V_NR_SAREA_CLIPRECTS 8
30
31 /* Each region is a minimum of 16k (64*64@4bpp)
32 * and there are at most 40 of them.
33 */
34 #define S3V_NR_TEX_REGIONS 64 /* was 40 */
35 #define S3V_LOG_TEX_GRANULARITY 16 /* was 4 */
36 /* 40 * (2 ^ 4) = 640k, that's all we have for tex on 4mb gfx card */
37 /* FIXME: will it work with card with less than 4mb? */
38 /* FIXME: we should set this at run time */
39
40 #endif /* _S3V_DEFINES */
41
42 /*
43 * WARNING: If you change any of these defines, make sure to change
44 * the kernel include file as well (gamma_drm.h)
45 */
46
47 /* Driver specific DRM command indices
48 * NOTE: these are not OS specific, but they are driver specific
49 */
50 #define DRM_S3V_INIT_DMA 0x00
51 #define DRM_S3V_CLEANUP_DMA 0x01
52
53 typedef struct _drmS3VInit {
54 enum {
55 S3V_INIT_DMA = 0x01,
56 S3V_CLEANUP_DMA = 0x02
57 } func;
58
59 unsigned int pcimode; /* bool: 1=pci 0=agp */
60
61 unsigned int mmio_offset;
62 unsigned int buffers_offset;
63 unsigned int sarea_priv_offset;
64
65 unsigned int front_offset;
66 unsigned int front_width;
67 unsigned int front_height;
68 unsigned int front_pitch;
69
70 unsigned int back_offset;
71 unsigned int back_width;
72 unsigned int back_height;
73 unsigned int back_pitch;
74
75 unsigned int depth_offset;
76 unsigned int depth_width;
77 unsigned int depth_height;
78 unsigned int depth_pitch;
79
80 unsigned int texture_offset;
81 } drmS3VInit;
82
83 #endif