annotate drivers/sis_vid.c @ 1147:82bbd3ee8ce7

hacked osd working on yv12
author al3x
date Sun, 17 Jun 2001 18:32:14 +0000
parents dc0424327084
children d62aa0b7fd68
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 * sis_vid.c
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 * Copyright (C) 2000 Aaron Holtzman
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 * This software has been released under the terms of the GNU Public
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 * license. See http://www.gnu.org/copyleft/gpl.html for details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 // video4linux interface disabled by A'rpi/ESP-team
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 //It's entirely possible this major conflicts with something else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 /* mknod /dev/mga_vid c 178 0 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 #include <linux/config.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 #include <linux/version.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 #include <linux/module.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 #include <linux/types.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 #include <linux/kernel.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 #include <linux/sched.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 #include <linux/mm.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 #include <linux/string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 #include <linux/errno.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 #include <linux/malloc.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27 #include <linux/pci.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #include <linux/init.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 //#include <linux/videodev.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 #include "sis_vid.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #ifdef CONFIG_MTRR
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #include <asm/mtrr.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #include <asm/uaccess.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #include <asm/system.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #include <asm/io.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 #define TRUE 1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 #define FALSE 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 #define MGA_VID_MAJOR 178
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 #ifndef PCI_DEVICE_ID_SI_6323
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 #define PCI_DEVICE_ID_SI_6323 0x6326
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 MODULE_AUTHOR("Aaron Holtzman <aholtzma@engr.uvic.ca>");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 typedef struct bes_registers_s
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 //base address of yuv framebuffer
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 uint32_t yuv_base;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 uint32_t u_base;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 uint32_t v_base;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 uint32_t fb_end;;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 //frame buffer pitch
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 uint32_t pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 //window boundaries
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 uint32_t left;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 uint32_t right;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 uint32_t top;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 uint32_t bottom;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 //control registers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 uint32_t misc_0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 uint32_t misc_1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 uint32_t misc_3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 uint32_t misc_4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 //key overlay mode
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 uint32_t key_mode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 } bes_registers_t;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 static bes_registers_t regs;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 static uint32_t mga_vid_in_use = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 static uint32_t vid_src_ready = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 static uint32_t vid_overlay_on = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 static uint8_t *mga_mmio_base = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 static uint32_t mga_mem_base = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 static uint32_t mga_src_base = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 static uint32_t mga_ram_size = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 static struct pci_dev *pci_dev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 //static struct video_window mga_win;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 static mga_vid_config_t mga_config;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 // Backend Scaler registers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 #define MISC_0 0x98
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 #define MISC_1 0x99
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 #define MISC_3 0x9d
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 #define MISC_4 0xb6
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 static void mga_vid_frame_sel(int frame)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 //we don't need the vcount protection as we're only hitting
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 //one register (and it doesn't seem to be double buffered)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 //regs.besctl = (regs.besctl & ~0x07000000) + (frame << 25);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 //writel( regs.besctl, mga_mmio_base + BESCTL );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 #define WRITE_REG(x,y,z) {outb((y),(x));outb((z),(x+1));}
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 #define READ_REG(x,y) (outb((y),(x)),inb(x+1))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 #define VIDEO_ACCEL 0x3d4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 static void mga_vid_write_regs(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 uint32_t foo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 //unlock the video accel registers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 WRITE_REG(VIDEO_ACCEL,0x80,0x86);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 foo = READ_REG(VIDEO_ACCEL,0x80);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 if(foo != 0xa1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 return; //something bad happened
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 //setup the horizontal window bounds
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 WRITE_REG(VIDEO_ACCEL,0x81,regs.left & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 WRITE_REG(VIDEO_ACCEL,0x82,regs.right & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 WRITE_REG(VIDEO_ACCEL,0x83,(regs.left >> 8) | ((regs.right>>4) & 0x70));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 //setup the vertical window bounds
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 WRITE_REG(VIDEO_ACCEL,0x84,regs.top & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 WRITE_REG(VIDEO_ACCEL,0x85,regs.bottom & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 WRITE_REG(VIDEO_ACCEL,0x86,(regs.top >> 8) | ((regs.bottom>>4) & 0x70));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 //setup the framebuffer base addresses
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 WRITE_REG(VIDEO_ACCEL,0x8a,regs.yuv_base & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 WRITE_REG(VIDEO_ACCEL,0x8b,(regs.yuv_base >> 8) & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 WRITE_REG(VIDEO_ACCEL,0x89,(regs.yuv_base >> 12) & 0xf0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 WRITE_REG(VIDEO_ACCEL,0xb7,regs.u_base & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 WRITE_REG(VIDEO_ACCEL,0xb8,(regs.u_base >> 8) & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 WRITE_REG(VIDEO_ACCEL,0xba,regs.v_base & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 WRITE_REG(VIDEO_ACCEL,0xbb,(regs.v_base >> 8) & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 WRITE_REG(VIDEO_ACCEL,0xb9,((regs.v_base >> 12) & 0xf0) + ((regs.u_base >> 16) & 0xf));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 WRITE_REG(VIDEO_ACCEL,0x8d,regs.fb_end);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 //setup framebuffer pitch
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 WRITE_REG(VIDEO_ACCEL,0x8c,regs.pitch & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 WRITE_REG(VIDEO_ACCEL,0x8e,(regs.pitch >> 8) & 0x0f);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 WRITE_REG(VIDEO_ACCEL,0xbc,(regs.pitch) & 0xff);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 WRITE_REG(VIDEO_ACCEL,0xbd,((regs.pitch) >> 8) & 0x0f);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 //write key overlay register
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 WRITE_REG(VIDEO_ACCEL,0xa9,regs.key_mode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 WRITE_REG(VIDEO_ACCEL,0x93,0x40);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 WRITE_REG(VIDEO_ACCEL,0x94,1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 WRITE_REG(VIDEO_ACCEL,0x9e,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 WRITE_REG(VIDEO_ACCEL,0x9f,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 //write config registers
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 WRITE_REG(VIDEO_ACCEL,MISC_0,regs.misc_0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 WRITE_REG(VIDEO_ACCEL,MISC_1,regs.misc_1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177 WRITE_REG(VIDEO_ACCEL,MISC_3,regs.misc_3);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 WRITE_REG(VIDEO_ACCEL,MISC_4,regs.misc_4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 //setup the video line buffer
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 WRITE_REG(VIDEO_ACCEL,0xa0,(regs.right - regs.left)/ 8);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185 static int mga_vid_set_config(mga_vid_config_t *config)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 uint32_t x, y, frame_size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 x = config->x_org;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 y = config->y_org;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 regs.left = x;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 regs.right= config->src_width + x;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 regs.top = y;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 regs.bottom = config->src_height + y;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
197 printk(KERN_DEBUG "mga_vid: Setting up a %dx%d+%d+%d video window (src %dx%d)\n",
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 config->dest_width, config->dest_height, config->x_org, config->y_org,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 config->src_width, config->src_height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 regs.pitch = ((config->src_width + 31) & ~31) / 4 ;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 //frame size in pixels
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 frame_size = regs.pitch * config->src_height * 4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 regs.yuv_base = (mga_src_base) >> 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 regs.u_base = (mga_src_base + frame_size) >> 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 regs.v_base = (mga_src_base + frame_size/4) >> 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 regs.fb_end = (mga_src_base + (3*frame_size)/2) >> 14;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 //disable video capture, enable video display, enable graphics display,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 //select yuv format, odd parity
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 regs.misc_0 = (1 << 1) + (1<<6) + (1<<4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 //disable dithering, no filtering, no interrupts
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 regs.misc_1 = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 //select 2's complement format YUV for playback
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 regs.misc_3 = (1<<1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 //select 4:2:0 video format, + yuv4:2:2 cpu writes
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 regs.misc_4 = (1<<2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 //disable keying
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 regs.key_mode = 0xf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235 int frame;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 switch(cmd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 case MGA_VID_CONFIG:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 //FIXME remove
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
241 printk(KERN_DEBUG "mga_mmio_base = %p\n",mga_mmio_base);
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
242 printk(KERN_DEBUG "mga_mem_base = %08x\n",mga_mem_base);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 //FIXME remove
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
245 printk(KERN_DEBUG "mga_vid: Received configuration\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 if(copy_from_user(&mga_config,(mga_vid_config_t*) arg,sizeof(mga_vid_config_t)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
249 printk(KERN_ERR "mga_vid: failed copy from userspace\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 return(-EFAULT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 mga_config.ram_size = mga_ram_size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 //XXX make it look like a g400
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 mga_config.card_type = MGA_G400;;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 if (copy_to_user((mga_vid_config_t *) arg, &mga_config, sizeof(mga_vid_config_t)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
259 printk(KERN_ERR "mga_vid: failed copy to userspace\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 return(-EFAULT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 return mga_vid_set_config(&mga_config);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 case MGA_VID_ON:
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
266 printk(KERN_DEBUG "mga_vid: Video ON\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 vid_src_ready = 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 if(vid_overlay_on)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 //regs.besctl |= 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275 case MGA_VID_OFF:
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
276 printk(KERN_DEBUG "mga_vid: Video OFF\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 vid_src_ready = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 //regs.besctl &= ~1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282 case MGA_VID_FSEL:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 if(copy_from_user(&frame,(int *) arg,sizeof(int)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
285 printk(KERN_ERR "mga_vid: FSEL failed copy from userspace\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 return(-EFAULT);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 mga_vid_frame_sel(frame);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 default:
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
293 printk(KERN_ERR "mga_vid: Invalid ioctl\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 return (-EINVAL);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 static int mga_vid_find_card(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 struct pci_dev *dev = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305 if((dev = pci_find_device(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_6323, NULL)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
307 printk(KERN_DEBUG "sis_vid: Found SiS 6326\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
311 printk(KERN_ERR "sis_vid: No supported cards found\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312 return FALSE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 pci_dev = dev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 #if LINUX_VERSION_CODE >= 0x020300
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 mga_mmio_base = ioremap_nocache(dev->resource[1].start,0x10000);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 mga_mem_base = dev->resource[0].start;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321 mga_mmio_base = ioremap_nocache(dev->base_address[1] & PCI_BASE_ADDRESS_MEM_MASK,0x10000);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 mga_mem_base = dev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 #endif
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
324 printk(KERN_DEBUG "mga_vid: MMIO at 0x%p\n", mga_mmio_base);
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
325 printk(KERN_DEBUG "mga_vid: Frame Buffer at 0x%08x\n", mga_mem_base);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 //FIXME set ram size properly
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
328 mga_ram_size = 4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 mga_src_base = (mga_ram_size - 1) * 0x100000;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 //FIXME remove
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332 if(1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334 mga_vid_config_t config ={0,0,256,256,256,256,10,10,0,0,0,0};
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
336 mga_vid_set_config(&config);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 //regs.misc_0 ^= 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 //mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 //FIXME remove
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343 return TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 static ssize_t mga_vid_read(struct file *file, char *buf, size_t count, loff_t *ppos)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 static ssize_t mga_vid_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 static int mga_vid_mmap(struct file *file, struct vm_area_struct *vma)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
360 printk(KERN_DEBUG "mga_vid: mapping video memory into userspace\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 if(remap_page_range(vma->vm_start, mga_mem_base + mga_src_base,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 vma->vm_end - vma->vm_start, vma->vm_page_prot))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
364 printk(KERN_ERR "mga_vid: error mapping video memory\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 return(-EAGAIN);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 return(0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 static int mga_vid_release(struct inode *inode, struct file *file)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 //Close the window just in case
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 vid_src_ready = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 regs.misc_0 &= 0xed;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 mga_vid_in_use = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 //FIXME put back in!
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 //MOD_DEC_USE_COUNT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 static long long mga_vid_lseek(struct file *file, long long offset, int origin)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386 return -ESPIPE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 static int mga_vid_open(struct inode *inode, struct file *file)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391 int minor = MINOR(inode->i_rdev);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 if(minor != 0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 return(-ENXIO);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 if(mga_vid_in_use == 1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
397 return(-EBUSY);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
398
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
399 mga_vid_in_use = 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
400 //FIXME turn me back on!
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
401 //MOD_INC_USE_COUNT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
402 return(0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
403 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
405 #if LINUX_VERSION_CODE >= 0x020400
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
406 static struct file_operations mga_vid_fops =
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
407 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
408 llseek: mga_vid_lseek,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409 read: mga_vid_read,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 write: mga_vid_write,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
411 ioctl: mga_vid_ioctl,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412 mmap: mga_vid_mmap,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 open: mga_vid_open,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414 release: mga_vid_release
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
416 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417 static struct file_operations mga_vid_fops =
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
418 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
419 mga_vid_lseek,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
420 mga_vid_read,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421 mga_vid_write,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
422 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
424 mga_vid_ioctl,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
425 mga_vid_mmap,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
426 mga_vid_open,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
428 mga_vid_release
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
430 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
431
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
432 #if 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
433 static long mga_v4l_read(struct video_device *v, char *buf, unsigned long count,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
434 int noblock)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
435 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
436 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
438
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439 static long mga_v4l_write(struct video_device *v, const char *buf, unsigned long count, int noblock)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
444 static int mga_v4l_open(struct video_device *dev, int mode)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
445 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
446 MOD_INC_USE_COUNT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
448 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
449
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
450 static void mga_v4l_close(struct video_device *dev)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
451 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
452 //regs.besctl &= ~1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
453 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
454 vid_overlay_on = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
455 MOD_DEC_USE_COUNT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
456 return;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
457 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
458
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
459 static int mga_v4l_init_done(struct video_device *dev)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
460 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
461 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
462 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
463
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
464 static int mga_v4l_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
465 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
466 switch(cmd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
467 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
468 case VIDIOCGCAP:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
469 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
470 struct video_capability b;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
471 strcpy(b.name, "Matrox G200/400");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
472 b.type = VID_TYPE_SCALES|VID_TYPE_OVERLAY|VID_TYPE_CHROMAKEY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
473 b.channels = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
474 b.audios = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
475 b.maxwidth = 1024; /* GUESS ?? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
476 b.maxheight = 768;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
477 b.minwidth = 32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
478 b.minheight = 16; /* GUESS ?? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
479 if(copy_to_user(arg,&b,sizeof(b)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
480 return -EFAULT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
481 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
482 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
483 case VIDIOCGPICT:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
484 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
485 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
486 * Default values.. if we can change this we
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
487 * can add the feature later
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
488 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
489 struct video_picture vp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
490 vp.brightness = 0x8000;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
491 vp.hue = 0x8000;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
492 vp.colour = 0x8000;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
493 vp.whiteness = 0x8000;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
494 vp.depth = 8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
495 /* Format is a guess */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
496 vp.palette = VIDEO_PALETTE_YUV420P;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
497 if(copy_to_user(arg, &vp, sizeof(vp)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
498 return -EFAULT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
499 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
500 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
501 case VIDIOCSPICT:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
502 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
503 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
504 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
505 case VIDIOCSWIN:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
506 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
507 struct video_window vw;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
508 if(copy_from_user(&vw, arg, sizeof(vw)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
509 return -EFAULT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
510 if(vw.x <0 || vw.y <0 || vw.width < 32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
511 || vw.height < 16)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
512 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
513 memcpy(&mga_win, &vw, sizeof(mga_win));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
514
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
515 mga_config.x_org = vw.x;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
516 mga_config.y_org = vw.y;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
517 mga_config.dest_width = vw.width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
518 mga_config.dest_height = vw.height;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
519
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
520 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
521 * May have to add
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
522 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
523 * #define VIDEO_WINDOW_CHROMAKEY 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
524 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
525 * to <linux/videodev.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
526 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
527
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
528 //add it here for now
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
529 #define VIDEO_WINDOW_CHROMAKEY 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
530
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
531 if (vw.flags & VIDEO_WINDOW_CHROMAKEY)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
532 mga_config.colkey_on = 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
533 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
534 mga_config.colkey_on = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
535
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
536 mga_config.colkey_red = (vw.chromakey >> 24) & 0xFF;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
537 mga_config.colkey_green = (vw.chromakey >> 16) & 0xFF;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
538 mga_config.colkey_blue = (vw.chromakey >> 8) & 0xFF;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
539 mga_vid_set_config(&mga_config);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
540 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
541
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
542 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
543 case VIDIOCGWIN:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
544 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
545 if(copy_to_user(arg, &mga_win, sizeof(mga_win)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
546 return -EFAULT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
547 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
548 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
549 case VIDIOCCAPTURE:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
550 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
551 int v;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
552 if(copy_from_user(&v, arg, sizeof(v)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
553 return -EFAULT;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
554 vid_overlay_on = v;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
555 if(vid_overlay_on && vid_src_ready)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
556 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
557 //regs.besctl |= 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
558 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
559 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
560 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
561 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
562 //regs.besctl &= ~1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
563 mga_vid_write_regs();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
564 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
565 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
566 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
567 default:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
568 return -ENOIOCTLCMD;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
569 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
570 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
571
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
572 static struct video_device mga_v4l_dev =
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
573 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
574 "Matrox G200/G400",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
575 VID_TYPE_CAPTURE,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
576 VID_HARDWARE_BT848, /* This is a lie for now */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
577 mga_v4l_open,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
578 mga_v4l_close,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
579 mga_v4l_read,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
580 mga_v4l_write,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
581 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
582 mga_v4l_ioctl,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
583 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
584 mga_v4l_init_done,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
585 NULL,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
586 0,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
587 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
588 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
589
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
590 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
591
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
592 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
593 * Main Initialization Function
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
594 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
595
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
596
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
597 static int mga_vid_initialize(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
598 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
599 mga_vid_in_use = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
600
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
601 printk(KERN_DEBUG "SiS 6326 YUV Video interface v0.01 (c) Aaron Holtzman \n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
602 if(register_chrdev(MGA_VID_MAJOR, "mga_vid", &mga_vid_fops))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
603 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
604 printk(KERN_ERR "sis_vid: unable to get major: %d\n", MGA_VID_MAJOR);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
605 return -EIO;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
606 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
607
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
608 if (!mga_vid_find_card())
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
609 {
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
610 printk(KERN_ERR "sis_vid: no supported devices found\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
611 unregister_chrdev(MGA_VID_MAJOR, "mga_vid");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
612 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
613 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
614
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
615 #if 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
616 if (video_register_device(&mga_v4l_dev, VFL_TYPE_GRABBER)<0)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
617 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
618 printk("sis_vid: unable to register.\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
619 unregister_chrdev(MGA_VID_MAJOR, "mga_vid");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
620 if(mga_mmio_base)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
621 iounmap(mga_mmio_base);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
622 mga_mmio_base = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
623 return -EINVAL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
624 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
625 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
626
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
627 return(0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
628 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
629
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
630 int init_module(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
631 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
632 return mga_vid_initialize();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
633 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
634
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
635 void cleanup_module(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
636 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
637 // video_unregister_device(&mga_v4l_dev);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
638 if(mga_mmio_base)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
639 iounmap(mga_mmio_base);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
640
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
641 //FIXME turn off BES
62
dc0424327084 printk() loglevel fix
szabii
parents: 1
diff changeset
642 printk(KERN_DEBUG "mga_vid: Cleaning up module\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
643 unregister_chrdev(MGA_VID_MAJOR, "mga_vid");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
644 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
645