annotate vidix/savage_vid.c @ 22857:77def5093daf

switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
author ben
date Sun, 01 Apr 2007 11:06:06 +0000
parents 9a1e26fef45b
children 6c57087c5a2d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
2 Driver for S3 Savage Series
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
3
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
4 Copyright (C) 2004 by Reza Jelveh
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
5
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
6 Based on the X11 driver and nvidia vid
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
7
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
8 Thanks to Alex Deucher for Support
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
9
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
10 This program is free software; you can redistribute it and/or modify
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
11 it under the terms of the GNU General Public License as published by
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
12 the Free Software Foundation; either version 2 of the License, or
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
13 (at your option) any later version.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
14
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
15 This program is distributed in the hope that it will be useful,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
18 GNU General Public License for more details.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
19
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
20 You should have received a copy of the GNU General Public License
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
21 along with this program; if not, write to the Free Software
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
23
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
24 Changes:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
25 2004-11-09
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
26 Initial version
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
27
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
28 To Do:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
29
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
30 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
31
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
33 #include <errno.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
34 #include <stdio.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
35 #include <stdlib.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
36 #include <string.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
37 #include <inttypes.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
38 #include <unistd.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
39 #include <math.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
40
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
41 #include "vidix.h"
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
42 #include "vidixlib.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
43 #include "fourcc.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
44 #include "../libdha/libdha.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
45 #include "../libdha/pci_ids.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
46 #include "../libdha/pci_names.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
47 #include "../config.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
48
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
49 #include "savage_regs.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
50
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
51
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
52 #define VF_STREAMS_ON 0x0001
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
53 #define BASE_PAD 0xf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
54 #define FRAMEBUFFER_SIZE 1024*2000*4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
55 /**************************************
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
56 S3 streams processor
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
57 **************************************/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
58
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
59 #define EXT_MISC_CTRL2 0x67
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
60
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
61 /* New streams */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
62
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
63 /* CR67[2] = 1 : enable stream 1 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
64 #define ENABLE_STREAM1 0x04
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
65 /* CR67[1] = 1 : enable stream 2 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
66 #define ENABLE_STREAM2 0x02
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
67 /* mask to clear CR67[2,1] */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
68 #define NO_STREAMS 0xF9
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
69 /* CR67[3] = 1 : Mem-mapped regs */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
70 #define USE_MM_FOR_PRI_STREAM 0x08
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
71
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
72 #define HDM_SHIFT 16
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
73 #define HDSCALE_4 (2 << HDM_SHIFT)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
74 #define HDSCALE_8 (3 << HDM_SHIFT)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
75 #define HDSCALE_16 (4 << HDM_SHIFT)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
76 #define HDSCALE_32 (5 << HDM_SHIFT)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
77 #define HDSCALE_64 (6 << HDM_SHIFT)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
78
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
79 /* Old Streams */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
80
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
81 #define ENABLE_STREAMS_OLD 0x0c
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
82 #define NO_STREAMS_OLD 0xf3
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
83 /* CR69[0] = 1 : Mem-mapped regs */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
84 #define USE_MM_FOR_PRI_STREAM_OLD 0x01
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
85
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
86 void SavageStreamsOn(void);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
87
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
88 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
89 * There are two different streams engines used in the Savage line.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
90 * The old engine is in the 3D, 4, Pro, and Twister.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
91 * The new engine is in the 2000, MX, IX, and Super.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
92 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
93
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
94
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
95 /* streams registers for old engine */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
96 #define PSTREAM_CONTROL_REG 0x8180
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
97 #define COL_CHROMA_KEY_CONTROL_REG 0x8184
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
98 #define SSTREAM_CONTROL_REG 0x8190
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
99 #define CHROMA_KEY_UPPER_BOUND_REG 0x8194
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
100 #define SSTREAM_STRETCH_REG 0x8198
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
101 #define COLOR_ADJUSTMENT_REG 0x819C
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
102 #define BLEND_CONTROL_REG 0x81A0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
103 #define PSTREAM_FBADDR0_REG 0x81C0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
104 #define PSTREAM_FBADDR1_REG 0x81C4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
105 #define PSTREAM_STRIDE_REG 0x81C8
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
106 #define DOUBLE_BUFFER_REG 0x81CC
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
107 #define SSTREAM_FBADDR0_REG 0x81D0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
108 #define SSTREAM_FBADDR1_REG 0x81D4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
109 #define SSTREAM_STRIDE_REG 0x81D8
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
110 #define SSTREAM_VSCALE_REG 0x81E0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
111 #define SSTREAM_VINITIAL_REG 0x81E4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
112 #define SSTREAM_LINES_REG 0x81E8
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
113 #define STREAMS_FIFO_REG 0x81EC
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
114 #define PSTREAM_WINDOW_START_REG 0x81F0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
115 #define PSTREAM_WINDOW_SIZE_REG 0x81F4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
116 #define SSTREAM_WINDOW_START_REG 0x81F8
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
117 #define SSTREAM_WINDOW_SIZE_REG 0x81FC
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
118 #define FIFO_CONTROL 0x8200
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
119 #define PSTREAM_FBSIZE_REG 0x8300
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
120 #define SSTREAM_FBSIZE_REG 0x8304
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
121 #define SSTREAM_FBADDR2_REG 0x8308
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
122
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
123 #define OS_XY(x,y) (((x+1)<<16)|(y+1))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
124 #define OS_WH(x,y) (((x-1)<<16)|(y))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
125
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
126 #define PCI_COMMAND_MEM 0x2
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
127 #define MAX_FRAMES 3
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
128 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
129 * @brief Information on PCI device.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
130 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
131 pciinfo_t pci_info;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
132
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
133 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
134 * @brief Unichrome driver colorkey settings.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
135 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
136 static vidix_grkey_t savage_grkey;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
137
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
138 static int frames[VID_PLAY_MAXFRAMES];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
139 uint8_t *vio;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
140 uint8_t mclk_save[3];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
141
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
142 #define outb(reg,val) OUTPORT8(reg,val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
143 #define inb(reg) INPORT8(reg)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
144 #define outw(reg,val) OUTPORT16(reg,val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
145 #define inw(reg) INPORT16(reg)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
146 #define outl(reg,val) OUTPORT32(reg,val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
147 #define inl(reg) INPORT32(reg)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
148
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
149
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
150 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
151 * PCI-Memory IO access macros.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
152 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
153 #define VID_WR08(p,i,val) (((uint8_t *)(p))[(i)]=(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
154 #define VID_RD08(p,i) (((uint8_t *)(p))[(i)])
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
155
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
156 #define VID_WR32(p,i,val) (((uint32_t *)(p))[(i)/4]=(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
157 #define VID_RD32(p,i) (((uint32_t *)(p))[(i)/4])
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
158
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
159 #ifndef USE_RMW_CYCLES
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
160 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
161 * Can be used to inhibit READ-MODIFY-WRITE cycles. On by default.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
162 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
163
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
164 #define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory")
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
165
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
166 #undef VID_WR08
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
167 #define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
168 #undef VID_RD08
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
169 #define VID_RD08(p,i) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
170
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
171 #undef VID_WR16
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
172 #define VID_WR16(p,i,val) ({ MEM_BARRIER(); ((uint16_t *)(p))[(i)/2]=(val); })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
173 #undef VID_RD16
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
174 #define VID_RD16(p,i) ({ MEM_BARRIER(); ((uint16_t *)(p))[(i)/2]; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
175
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
176 #undef VID_WR32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
177 #define VID_WR32(p,i,val) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]=(val); })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
178 #undef VID_RD32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
179 #define VID_RD32(p,i) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
180 #endif /* USE_RMW_CYCLES */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
181
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
182 #define VID_AND32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)&(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
183 #define VID_OR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)|(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
184 #define VID_XOR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)^(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
185
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
186
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
187 /* from x driver */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
188
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
189 #define VGAIN8(addr) VID_RD08(info->control_base+0x8000, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
190 #define VGAIN16(addr) VID_RD16(info->control_base+0x8000, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
191 #define VGAIN(addr) VID_RD32(info->control_base+0x8000, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
192
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
193 #define VGAOUT8(addr,val) VID_WR08(info->control_base+0x8000, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
194 #define VGAOUT16(addr,val) VID_WR16(info->control_base+0x8000, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
195 #define VGAOUT(addr,val) VID_WR32(info->control_base+0x8000, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
196
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
197 #define INREG(addr) VID_RD32(info->control_base, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
198 #define OUTREG(addr,val) VID_WR32(info->control_base, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
199 #define INREG8(addr) VID_RD08(info->control_base, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
200 #define OUTREG8(addr,val) VID_WR08(info->control_base, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
201 #define INREG16(addr) VID_RD16(info->control_base, addr)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
202 #define OUTREG16(addr,val) VID_WR16(info->control_base, addr, val)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
203
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
204 #define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
205
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
206
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
207 void debugout(unsigned int addr, unsigned int val);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
208
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
209
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
210 struct savage_chip {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
211 volatile uint32_t *PMC; /* general control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
212 volatile uint32_t *PME; /* multimedia port */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
213 volatile uint32_t *PFB; /* framebuffer control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
214 volatile uint32_t *PVIDEO; /* overlay control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
215 volatile uint8_t *PCIO; /* SVGA (CRTC, ATTR) registers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
216 volatile uint8_t *PVIO; /* SVGA (MISC, GRAPH, SEQ) registers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
217 volatile uint32_t *PRAMIN; /* instance memory */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
218 volatile uint32_t *PRAMHT; /* hash table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
219 volatile uint32_t *PRAMFC; /* fifo context table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
220 volatile uint32_t *PRAMRO; /* fifo runout table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
221 volatile uint32_t *PFIFO; /* fifo control region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
222 volatile uint32_t *FIFO; /* fifo channels (USER) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
223 volatile uint32_t *PGRAPH; /* graphics engine */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
224
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
225 int arch; /* compatible NV_ARCH_XX define */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
226 unsigned long fbsize; /* framebuffer size */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
227 void (* lock) (struct savage_chip *, int);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
228 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
229 typedef struct savage_chip savage_chip;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
230
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
231
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
232 struct savage_info {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
233 unsigned int use_colorkey;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
234 unsigned int colorkey; /* saved xv colorkey*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
235 unsigned int vidixcolorkey; /*currently used colorkey*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
236 unsigned int depth;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
237 unsigned int bpp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
238 unsigned int videoFlags;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
239 unsigned int format;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
240 unsigned int pitch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
241 unsigned int blendBase;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
242 unsigned int lastKnownPitch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
243 unsigned int displayWidth, displayHeight;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
244 unsigned int brightness,hue,saturation,contrast;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
245 unsigned int src_w,src_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
246 unsigned int drw_w,drw_h; /*scaled width && height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
247 unsigned int wx,wy; /*window x && y*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
248 unsigned int screen_x; /*screen width*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
249 unsigned int screen_y; /*screen height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
250 unsigned long buffer_size; /* size of the image buffer */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
251 struct savage_chip chip; /* NV architecture structure */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
252 void* video_base; /* virtual address of control region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
253 void* control_base; /* virtual address of fb region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
254 unsigned long picture_base; /* direct pointer to video picture */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
255 unsigned long picture_offset; /* offset of video picture in frame buffer */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
256 // struct savage_dma dma; /* DMA structure */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
257 unsigned int cur_frame;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
258 unsigned int num_frames; /* number of buffers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
259 int bps; /* bytes per line */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
260 void (*SavageWaitIdle) ();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
261 void (*SavageWaitFifo) (int space);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
262 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
263 typedef struct savage_info savage_info;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
264
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
265
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
266 static savage_info* info;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
267
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
268
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
269 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
270 * @brief Unichrome driver vidix capabilities.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
271 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
272 static vidix_capability_t savage_cap = {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
273 "Savage/ProSavage/Twister vidix",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
274 "Reza Jelveh <reza.jelveh@tuhh.de>",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
275 TYPE_OUTPUT,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
276 {0, 0, 0, 0},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
277 4096,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
278 4096,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
279 4,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
280 4,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
281 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
282 FLAG_UPSCALER | FLAG_DOWNSCALER,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
283 VENDOR_S3_INC,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
284 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
285 {0, 0, 0, 0}
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
286 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
287
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
288 struct savage_cards {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
289 unsigned short chip_id;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
290 unsigned short arch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
291 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
292
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
293
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
294 static
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
295 unsigned int GetBlendForFourCC( int id )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
296 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
297 switch( id ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
298 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
299 case IMGFMT_YV12:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
300 case IMGFMT_I420:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
301 return 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
302 case IMGFMT_Y211:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
303 return 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
304 case IMGFMT_RGB15:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
305 return 3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
306 case IMGFMT_RGB16:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
307 return 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
308 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
309 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
310 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
311 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
312
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
313 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
314 * @brief list of card IDs compliant with the Unichrome driver .
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
315 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
316 static struct savage_cards savage_card_ids[] = {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
317 /*[ProSavage PN133] AGP4X VGA Controller (Twister)*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
318 { PCI_CHIP_S3TWISTER_P, S3_PROSAVAGE },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
319 /*[ProSavage KN133] AGP4X VGA Controller (TwisterK)*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
320 { PCI_CHIP_S3TWISTER_K, S3_PROSAVAGE },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
321 /*ProSavage DDR*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
322 { PCI_CHIP_PROSAVAGE_DDR , S3_PROSAVAGE },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
323 /*[ProSavageDDR P4M266 K] */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
324 { PCI_CHIP_PROSAVAGE_DDRK , S3_PROSAVAGE },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
325 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
326
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
327 static void SavageSetColorOld(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
328 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
329
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
330
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
331 if(
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
332 (info->format == IMGFMT_RGB15) ||
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
333 (info->format == IMGFMT_RGB16)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
334 )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
335 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
336 OUTREG( COLOR_ADJUSTMENT_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
337 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
338 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
339 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
340 /* Change 0..255 into 0..15 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
341 long sat = info->saturation * 16 / 256;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
342 double hue = info->hue * 0.017453292;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
343 unsigned long hs1 = ((long)(sat * cos(hue))) & 0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
344 unsigned long hs2 = ((long)(sat * sin(hue))) & 0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
345
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
346 OUTREG( COLOR_ADJUSTMENT_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
347 0x80008000 |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
348 (info->brightness + 128) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
349 ((info->contrast & 0xf8) << (12-7)) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
350 (hs1 << 16) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
351 (hs2 << 24)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
352 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
353 debugout( COLOR_ADJUSTMENT_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
354 0x80008000 |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
355 (info->brightness + 128) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
356 ((info->contrast & 0xf8) << (12-7)) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
357 (hs1 << 16) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
358 (hs2 << 24)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
359 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
360
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
361 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
362 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
363
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
364 static void SavageSetColorKeyOld(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
365 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
366 int red, green, blue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
367
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
368 /* Here, we reset the colorkey and all the controls. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
369
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
370 red = (info->vidixcolorkey & 0x00FF0000) >> 16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
371 green = (info->vidixcolorkey & 0x0000FF00) >> 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
372 blue = info->vidixcolorkey & 0x000000FF;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
373
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
374 if( !info->vidixcolorkey ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
375 printf("SavageSetColorKey disabling colorkey\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
376 OUTREG( COL_CHROMA_KEY_CONTROL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
377 OUTREG( CHROMA_KEY_UPPER_BOUND_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
378 OUTREG( BLEND_CONTROL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
379 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
380 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
381 switch (info->depth) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
382 // FIXME: isnt fixed yet
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
383 case 8:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
384 OUTREG( COL_CHROMA_KEY_CONTROL_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
385 0x37000000 | (info->vidixcolorkey & 0xFF) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
386 OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
387 0x00000000 | (info->vidixcolorkey & 0xFF) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
388 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
389 case 15:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
390 /* 15 bpp 555 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
391 red&=0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
392 green&=0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
393 blue&=0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
394 OUTREG( COL_CHROMA_KEY_CONTROL_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
395 0x05000000 | (red<<19) | (green<<11) | (blue<<3) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
396 OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
397 0x00000000 | (red<<19) | (green<<11) | (blue<<3) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
398 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
399 case 16:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
400 /* 16 bpp 565 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
401 red&=0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
402 green&=0x3f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
403 blue&=0x1f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
404 OUTREG( COL_CHROMA_KEY_CONTROL_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
405 0x16000000 | (red<<19) | (green<<10) | (blue<<3) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
406 OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
407 0x00020002 | (red<<19) | (green<<10) | (blue<<3) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
408 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
409 case 24:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
410 /* 24 bpp 888 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
411 OUTREG( COL_CHROMA_KEY_CONTROL_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
412 0x17000000 | (red<<16) | (green<<8) | (blue) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
413 OUTREG( CHROMA_KEY_UPPER_BOUND_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
414 0x00000000 | (red<<16) | (green<<8) | (blue) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
415 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
416 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
417
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
418 /* We use destination colorkey */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
419 OUTREG( BLEND_CONTROL_REG, 0x05000000 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
420 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
421 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
422
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
423
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
424 static void
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
425 SavageDisplayVideoOld(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
426 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
427 int vgaCRIndex, vgaCRReg, vgaIOBase;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
428 unsigned int ssControl;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
429 int cr92;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
430
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
431
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
432 vgaIOBase = 0x3d0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
433 vgaCRIndex = vgaIOBase + 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
434 vgaCRReg = vgaIOBase + 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
435
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
436 // if( psav->videoFourCC != id )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
437 // SavageStreamsOff(pScrn);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
438
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
439 if( !info->videoFlags & VF_STREAMS_ON )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
440 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
441 SavageStreamsOn();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
442 // SavageResetVideo();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
443 SavageSetColorOld();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
444 SavageSetColorKeyOld();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
445 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
446
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
447
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
448
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
449
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
450 /* Set surface format. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
451
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
452 OUTREG(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
453
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
454 debugout(SSTREAM_CONTROL_REG,GetBlendForFourCC(info->format) << 24 | info->src_w);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
455
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
456 /* Calculate horizontal scale factor. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
457
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
458 //FIXME: enable scaling
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
459 OUTREG(SSTREAM_STRETCH_REG, (info->src_w << 15) / info->drw_w );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
460 // debugout(SSTREAM_STRETCH_REG, 1 << 15);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
461
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
462 OUTREG(SSTREAM_LINES_REG, info->src_h );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
463 debugout(SSTREAM_LINES_REG, info->src_h );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
464
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
465
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
466 OUTREG(SSTREAM_VINITIAL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
467 debugout(SSTREAM_VINITIAL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
468 /* Calculate vertical scale factor. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
469
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
470 // OUTREG(SSTREAM_VSCALE_REG, 1 << 15);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
471 OUTREG(SSTREAM_VSCALE_REG, VSCALING(info->src_h,info->drw_h) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
472 debugout(SSTREAM_VSCALE_REG, VSCALING(info->src_h,info->drw_h) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
473 // OUTREG(SSTREAM_VSCALE_REG, (info->src_h << 15) / info->drw_h );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
474
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
475 /* Set surface location and stride. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
476
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
477 OUTREG(SSTREAM_FBADDR0_REG, info->picture_offset );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
478 debugout(SSTREAM_FBADDR0_REG, info->picture_offset );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
479
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
480 OUTREG(SSTREAM_FBADDR1_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
481 debugout(SSTREAM_FBADDR1_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
482
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
483 OUTREG(SSTREAM_STRIDE_REG, info->pitch );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
484 debugout(SSTREAM_STRIDE_REG, info->pitch );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
485
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
486 OUTREG(SSTREAM_WINDOW_START_REG, OS_XY(info->wx, info->wy) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
487 debugout(SSTREAM_WINDOW_START_REG, OS_XY(info->wx, info->wy) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
488 OUTREG(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
489 debugout(SSTREAM_WINDOW_SIZE_REG, OS_WH(info->drw_w, info->drw_h) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
490
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
491
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
492
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
493 ssControl = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
494
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
495 if( info->src_w > (info->drw_w << 1) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
496 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
497 /* BUGBUG shouldn't this be >=? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
498 if( info->src_w <= (info->drw_w << 2) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
499 ssControl |= HDSCALE_4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
500 else if( info->src_w > (info->drw_w << 3) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
501 ssControl |= HDSCALE_8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
502 else if( info->src_w > (info->drw_w << 4) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
503 ssControl |= HDSCALE_16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
504 else if( info->src_w > (info->drw_w << 5) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
505 ssControl |= HDSCALE_32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
506 else if( info->src_w > (info->drw_w << 6) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
507 ssControl |= HDSCALE_64;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
508 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
509
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
510 ssControl |= info->src_w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
511 ssControl |= (1 << 24);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
512
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
513 //FIXME: enable scaling
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
514 OUTREG(SSTREAM_CONTROL_REG, ssControl);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
515 debugout(SSTREAM_CONTROL_REG, ssControl);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
516
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
517 // FIXME: this should actually be enabled
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
518
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
519 info->pitch = (info->pitch + 7) / 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
520 VGAOUT8(vgaCRIndex, 0x92);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
521 cr92 = VGAIN8(vgaCRReg);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
522 VGAOUT8(vgaCRReg, (cr92 & 0x40) | (info->pitch >> 8) | 0x80);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
523 VGAOUT8(vgaCRIndex, 0x93);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
524 VGAOUT8(vgaCRReg, info->pitch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
525 OUTREG(STREAMS_FIFO_REG, 2 | 25 << 5 | 32 << 11);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
526
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
527
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
528
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
529
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
530 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
531
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
532 static void SavageInitStreamsOld(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
533 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
534 /*unsigned long jDelta;*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
535 unsigned long format = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
536
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
537 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
538 * For the OLD streams engine, several of these registers
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
539 * cannot be touched unless streams are on. Seems backwards to me;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
540 * I'd want to set 'em up, then cut 'em loose.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
541 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
542
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
543
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
544 /*jDelta = pScrn->displayWidth * (pScrn->bitsPerPixel + 7) / 8;*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
545 switch( info->depth ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
546 case 8: format = 0 << 24; break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
547 case 15: format = 3 << 24; break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
548 case 16: format = 5 << 24; break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
549 case 24: format = 7 << 24; break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
550 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
551 #warning enable this again
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
552 OUTREG(PSTREAM_FBSIZE_REG,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
553 info->screen_y * info->screen_x * (info->bpp >> 3));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
554
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
555 OUTREG( PSTREAM_WINDOW_START_REG, OS_XY(0,0) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
556 OUTREG( PSTREAM_WINDOW_SIZE_REG, OS_WH(info->screen_x, info->screen_y) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
557 OUTREG( PSTREAM_FBADDR1_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
558 /*OUTREG( PSTREAM_STRIDE_REG, jDelta );*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
559 OUTREG( PSTREAM_CONTROL_REG, format );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
560 OUTREG( PSTREAM_FBADDR0_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
561
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
562 /*OUTREG( PSTREAM_FBSIZE_REG, jDelta * pScrn->virtualY >> 3 );*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
563
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
564 OUTREG( COL_CHROMA_KEY_CONTROL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
565 OUTREG( SSTREAM_CONTROL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
566 OUTREG( CHROMA_KEY_UPPER_BOUND_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
567 OUTREG( SSTREAM_STRETCH_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
568 OUTREG( COLOR_ADJUSTMENT_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
569 OUTREG( BLEND_CONTROL_REG, 1 << 24 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
570 OUTREG( DOUBLE_BUFFER_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
571 OUTREG( SSTREAM_FBADDR0_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
572 OUTREG( SSTREAM_FBADDR1_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
573 OUTREG( SSTREAM_FBADDR2_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
574 OUTREG( SSTREAM_FBSIZE_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
575 OUTREG( SSTREAM_STRIDE_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
576 OUTREG( SSTREAM_VSCALE_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
577 OUTREG( SSTREAM_LINES_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
578 OUTREG( SSTREAM_VINITIAL_REG, 0 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
579 #warning is this needed?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
580 OUTREG( SSTREAM_WINDOW_START_REG, OS_XY(0xfffe, 0xfffe) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
581 OUTREG( SSTREAM_WINDOW_SIZE_REG, OS_WH(10,2) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
582
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
583 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
584
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
585 void
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
586 SavageStreamsOn(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
587 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
588 unsigned char jStreamsControl;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
589 unsigned short vgaCRIndex = 0x3d0 + 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
590 unsigned short vgaCRReg = 0x3d0 + 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
591
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
592 // xf86ErrorFVerb(STREAMS_TRACE, "SavageStreamsOn\n" );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
593
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
594 /* Sequence stolen from streams.c in M7 NT driver */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
595
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
596
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
597 enable_app_io ();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
598
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
599 /* Unlock extended registers. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
600
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
601 /* FIXME: it looks like mmaped io is broken with vgaout16 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
602 VGAOUT16(vgaCRIndex, 0x4838 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
603 VGAOUT16(vgaCRIndex, 0xa039);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
604 VGAOUT16(0x3c4, 0x0608);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
605
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
606
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
607
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
608 VGAOUT8( vgaCRIndex, EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
609
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
610 if( S3_SAVAGE_MOBILE_SERIES(info->chip.arch) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
611 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
612 // SavageInitStreamsNew( pScrn );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
613
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
614 jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAM1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
615
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
616 /* Wait for VBLANK. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
617 VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
618 /* Fire up streams! */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
619 VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
620 /* These values specify brightness, contrast, saturation and hue. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
621 OUTREG( SEC_STREAM_COLOR_CONVERT1, 0x0000C892 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
622 OUTREG( SEC_STREAM_COLOR_CONVERT2, 0x00039F9A );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
623 OUTREG( SEC_STREAM_COLOR_CONVERT3, 0x01F1547E );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
624 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
625 else if (info->chip.arch == S3_SAVAGE2000)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
626 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
627 // SavageInitStreams2000( pScrn );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
628
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
629 jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAM1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
630
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
631 /* Wait for VBLANK. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
632 VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
633 /* Fire up streams! */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
634 VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
635 /* These values specify brightness, contrast, saturation and hue. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
636 OUTREG( SEC_STREAM_COLOR_CONVERT0_2000, 0x0000C892 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
637 OUTREG( SEC_STREAM_COLOR_CONVERT1_2000, 0x00033400 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
638 OUTREG( SEC_STREAM_COLOR_CONVERT2_2000, 0x000001CF );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
639 OUTREG( SEC_STREAM_COLOR_CONVERT3_2000, 0x01F1547E );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
640 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
641 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
642 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
643 jStreamsControl = VGAIN8( vgaCRReg ) | ENABLE_STREAMS_OLD;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
644
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
645 /* Wait for VBLANK. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
646
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
647 VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
648
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
649 /* Fire up streams! */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
650
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
651 VGAOUT16( vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
652
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
653 SavageInitStreamsOld( );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
654 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
655
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
656 /* Wait for VBLANK. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
657
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
658 VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
659
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
660 /* Turn on secondary stream TV flicker filter, once we support TV. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
661
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
662 /* SR70 |= 0x10 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
663
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
664 info->videoFlags |= VF_STREAMS_ON;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
665
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
666 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
667
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
668
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
669
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
670
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
671 static void savage_getscreenproperties(struct savage_info *info){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
672 unsigned char bpp=0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
673 uint32_t width=0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
674
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
675 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
676
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
677 vgaIOBase = 0x3d0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
678 vgaCRIndex = vgaIOBase + 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
679 vgaCRReg = vgaIOBase + 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
680
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
681
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
682 /* a little reversed from x driver source code */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
683 VGAOUT8(vgaCRIndex, 0x67);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
684 bpp = VGAIN8(vgaCRReg);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
685
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
686
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
687 switch (bpp&0xf0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
688 case 0x00:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
689 case 0x10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
690 info->depth=8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
691 info->bpp=8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
692 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
693 case 0x20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
694 case 0x30:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
695 info->depth=15;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
696 info->bpp=16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
697 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
698 case 0x40:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
699 case 0x50:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
700 info->depth=16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
701 info->bpp=16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
702 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
703 case 0x70:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
704 case 0xd0:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
705 info->depth=24;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
706 info->bpp=32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
707 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
708
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
709
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
710 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
711
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
712
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
713 VGAOUT8(vgaCRIndex, 0x1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
714 info->screen_x = (1 + VGAIN8(vgaCRReg)) <<3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
715 /*get screen height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
716 /* get first 8 bits in VT_DISPLAY_END*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
717 VGAOUT8(0x03D4, 0x12);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
718 info->screen_y = VGAIN8(0x03D5);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
719 VGAOUT8(0x03D4,0x07);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
720 /* get 9th bit in CRTC_OVERFLOW*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
721 info->screen_y |= (VGAIN8(0x03D5) &0x02)<<7;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
722 /* and the 10th in CRTC_OVERFLOW*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
723 info->screen_y |=(VGAIN8(0x03D5) &0x40)<<3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
724 ++info->screen_y;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
725
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
726 printf("screen_x = %d, screen_y = %d, bpp = %d\n",info->screen_x,info->screen_y,info->bpp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
727 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
728
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
729
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
730 static void SavageStreamsOff(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
731 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
732 unsigned char jStreamsControl;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
733 unsigned short vgaCRIndex = 0x3d0 + 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
734 unsigned short vgaCRReg = 0x3d0 + 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
735
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
736
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
737 /* Unlock extended registers. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
738
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
739 VGAOUT16(vgaCRIndex, 0x4838);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
740 VGAOUT16(vgaCRIndex, 0xa039);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
741 VGAOUT16(0x3c4, 0x0608);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
742
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
743 VGAOUT8( vgaCRIndex, EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
744 if( S3_SAVAGE_MOBILE_SERIES(info->chip.arch) ||
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
745 (info->chip.arch == S3_SUPERSAVAGE) ||
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
746 (info->chip.arch == S3_SAVAGE2000) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
747 jStreamsControl = VGAIN8( vgaCRReg ) & NO_STREAMS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
748 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
749 jStreamsControl = VGAIN8( vgaCRReg ) & NO_STREAMS_OLD;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
750
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
751 /* Wait for VBLANK. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
752
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
753 VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
754
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
755 /* Kill streams. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
756
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
757 VGAOUT16(vgaCRIndex, (jStreamsControl << 8) | EXT_MISC_CTRL2 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
758
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
759 VGAOUT16(vgaCRIndex, 0x0093 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
760 VGAOUT8( vgaCRIndex, 0x92 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
761 VGAOUT8( vgaCRReg, VGAIN8(vgaCRReg) & 0x40 );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
762
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
763 info->videoFlags &= ~VF_STREAMS_ON;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
764 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
765
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
766
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
767 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
768 * @brief Check age of driver.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
769 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
770 * @return vidix version number.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
771 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
772 static unsigned int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
773 savage_get_version (void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
774 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
775 return (VIDIX_VERSION);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
776 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
777
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
778 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
779 * @brief Find chip index in Unichrome compliant devices list.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
780 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
781 * @param chip_id PCI device ID.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
782 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
783 * @returns index position in savage_card_ids if successful.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
784 * -1 if chip_id is not a compliant chipset ID.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
785 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
786
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
787 static int find_chip(unsigned chip_id){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
788 unsigned i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
789 for(i = 0;i < sizeof(savage_card_ids)/sizeof(struct savage_cards);i++)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
790 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
791 if(chip_id == savage_card_ids[i].chip_id)return i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
792 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
793 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
794 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
795
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
796 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
797 * @brief Probe hardware to find some useable chipset.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
798 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
799 * @param verbose specifies verbose level.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
800 * @param force specifies force mode : driver should ignore
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
801 * device_id (danger but useful for new devices)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
802 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
803 * @returns 0 if it can handle something in PC.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
804 * a negative error code otherwise.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
805 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
806
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
807 static int savage_probe(int verbose, int force){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
808 pciinfo_t lst[MAX_PCI_DEVICES];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
809 unsigned i,num_pci;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
810 int err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
811
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
812 if (force)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
813 printf("[savage_vid]: warning: forcing not supported yet!\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
814 err = pci_scan(lst,&num_pci);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
815 if(err){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
816 printf("[savage_vid] Error occurred during pci scan: %s\n",strerror(err));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
817 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
818 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
819 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
820 err = ENXIO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
821 for(i=0; i < num_pci; i++){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
822 if(lst[i].vendor == VENDOR_S3_INC) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
823 int idx;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
824 const char *dname;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
825 idx = find_chip(lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
826 if(idx == -1)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
827 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
828 dname = pci_device_name(lst[i].vendor, lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
829 dname = dname ? dname : "Unknown chip";
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
830 printf("[savage_vid] Found chip: %s\n", dname);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
831 // FIXME: whats wrong here?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
832 if ((lst[i].command & PCI_COMMAND_IO ) == 0){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
833 printf("[savage_vid] Device is disabled, ignoring\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
834 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
835 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
836 savage_cap.device_id = lst[i].device;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
837 err = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
838 memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
839 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
840 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
841 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
842 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
843 if(err && verbose) printf("[savage_vid] Can't find chip\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
844 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
845 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
846
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
847 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
848 * @brief Initializes driver.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
849 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
850 * @returns 0 if ok.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
851 * a negative error code otherwise.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
852 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
853 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
854 savage_init (void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
855 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
856 int mtrr;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
857 unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
858
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
859 static unsigned char RamSavage3D[] = { 8, 4, 4, 2 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
860 static unsigned char RamSavage4[] = { 2, 4, 8, 12, 16, 32, 64, 32 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
861 static unsigned char RamSavageMX[] = { 2, 8, 4, 16, 8, 16, 4, 16 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
862 static unsigned char RamSavageNB[] = { 0, 2, 4, 8, 16, 32, 16, 2 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
863
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
864 int videoRam, videoRambytes;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
865
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
866 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
867
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
868 unsigned char val;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
869
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
870 vgaIOBase = 0x3d0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
871 vgaCRIndex = vgaIOBase + 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
872 vgaCRReg = vgaIOBase + 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
873
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
874 fprintf(stderr, "vixInit enter \n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
875 // //getc(stdin);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
876
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
877 info = calloc(1,sizeof(savage_info));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
878
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
879
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
880 /* need this if we want direct outb and inb access? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
881 enable_app_io ();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
882
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
883 /* 12mb + 32kb ? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
884 /* allocate some space for control registers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
885 info->chip.arch = savage_card_ids[find_chip(pci_info.device)].arch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
886
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
887 if (info->chip.arch == S3_SAVAGE3D) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
888 info->control_base = map_phys_mem(pci_info.base0+SAVAGE_NEWMMIO_REGBASE_S3, SAVAGE_NEWMMIO_REGSIZE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
889 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
890 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
891 info->control_base = map_phys_mem(pci_info.base0+SAVAGE_NEWMMIO_REGBASE_S4, SAVAGE_NEWMMIO_REGSIZE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
892 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
893
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
894 // info->chip.PCIO = (uint8_t *) (info->control_base + SAVAGE_NEWMMIO_VGABASE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
895
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
896 // FIXME: enable mmio?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
897 val = VGAIN8 (0x3c3);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
898 VGAOUT8 (0x3c3, val | 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
899 val = VGAIN8 (0x3cc);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
900 VGAOUT8 (0x3c2, val | 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
901
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
902 if (info->chip.arch >= S3_SAVAGE4)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
903 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
904 VGAOUT8 (0x3d4, 0x40);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
905 val = VGAIN8 (0x3d5);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
906 VGAOUT8 (0x3d5, val | 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
907 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
908
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
909
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
910
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
911 /* unprotect CRTC[0-7] */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
912 VGAOUT8(vgaCRIndex, 0x11);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
913 tmp = VGAIN8(vgaCRReg);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
914 // printf("$########## tmp = %d\n",tmp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
915 VGAOUT8(vgaCRReg, tmp & 0x7f);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
916
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
917
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
918 /* unlock extended regs */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
919 VGAOUT16(vgaCRIndex, 0x4838);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
920 VGAOUT16(vgaCRIndex, 0xa039);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
921 VGAOUT16(0x3c4, 0x0608);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
922
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
923 VGAOUT8(vgaCRIndex, 0x40);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
924 tmp = VGAIN8(vgaCRReg);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
925 VGAOUT8(vgaCRReg, tmp & ~0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
926
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
927 /* unlock sys regs */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
928 VGAOUT8(vgaCRIndex, 0x38);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
929 VGAOUT8(vgaCRReg, 0x48);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
930
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
931 /* Unlock system registers. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
932 VGAOUT16(vgaCRIndex, 0x4838);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
933
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
934 /* Next go on to detect amount of installed ram */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
935
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
936 VGAOUT8(vgaCRIndex, 0x36); /* for register CR36 (CONFG_REG1), */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
937 config1 = VGAIN8(vgaCRReg); /* get amount of vram installed */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
938
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
939
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
940 switch( info->chip.arch ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
941 case S3_SAVAGE3D:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
942 videoRam = RamSavage3D[ (config1 & 0xC0) >> 6 ] * 1024;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
943 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
944
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
945 case S3_SAVAGE4:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
946 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
947 * The Savage4 has one ugly special case to consider. On
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
948 * systems with 4 banks of 2Mx32 SDRAM, the BIOS says 4MB
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
949 * when it really means 8MB. Why do it the same when you
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
950 * can do it different...
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
951 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
952 VGAOUT8(0x3d4, 0x68); /* memory control 1 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
953 if( (VGAIN8(0x3d5) & 0xC0) == (0x01 << 6) )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
954 RamSavage4[1] = 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
955
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
956 /*FALLTHROUGH*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
957
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
958 case S3_SAVAGE2000:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
959 videoRam = RamSavage4[ (config1 & 0xE0) >> 5 ] * 1024;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
960 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
961
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
962 case S3_SAVAGE_MX:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
963 videoRam = RamSavageMX[ (config1 & 0x0E) >> 1 ] * 1024;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
964 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
965
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
966 case S3_PROSAVAGE:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
967 videoRam = RamSavageNB[ (config1 & 0xE0) >> 5 ] * 1024;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
968 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
969
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
970 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
971 /* How did we get here? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
972 videoRam = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
973 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
974 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
975
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
976
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
977 printf("###### videoRam = %d\n",videoRam);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
978 info->chip.fbsize = videoRam * 1024;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
979
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
980
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
981 /* reset graphics engine to avoid memory corruption */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
982 /* VGAOUT8 (0x3d4, 0x66);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
983 cr66 = VGAIN8 (0x3d5);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
984 VGAOUT8 (0x3d5, cr66 | 0x02);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
985 udelay (10000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
986
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
987 VGAOUT8 (0x3d4, 0x66);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
988 VGAOUT8 (0x3d5, cr66 & ~0x02); /* clear reset flag */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
989 /* udelay (10000); */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
990
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
991 /* This maps framebuffer @6MB, thus 2MB are left for video. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
992 if (info->chip.arch == S3_SAVAGE3D) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
993 info->video_base = map_phys_mem(pci_info.base0, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
994 info->picture_offset = 1024*768* 4 * ((info->chip.fbsize > 4194304)?2:1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
995 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
996 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
997 info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
998 info->picture_offset = info->chip.fbsize - FRAMEBUFFER_SIZE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
999 // info->picture_offset = 1024*1024* 4 * 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1000 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1001 if ( info->video_base < 0 ){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1002 printf("errno = %s\n", strerror(errno));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1003 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1004 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1005
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1006
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1007 info->picture_base = (uint32_t) info->video_base + info->picture_offset;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1008
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1009 if ( info->chip.arch == S3_SAVAGE3D ){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1010 mtrr = mtrr_set_type(pci_info.base0, info->chip.fbsize, MTRR_TYPE_WRCOMB);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1011 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1012 else{
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1013 mtrr = mtrr_set_type(pci_info.base1, info->chip.fbsize, MTRR_TYPE_WRCOMB);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1014 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1015
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1016 if (mtrr!= 0)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1017 printf("[savage_vid] unable to setup MTRR: %s\n", strerror(mtrr));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1018 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1019 printf("[savage_vid] MTRR set up\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1020
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1021 /* This may trash your screen for resolutions greater than 1024x768, sorry. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1022
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1023
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1024 savage_getscreenproperties(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1025 // return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1026 info->videoFlags = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1027
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1028 SavageStreamsOn();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1029 //getc(stdin);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1030 //FIXME ADD
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1031 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1032 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1033
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1034 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1035 * @brief Destroys driver.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1036 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1037 static void
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1038 savage_destroy (void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1039 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1040 unmap_phys_mem(info->video_base, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1041 unmap_phys_mem(info->control_base, SAVAGE_NEWMMIO_REGSIZE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1042 //FIXME ADD
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1043 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1044
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1045 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1046 * @brief Get chipset's hardware capabilities.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1047 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1048 * @param to Pointer to the vidix_capability_t structure to be filled.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1049 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1050 * @returns 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1051 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1052 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1053 savage_get_caps (vidix_capability_t * to)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1054 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1055 memcpy (to, &savage_cap, sizeof (vidix_capability_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1056 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1057 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1058
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1059 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1060 * @brief Report if the video FourCC is supported by hardware.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1061 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1062 * @param fourcc input image format.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1063 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1064 * @returns 1 if the fourcc is supported.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1065 * 0 otherwise.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1066 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1067 static int
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1068 is_supported_fourcc (uint32_t fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1069 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1070 switch (fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1071 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1072 //FIXME: YV12 isnt working properly yet
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1073 // case IMGFMT_YV12:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1074 // case IMGFMT_I420:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1075 case IMGFMT_UYVY:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1076 case IMGFMT_YVYU:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1077 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1078 case IMGFMT_RGB15:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1079 case IMGFMT_RGB16:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1080 // case IMGFMT_BGR32:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1081 return 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1082 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1083 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1084 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1085 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1086
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1087 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1088 * @brief Try to configure video memory for given fourcc.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1089 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1090 * @param to Pointer to the vidix_fourcc_t structure to be filled.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1091 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1092 * @returns 0 if ok.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1093 * errno otherwise.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1094 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1095 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1096 savage_query_fourcc (vidix_fourcc_t * to)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1097 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1098 if (is_supported_fourcc (to->fourcc))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1099 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1100 to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1101 VID_DEPTH_4BPP | VID_DEPTH_8BPP |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1102 VID_DEPTH_12BPP | VID_DEPTH_15BPP |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1103 VID_DEPTH_16BPP | VID_DEPTH_24BPP | VID_DEPTH_32BPP;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1104 to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1105 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1106 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1107 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1108 to->depth = to->flags = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1109
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1110 return ENOSYS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1111 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1112
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1113 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1114 * @brief Get the GrKeys
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1115 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1116 * @param grkey Pointer to the vidix_grkey_t structure to be filled by driver.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1117 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1118 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1119 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1120 /*int
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1121 vixGetGrKeys (vidix_grkey_t * grkey)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1122 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1123
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1124 // if(info->d_width && info->d_height)savage_overlay_start(info,0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1125
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1126 return (0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1127 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1128 * */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1129
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1130 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1131 * @brief Set the GrKeys
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1132 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1133 * @param grkey Colorkey to be set.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1134 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1135 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1136 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1137 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1138 savage_set_gkeys (const vidix_grkey_t * grkey)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1139 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1140 if (grkey->ckey.op == CKEY_FALSE)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1141 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1142 info->use_colorkey = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1143 info->vidixcolorkey=0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1144 printf("[savage_vid] colorkeying disabled\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1145 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1146 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1147 info->use_colorkey = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1148 info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1149
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1150 printf("[savage_vid] set colorkey 0x%x\n",info->vidixcolorkey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1151 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1152 //FIXME: freezes if streams arent enabled
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1153 SavageSetColorKeyOld();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1154 return (0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1155 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1156
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1157 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1158 * @brief Unichrome driver equalizer capabilities.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1159 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1160 static vidix_video_eq_t equal = {
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1161 VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION | VEQ_CAP_HUE,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1162 300, 100, 0, 0, 0, 0, 0, 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1163 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1164
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1165
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1166 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1167 * @brief Get the equalizer capabilities.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1168 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1169 * @param eq Pointer to the vidix_video_eq_t structure to be filled by driver.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1170 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1171 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1172 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1173 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1174 savage_get_eq (vidix_video_eq_t * eq)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1175 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1176 memcpy (eq, &equal, sizeof (vidix_video_eq_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1177 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1178 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1179
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1180 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1181 * @brief Set the equalizer capabilities for color correction
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1182 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1183 * @param eq equalizer capabilities to be set.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1184 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1185 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1186 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1187 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1188 savage_set_eq (const vidix_video_eq_t * eq)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1189 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1190 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1191 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1192
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1193 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1194 * @brief Y, U, V offsets.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1195 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1196 static int YOffs, UOffs, VOffs;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1197
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1198 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1199 * @brief Configure driver for playback. Driver should prepare BES.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1200 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1201 * @param info configuration description for playback.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1202 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1203 * @returns 0 in case of success.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1204 * -1 otherwise.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1205 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1206 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1207 savage_config_playback (vidix_playback_t * vinfo)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1208 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1209 int uv_size, swap_uv;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1210 unsigned int i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1211 int extfifo_on;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1212 int srcPitch,srcPitch2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1213
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1214 /* Overlay register settings */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1215 uint32_t win_start, win_end;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1216 uint32_t zoom, mini;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1217 uint32_t dcount, falign, qwfetch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1218 uint32_t y_start, u_start, v_start;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1219 uint32_t v_ctrl, fifo_ctrl;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1220
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1221 if (!is_supported_fourcc (vinfo->fourcc))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1222 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1223
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1224
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1225
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1226 info->src_w = vinfo->src.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1227 info->src_h = vinfo->src.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1228
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1229 info->drw_w = vinfo->dest.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1230 info->drw_h = vinfo->dest.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1231
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1232 info->wx = vinfo->dest.x;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1233 info->wy = vinfo->dest.y;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1234 info->format = vinfo->fourcc;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1235
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1236 info->lastKnownPitch = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1237 info->brightness = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1238 info->contrast = 128;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1239 info->saturation = 128;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1240 info->hue = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1241
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1242
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1243 vinfo->dga_addr=(void*)(info->picture_base);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1244
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1245
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1246 vinfo->offset.y = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1247 vinfo->offset.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1248 vinfo->offset.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1249
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1250 vinfo->dest.pitch.y = 32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1251 vinfo->dest.pitch.u = 32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1252 vinfo->dest.pitch.v = 32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1253 // vinfo->dest.pitch.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1254 // vinfo->dest.pitch.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1255
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1256
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1257 info->pitch = ((info->src_w << 1) + 15) & ~15;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1258
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1259 swap_uv = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1260 switch (vinfo->fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1261 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1262 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1263 case IMGFMT_UYVY:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1264
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1265 info->pitch = ((info->src_w << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1266
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1267 info->pitch = info->src_w << 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1268 info->pitch = ALIGN_TO (info->src_w << 1, 32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1269 uv_size = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1270 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1271 case IMGFMT_YV12:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1272 swap_uv = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1273
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1274
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1275
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1276 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1277 srcPitch = (info->src_w + 3) & ~3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1278 vinfo->offset.u = srcPitch * info->src_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1279 srcPitch2 = ((info->src_w >> 1) + 3) & ~3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1280 vinfo->offset.v = (srcPitch2 * (info->src_h >> 1)) + vinfo->offset.v;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1281
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1282 vinfo->dest.pitch.y=srcPitch ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1283 vinfo->dest.pitch.v=srcPitch2 ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1284 vinfo->dest.pitch.u=srcPitch2 ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1285 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1286
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1287
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1288 info->pitch = ALIGN_TO (info->src_w, 32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1289 uv_size = (info->pitch >> 1) * (info->src_h >> 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1290
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1291 vinfo->offset.y = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1292 vinfo->offset.v = vinfo->offset.y + info->pitch * info->src_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1293 vinfo->offset.u = vinfo->offset.v + uv_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1294 vinfo->frame_size = vinfo->offset.u + uv_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1295 /* YOffs = info->offset.y;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1296 UOffs = (swap_uv ? vinfo->offset.v : vinfo->offset.u);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1297 VOffs = (swap_uv ? vinfo->offset.u : vinfo->offset.v);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1298 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1299 // vinfo->offset.y = info->src_w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1300 // vinfo->offset.v = vinfo->offset.y + info->src_w /2 * info->src_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1301 // vinfo->offset.u = vinfo->offset.v + (info->src_w >> 1) * (info->src_h >> 1) ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1302
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1303 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1304 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1305 info->pitch |= ((info->pitch >> 1) << 16);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1306
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1307 vinfo->frame_size = info->pitch * info->src_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1308
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1309 printf("$#### destination pitch = %u\n", info->pitch&0xffff);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1310
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1311
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1312
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1313
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1314 info->buffer_size = vinfo->frame_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1315 info->num_frames = vinfo->num_frames= (info->chip.fbsize - info->picture_offset)/vinfo->frame_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1316 if(vinfo->num_frames > MAX_FRAMES)vinfo->num_frames = MAX_FRAMES;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1317 // vinfo->num_frames = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1318 // printf("[nvidia_vid] Number of frames %i\n",vinfo->num_frames);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1319 for(i=0;i <vinfo->num_frames;i++)vinfo->offsets[i] = vinfo->frame_size*i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1320
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1321 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1322 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1323
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1324 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1325 * @brief Set playback on : driver should activate BES on this call.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1326 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1327 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1328 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1329 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1330 savage_playback_on (void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1331 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1332 // FIXME: enable
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1333 SavageDisplayVideoOld();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1334 //FIXME ADD
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1335 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1336 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1337
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1338 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1339 * @brief Set playback off : driver should deactivate BES on this call.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1340 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1341 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1342 */
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1343 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1344 savage_playback_off (void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1345 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1346 // otherwise we wont disable streams properly in new xorg
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1347 // FIXME: shouldnt this be enabled?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1348 // SavageStreamsOn();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1349 SavageStreamsOff();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1350 // info->vidixcolorkey=0x0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1351
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1352 // OUTREG( SSTREAM_WINDOW_START_REG, OS_XY(0xfffe, 0xfffe) );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1353 // SavageSetColorKeyOld();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1354 //FIXME ADD
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1355 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1356 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1357
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1358 /**
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1359 * @brief Driver should prepare and activate corresponded frame.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1360 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1361 * @param frame the frame index.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1362 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1363 * @return 0.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1364 *
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1365 * @note This function is used only for double and triple buffering
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1366 * and never used for single buffering playback.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1367 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1368 #if 0
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1369 static int
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1370 savage_frame_select (unsigned int frame)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1371 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1372 ////FIXME ADD
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1373 // savage_overlay_start(info, frame);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1374 //if (info->num_frames >= 1)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1375 // info->cur_frame = frame//(frame+1)%info->num_frames;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1376 //
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1377 // savage4_waitidle(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1378
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1379 printf("vixPlaybackFrameSelect Leave\n" );
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1380 // FIXME: does this work to avoid tearing?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1381 // VerticalRetraceWait();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1382
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1383 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1384 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1385
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1386 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1387
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1388
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1389
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1390 void debugout(unsigned int addr, unsigned int val){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1391 return ;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1392 switch ( addr ){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1393 case PSTREAM_CONTROL_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1394 fprintf(stderr,"PSTREAM_CONTROL_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1395 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1396 case COL_CHROMA_KEY_CONTROL_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1397 fprintf(stderr,"COL_CHROMA_KEY_CONTROL_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1398 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1399 case SSTREAM_CONTROL_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1400 fprintf(stderr,"SSTREAM_CONTROL_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1401 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1402 case CHROMA_KEY_UPPER_BOUND_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1403 fprintf(stderr,"CHROMA_KEY_UPPER_BOUND_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1404 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1405 case SSTREAM_STRETCH_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1406 fprintf(stderr,"SSTREAM_STRETCH_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1407 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1408 case COLOR_ADJUSTMENT_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1409 fprintf(stderr,"COLOR_ADJUSTMENT_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1410 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1411 case BLEND_CONTROL_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1412 fprintf(stderr,"BLEND_CONTROL_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1413 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1414 case PSTREAM_FBADDR0_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1415 fprintf(stderr,"PSTREAM_FBADDR0_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1416 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1417 case PSTREAM_FBADDR1_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1418 fprintf(stderr,"PSTREAM_FBADDR1_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1419 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1420 case PSTREAM_STRIDE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1421 fprintf(stderr,"PSTREAM_STRIDE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1422 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1423 case DOUBLE_BUFFER_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1424 fprintf(stderr,"DOUBLE_BUFFER_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1425 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1426 case SSTREAM_FBADDR0_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1427 fprintf(stderr,"SSTREAM_FBADDR0_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1428 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1429 case SSTREAM_FBADDR1_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1430 fprintf(stderr,"SSTREAM_FBADDR1_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1431 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1432 case SSTREAM_STRIDE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1433 fprintf(stderr,"SSTREAM_STRIDE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1434 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1435 case SSTREAM_VSCALE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1436 fprintf(stderr,"SSTREAM_VSCALE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1437 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1438 case SSTREAM_VINITIAL_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1439 fprintf(stderr,"SSTREAM_VINITIAL_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1440 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1441 case SSTREAM_LINES_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1442 fprintf(stderr,"SSTREAM_LINES_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1443 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1444 case STREAMS_FIFO_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1445 fprintf(stderr,"STREAMS_FIFO_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1446 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1447 case PSTREAM_WINDOW_START_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1448 fprintf(stderr,"PSTREAM_WINDOW_START_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1449 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1450 case PSTREAM_WINDOW_SIZE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1451 fprintf(stderr,"PSTREAM_WINDOW_SIZE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1452 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1453 case SSTREAM_WINDOW_START_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1454 fprintf(stderr,"SSTREAM_WINDOW_START_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1455 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1456 case SSTREAM_WINDOW_SIZE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1457 fprintf(stderr,"SSTREAM_WINDOW_SIZE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1458 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1459 case FIFO_CONTROL:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1460 fprintf(stderr,"FIFO_CONTROL");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1461 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1462 case PSTREAM_FBSIZE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1463 fprintf(stderr,"PSTREAM_FBSIZE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1464 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1465 case SSTREAM_FBSIZE_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1466 fprintf(stderr,"SSTREAM_FBSIZE_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1467 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1468 case SSTREAM_FBADDR2_REG:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1469 fprintf(stderr,"SSTREAM_FBADDR2_REG");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1470 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1471
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1472 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1473 fprintf(stderr,":\t\t 0x%08X = %u\n",val,val);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1474 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1475
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1476 VDXDriver savage_drv = {
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1477 "savage",
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1478 NULL,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1479 .probe = savage_probe,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1480 .get_version = savage_get_version,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1481 .get_caps = savage_get_caps,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1482 .query_fourcc = savage_query_fourcc,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1483 .init = savage_init,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1484 .destroy = savage_destroy,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1485 .config_playback = savage_config_playback,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1486 .playback_on = savage_playback_on,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1487 .playback_off = savage_playback_off,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1488 #if 0
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1489 .frame_sel = savage_frame_select,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1490 #endif
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1491 .get_eq = savage_get_eq,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1492 .set_eq = savage_set_eq,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1493 .set_gkey = savage_set_gkeys,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1494 };