Mercurial > mplayer.hg
annotate vidix/drivers/mga_vid.c @ 4264:689531ade0fb
added FLAG_EQUALIZER
author | alex |
---|---|
date | Sat, 19 Jan 2002 18:41:50 +0000 |
parents | 49746d2bfda7 |
children | 68a40de07167 |
rev | line source |
---|---|
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1 /* |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
2 Matrox MGA driver |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
3 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
4 ported to VIDIX by Alex Beregszaszi |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
5 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
6 YUY2 support (see config.format) added by A'rpi/ESP-team |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
7 double buffering added by A'rpi/ESP-team |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
8 */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
9 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
10 /* |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
11 * Original copyright: |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
12 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
13 * mga_vid.c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
14 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
15 * Copyright (C) 1999 Aaron Holtzman |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
16 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
17 * Module skeleton based on gutted agpgart module by Jeff Hartmann |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
18 * <slicer@ionet.net> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
19 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
20 * Matrox MGA G200/G400 YUV Video Interface module Version 0.1.0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
21 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
22 * BES == Back End Scaler |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
23 * |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
24 * This software has been released under the terms of the GNU Public |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
25 * license. See http://www.gnu.org/copyleft/gpl.html for details. |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
26 */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
27 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
28 //#define CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
29 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
30 // Set this value, if autodetection fails! (video ram size in megabytes) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
31 // #define MGA_MEMORY_SIZE 16 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
32 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
33 /* disable irq */ |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
34 #undef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
35 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
36 #define MGA_VSYNC_POS 2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
37 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
38 |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
39 #include <errno.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
40 #include <stdio.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
41 #include <stdlib.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
42 #include <string.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
43 #include <math.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
44 #include <inttypes.h> |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
45 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
46 #include "../vidix.h" |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
47 #include "../fourcc.h" |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
48 #include "../../libdha/libdha.h" |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
49 #include "../../libdha/pci_ids.h" |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
50 #include "../../libdha/pci_names.h" |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
51 |
4163 | 52 #if !defined(ENOTSUP) && defined(EOPNOTSUPP) |
53 #define ENOTSUP EOPNOTSUPP | |
54 #endif | |
55 | |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
56 /* from radeon_vid */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
57 #define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ)))) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
58 #define SETREG(TYPE,PTR,OFFZ,VAL) (*((volatile TYPE*)((PTR)+(OFFZ))))=VAL |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
59 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
60 #define readb(addr) GETREG(uint8_t,(uint32_t)(addr),0) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
61 #define writeb(val,addr) SETREG(uint8_t,(uint32_t)(addr),0,val) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
62 #define readl(addr) GETREG(uint32_t,(uint32_t)(addr),0) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
63 #define writel(val,addr) SETREG(uint32_t,(uint32_t)(addr),0,val) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
64 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
65 int mga_verbose = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
66 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
67 /* for device detection */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
68 static int probed = 0; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
69 static pciinfo_t pci_info; |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
70 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
71 /* internal booleans */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
72 static uint32_t mga_vid_in_use = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
73 static uint32_t is_g400 = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
74 static uint32_t vid_src_ready = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
75 static uint32_t vid_overlay_on = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
76 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
77 /* mapped physical addresses */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
78 static uint8_t *mga_mmio_base = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
79 static uint32_t mga_mem_base = 0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
80 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
81 static int mga_src_base = 0; /* YUV buffer position in video memory */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
82 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
83 static uint32_t mga_ram_size = 0; /* how much megabytes videoram we have */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
84 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
85 /* Graphic keys */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
86 static vidix_grkey_t mga_grkey; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
87 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
88 static int colkey_saved=0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
89 static int colkey_on=0; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
90 static unsigned char colkey_color[4]; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
91 static unsigned char colkey_mask[4]; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
92 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
93 /* for IRQ */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
94 static int mga_irq = -1; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
95 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
96 static int mga_next_frame = 0; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
97 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
98 static vidix_capability_t mga_cap = |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
99 { |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
100 "Matrox MGA G200/G400 YUV Video", |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
101 TYPE_OUTPUT, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
102 { 0, 0, 0, 0 }, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
103 1024, /* 2048x2048 is supported if Pontscho is right */ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
104 768, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
105 4, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
106 4, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
107 -1, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
108 FLAG_UPSCALER | FLAG_DOWNSCALER, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
109 VENDOR_MATROX, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
110 0, |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
111 { 0, 0, 0, 0} |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
112 }; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
113 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
114 /* MATROX BES registers */ |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
115 typedef struct bes_registers_s |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
116 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
117 //BES Control |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
118 uint32_t besctl; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
119 //BES Global control |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
120 uint32_t besglobctl; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
121 //Luma control (brightness and contrast) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
122 uint32_t beslumactl; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
123 //Line pitch |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
124 uint32_t bespitch; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
125 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
126 //Buffer A-1 Chroma 3 plane org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
127 uint32_t besa1c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
128 //Buffer A-1 Chroma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
129 uint32_t besa1corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
130 //Buffer A-1 Luma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
131 uint32_t besa1org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
132 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
133 //Buffer A-2 Chroma 3 plane org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
134 uint32_t besa2c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
135 //Buffer A-2 Chroma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
136 uint32_t besa2corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
137 //Buffer A-2 Luma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
138 uint32_t besa2org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
139 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
140 //Buffer B-1 Chroma 3 plane org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
141 uint32_t besb1c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
142 //Buffer B-1 Chroma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
143 uint32_t besb1corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
144 //Buffer B-1 Luma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
145 uint32_t besb1org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
146 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
147 //Buffer B-2 Chroma 3 plane org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
148 uint32_t besb2c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
149 //Buffer B-2 Chroma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
150 uint32_t besb2corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
151 //Buffer B-2 Luma org |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
152 uint32_t besb2org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
153 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
154 //BES Horizontal coord |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
155 uint32_t beshcoord; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
156 //BES Horizontal inverse scaling [5.14] |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
157 uint32_t beshiscal; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
158 //BES Horizontal source start [10.14] (for scaling) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
159 uint32_t beshsrcst; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
160 //BES Horizontal source ending [10.14] (for scaling) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
161 uint32_t beshsrcend; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
162 //BES Horizontal source last |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
163 uint32_t beshsrclst; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
164 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
165 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
166 //BES Vertical coord |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
167 uint32_t besvcoord; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
168 //BES Vertical inverse scaling [5.14] |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
169 uint32_t besviscal; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
170 //BES Field 1 vertical source last position |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
171 uint32_t besv1srclst; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
172 //BES Field 1 weight start |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
173 uint32_t besv1wght; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
174 //BES Field 2 vertical source last position |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
175 uint32_t besv2srclst; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
176 //BES Field 2 weight start |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
177 uint32_t besv2wght; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
178 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
179 } bes_registers_t; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
180 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
181 static bes_registers_t regs; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
182 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
183 typedef struct crtc2_registers_s |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
184 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
185 uint32_t c2ctl; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
186 uint32_t c2datactl; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
187 uint32_t c2misc; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
188 uint32_t c2hparam; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
189 uint32_t c2hsync; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
190 uint32_t c2offset; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
191 uint32_t c2pl2startadd0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
192 uint32_t c2pl2startadd1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
193 uint32_t c2pl3startadd0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
194 uint32_t c2pl3startadd1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
195 uint32_t c2preload; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
196 uint32_t c2spicstartadd0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
197 uint32_t c2spicstartadd1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
198 uint32_t c2startadd0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
199 uint32_t c2startadd1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
200 uint32_t c2subpiclut; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
201 uint32_t c2vcount; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
202 uint32_t c2vparam; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
203 uint32_t c2vsync; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
204 } crtc2_registers_t; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
205 static crtc2_registers_t cregs; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
206 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
207 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
208 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
209 //All register offsets are converted to word aligned offsets (32 bit) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
210 //because we want all our register accesses to be 32 bits |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
211 #define VCOUNT 0x1e20 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
212 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
213 #define PALWTADD 0x3c00 // Index register for X_DATAREG port |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
214 #define X_DATAREG 0x3c0a |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
215 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
216 #define XMULCTRL 0x19 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
217 #define BPP_8 0x00 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
218 #define BPP_15 0x01 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
219 #define BPP_16 0x02 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
220 #define BPP_24 0x03 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
221 #define BPP_32_DIR 0x04 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
222 #define BPP_32_PAL 0x07 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
223 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
224 #define XCOLMSK 0x40 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
225 #define X_COLKEY 0x42 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
226 #define XKEYOPMODE 0x51 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
227 #define XCOLMSK0RED 0x52 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
228 #define XCOLMSK0GREEN 0x53 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
229 #define XCOLMSK0BLUE 0x54 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
230 #define XCOLKEY0RED 0x55 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
231 #define XCOLKEY0GREEN 0x56 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
232 #define XCOLKEY0BLUE 0x57 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
233 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
234 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
235 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
236 /*CRTC2 registers*/ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
237 #define XMISCCTRL 0x1e |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
238 #define C2CTL 0x3c10 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
239 #define C2DATACTL 0x3c4c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
240 #define C2MISC 0x3c44 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
241 #define C2HPARAM 0x3c14 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
242 #define C2HSYNC 0x3c18 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
243 #define C2OFFSET 0x3c40 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
244 #define C2PL2STARTADD0 0x3c30 // like BESA1CORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
245 #define C2PL2STARTADD1 0x3c34 // like BESA2CORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
246 #define C2PL3STARTADD0 0x3c38 // like BESA1C3ORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
247 #define C2PL3STARTADD1 0x3c3c // like BESA2C3ORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
248 #define C2PRELOAD 0x3c24 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
249 #define C2SPICSTARTADD0 0x3c54 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
250 #define C2SPICSTARTADD1 0x3c58 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
251 #define C2STARTADD0 0x3c28 // like BESA1ORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
252 #define C2STARTADD1 0x3c2c // like BESA2ORG |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
253 #define C2SUBPICLUT 0x3c50 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
254 #define C2VCOUNT 0x3c48 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
255 #define C2VPARAM 0x3c1c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
256 #define C2VSYNC 0x3c20 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
257 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
258 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
259 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
260 // Backend Scaler registers |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
261 #define BESCTL 0x3d20 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
262 #define BESGLOBCTL 0x3dc0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
263 #define BESLUMACTL 0x3d40 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
264 #define BESPITCH 0x3d24 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
265 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
266 #define BESA1C3ORG 0x3d60 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
267 #define BESA1CORG 0x3d10 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
268 #define BESA1ORG 0x3d00 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
269 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
270 #define BESA2C3ORG 0x3d64 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
271 #define BESA2CORG 0x3d14 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
272 #define BESA2ORG 0x3d04 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
273 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
274 #define BESB1C3ORG 0x3d68 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
275 #define BESB1CORG 0x3d18 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
276 #define BESB1ORG 0x3d08 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
277 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
278 #define BESB2C3ORG 0x3d6C |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
279 #define BESB2CORG 0x3d1C |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
280 #define BESB2ORG 0x3d0C |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
281 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
282 #define BESHCOORD 0x3d28 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
283 #define BESHISCAL 0x3d30 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
284 #define BESHSRCEND 0x3d3C |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
285 #define BESHSRCLST 0x3d50 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
286 #define BESHSRCST 0x3d38 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
287 #define BESV1WGHT 0x3d48 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
288 #define BESV2WGHT 0x3d4c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
289 #define BESV1SRCLST 0x3d54 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
290 #define BESV2SRCLST 0x3d58 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
291 #define BESVISCAL 0x3d34 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
292 #define BESVCOORD 0x3d2c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
293 #define BESSTATUS 0x3dc4 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
294 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
295 #define CRTCX 0x1fd4 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
296 #define CRTCD 0x1fd5 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
297 #define IEN 0x1e1c |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
298 #define ICLEAR 0x1e18 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
299 #define STATUS 0x1e14 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
300 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
301 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
302 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
303 static void crtc2_frame_sel(int frame) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
304 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
305 switch(frame) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
306 case 0: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
307 cregs.c2pl2startadd0=regs.besa1corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
308 cregs.c2pl3startadd0=regs.besa1c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
309 cregs.c2startadd0=regs.besa1org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
310 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
311 case 1: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
312 cregs.c2pl2startadd0=regs.besa2corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
313 cregs.c2pl3startadd0=regs.besa2c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
314 cregs.c2startadd0=regs.besa2org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
315 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
316 case 2: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
317 cregs.c2pl2startadd0=regs.besb1corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
318 cregs.c2pl3startadd0=regs.besb1c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
319 cregs.c2startadd0=regs.besb1org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
320 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
321 case 3: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
322 cregs.c2pl2startadd0=regs.besb2corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
323 cregs.c2pl3startadd0=regs.besb2c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
324 cregs.c2startadd0=regs.besb2org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
325 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
326 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
327 writel(cregs.c2startadd0, mga_mmio_base + C2STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
328 writel(cregs.c2pl2startadd0, mga_mmio_base + C2PL2STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
329 writel(cregs.c2pl3startadd0, mga_mmio_base + C2PL3STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
330 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
331 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
332 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
333 int vixPlaybackFrameSelect(unsigned int frame) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
334 { |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
335 #if MGA_ALLOW_IRQ |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
336 if (mga_irq != -1) |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
337 { |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
338 mga_next_frame = frame; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
339 } |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
340 else |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
341 #endif |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
342 { |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
343 //we don't need the vcount protection as we're only hitting |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
344 //one register (and it doesn't seem to be double buffered) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
345 regs.besctl = (regs.besctl & ~0x07000000) + (frame << 25); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
346 writel( regs.besctl, mga_mmio_base + BESCTL ); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
347 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
348 // writel( regs.besglobctl + ((readl(mga_mmio_base + VCOUNT)+2)<<16), |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
349 writel( regs.besglobctl + (MGA_VSYNC_POS<<16), |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
350 mga_mmio_base + BESGLOBCTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
351 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
352 crtc2_frame_sel(frame); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
353 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
354 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
355 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
356 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
357 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
358 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
359 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
360 static void mga_vid_write_regs(int restore) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
361 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
362 //Make sure internal registers don't get updated until we're done |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
363 writel( (readl(mga_mmio_base + VCOUNT)-1)<<16, |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
364 mga_mmio_base + BESGLOBCTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
365 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
366 // color or coordinate keying |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
367 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
368 if(restore && colkey_saved){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
369 // restore it |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
370 colkey_saved=0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
371 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
372 printf("[mga] Restoring colorkey (ON: %d %02X:%02X:%02X)\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
373 colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
374 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
375 // Set color key registers: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
376 writeb( XKEYOPMODE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
377 writeb( colkey_on, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
378 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
379 writeb( XCOLKEY0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
380 writeb( colkey_color[0], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
381 writeb( XCOLKEY0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
382 writeb( colkey_color[1], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
383 writeb( XCOLKEY0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
384 writeb( colkey_color[2], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
385 writeb( X_COLKEY, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
386 writeb( colkey_color[3], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
387 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
388 writeb( XCOLMSK0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
389 writeb( colkey_mask[0], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
390 writeb( XCOLMSK0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
391 writeb( colkey_mask[1], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
392 writeb( XCOLMSK0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
393 writeb( colkey_mask[2], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
394 writeb( XCOLMSK, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
395 writeb( colkey_mask[3], mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
396 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
397 } else if(!colkey_saved){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
398 // save it |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
399 colkey_saved=1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
400 // Get color key registers: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
401 writeb( XKEYOPMODE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
402 colkey_on=(unsigned char)readb(mga_mmio_base + X_DATAREG) & 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
403 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
404 writeb( XCOLKEY0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
405 colkey_color[0]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
406 writeb( XCOLKEY0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
407 colkey_color[1]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
408 writeb( XCOLKEY0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
409 colkey_color[2]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
410 writeb( X_COLKEY, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
411 colkey_color[3]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
412 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
413 writeb( XCOLMSK0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
414 colkey_mask[0]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
415 writeb( XCOLMSK0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
416 colkey_mask[1]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
417 writeb( XCOLMSK0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
418 colkey_mask[2]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
419 writeb( XCOLMSK, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
420 colkey_mask[3]=(unsigned char)readb(mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
421 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
422 printf("[mga] Saved colorkey (ON: %d %02X:%02X:%02X)\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
423 colkey_on,colkey_color[0],colkey_color[1],colkey_color[2]); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
424 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
425 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
426 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
427 if(!restore){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
428 writeb( XKEYOPMODE, mga_mmio_base + PALWTADD); |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
429 writeb( mga_grkey.ckey.op == CKEY_TRUE, mga_mmio_base + X_DATAREG); |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
430 if ( mga_grkey.ckey.op == CKEY_TRUE ) |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
431 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
432 uint32_t r=0, g=0, b=0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
433 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
434 writeb( XMULCTRL, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
435 switch (readb (mga_mmio_base + X_DATAREG)) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
436 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
437 case BPP_8: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
438 /* Need to look up the color index, just using |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
439 color 0 for now. */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
440 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
441 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
442 case BPP_15: |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
443 r = mga_grkey.ckey.red >> 3; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
444 g = mga_grkey.ckey.green >> 3; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
445 b = mga_grkey.ckey.blue >> 3; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
446 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
447 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
448 case BPP_16: |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
449 r = mga_grkey.ckey.red >> 3; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
450 g = mga_grkey.ckey.green >> 2; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
451 b = mga_grkey.ckey.blue >> 3; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
452 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
453 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
454 case BPP_24: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
455 case BPP_32_DIR: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
456 case BPP_32_PAL: |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
457 r = mga_grkey.ckey.red; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
458 g = mga_grkey.ckey.green; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
459 b = mga_grkey.ckey.blue; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
460 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
461 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
462 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
463 // Disable color keying on alpha channel |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
464 writeb( XCOLMSK, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
465 writeb( 0x00, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
466 writeb( X_COLKEY, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
467 writeb( 0x00, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
468 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
469 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
470 // Set up color key registers |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
471 writeb( XCOLKEY0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
472 writeb( r, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
473 writeb( XCOLKEY0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
474 writeb( g, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
475 writeb( XCOLKEY0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
476 writeb( b, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
477 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
478 // Set up color key mask registers |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
479 writeb( XCOLMSK0RED, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
480 writeb( 0xff, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
481 writeb( XCOLMSK0GREEN, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
482 writeb( 0xff, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
483 writeb( XCOLMSK0BLUE, mga_mmio_base + PALWTADD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
484 writeb( 0xff, mga_mmio_base + X_DATAREG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
485 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
486 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
487 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
488 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
489 // Backend Scaler |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
490 writel( regs.besctl, mga_mmio_base + BESCTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
491 if(is_g400) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
492 writel( regs.beslumactl, mga_mmio_base + BESLUMACTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
493 writel( regs.bespitch, mga_mmio_base + BESPITCH); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
494 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
495 writel( regs.besa1org, mga_mmio_base + BESA1ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
496 writel( regs.besa1corg, mga_mmio_base + BESA1CORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
497 writel( regs.besa2org, mga_mmio_base + BESA2ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
498 writel( regs.besa2corg, mga_mmio_base + BESA2CORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
499 writel( regs.besb1org, mga_mmio_base + BESB1ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
500 writel( regs.besb1corg, mga_mmio_base + BESB1CORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
501 writel( regs.besb2org, mga_mmio_base + BESB2ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
502 writel( regs.besb2corg, mga_mmio_base + BESB2CORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
503 if(is_g400) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
504 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
505 writel( regs.besa1c3org, mga_mmio_base + BESA1C3ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
506 writel( regs.besa2c3org, mga_mmio_base + BESA2C3ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
507 writel( regs.besb1c3org, mga_mmio_base + BESB1C3ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
508 writel( regs.besb2c3org, mga_mmio_base + BESB2C3ORG); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
509 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
510 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
511 writel( regs.beshcoord, mga_mmio_base + BESHCOORD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
512 writel( regs.beshiscal, mga_mmio_base + BESHISCAL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
513 writel( regs.beshsrcst, mga_mmio_base + BESHSRCST); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
514 writel( regs.beshsrcend, mga_mmio_base + BESHSRCEND); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
515 writel( regs.beshsrclst, mga_mmio_base + BESHSRCLST); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
516 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
517 writel( regs.besvcoord, mga_mmio_base + BESVCOORD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
518 writel( regs.besviscal, mga_mmio_base + BESVISCAL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
519 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
520 writel( regs.besv1srclst, mga_mmio_base + BESV1SRCLST); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
521 writel( regs.besv1wght, mga_mmio_base + BESV1WGHT); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
522 writel( regs.besv2srclst, mga_mmio_base + BESV2SRCLST); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
523 writel( regs.besv2wght, mga_mmio_base + BESV2WGHT); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
524 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
525 //update the registers somewhere between 1 and 2 frames from now. |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
526 writel( regs.besglobctl + ((readl(mga_mmio_base + VCOUNT)+2)<<16), |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
527 mga_mmio_base + BESGLOBCTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
528 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
529 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
530 printf("[mga] wrote BES registers\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
531 printf("[mga] BESCTL = 0x%08x\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
532 readl(mga_mmio_base + BESCTL)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
533 printf("[mga] BESGLOBCTL = 0x%08x\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
534 readl(mga_mmio_base + BESGLOBCTL)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
535 printf("[mga] BESSTATUS= 0x%08x\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
536 readl(mga_mmio_base + BESSTATUS)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
537 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
538 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
539 // printf("c2ctl:0x%08x c2datactl:0x%08x\n",readl(mga_mmio_base + C2CTL),readl(mga_mmio_base + C2DATACTL)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
540 // printf("c2misc:0x%08x\n",readl(mga_mmio_base + C2MISC)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
541 // printf("c2ctl:0x%08x c2datactl:0x%08x\n",cregs.c2ctl,cregs.c2datactl); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
542 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
543 // writel(cregs.c2ctl, mga_mmio_base + C2CTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
544 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
545 writel(((readl(mga_mmio_base + C2CTL) & ~0x03e00000) + (cregs.c2ctl & 0x03e00000)), mga_mmio_base + C2CTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
546 writel(((readl(mga_mmio_base + C2DATACTL) & ~0x000000ff) + (cregs.c2datactl & 0x000000ff)), mga_mmio_base + C2DATACTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
547 // ctrc2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
548 // disable CRTC2 acording to specs |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
549 // writel(cregs.c2ctl & 0xfffffff0, mga_mmio_base + C2CTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
550 // je to treba ??? |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
551 // writeb((readb(mga_mmio_base + XMISCCTRL) & 0x19) | 0xa2, mga_mmio_base + XMISCCTRL); // MAFC - mfcsel & vdoutsel |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
552 // writeb((readb(mga_mmio_base + XMISCCTRL) & 0x19) | 0x92, mga_mmio_base + XMISCCTRL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
553 // writeb((readb(mga_mmio_base + XMISCCTRL) & ~0xe9) + 0xa2, mga_mmio_base + XMISCCTRL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
554 // writel(cregs.c2datactl, mga_mmio_base + C2DATACTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
555 // writel(cregs.c2hparam, mga_mmio_base + C2HPARAM); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
556 // writel(cregs.c2hsync, mga_mmio_base + C2HSYNC); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
557 // writel(cregs.c2vparam, mga_mmio_base + C2VPARAM); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
558 // writel(cregs.c2vsync, mga_mmio_base + C2VSYNC); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
559 writel(cregs.c2misc, mga_mmio_base + C2MISC); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
560 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
561 printf("c2offset = %d\n",cregs.c2offset); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
562 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
563 writel(cregs.c2offset, mga_mmio_base + C2OFFSET); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
564 writel(cregs.c2startadd0, mga_mmio_base + C2STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
565 // writel(cregs.c2startadd1, mga_mmio_base + C2STARTADD1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
566 writel(cregs.c2pl2startadd0, mga_mmio_base + C2PL2STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
567 // writel(cregs.c2pl2startadd1, mga_mmio_base + C2PL2STARTADD1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
568 writel(cregs.c2pl3startadd0, mga_mmio_base + C2PL3STARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
569 // writel(cregs.c2pl3startadd1, mga_mmio_base + C2PL3STARTADD1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
570 writel(cregs.c2spicstartadd0, mga_mmio_base + C2SPICSTARTADD0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
571 // writel(cregs.c2spicstartadd1, mga_mmio_base + C2SPICSTARTADD1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
572 // writel(cregs.c2subpiclut, mga_mmio_base + C2SUBPICLUT); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
573 // writel(cregs.c2preload, mga_mmio_base + C2PRELOAD); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
574 // finaly enable everything |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
575 // writel(cregs.c2ctl, mga_mmio_base + C2CTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
576 // printf("c2ctl:0x%08x c2datactl:0x%08x\n",readl(mga_mmio_base + C2CTL),readl(mga_mmio_base + C2DATACTL)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
577 // printf("c2misc:0x%08x\n", readl(mga_mmio_base + C2MISC)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
578 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
579 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
580 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
581 #ifdef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
582 static void enable_irq(){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
583 long int cc; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
584 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
585 cc = readl(mga_mmio_base + IEN); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
586 // printf("*** !!! IRQREG = %d\n", (int)(cc&0xff)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
587 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
588 writeb( 0x11, mga_mmio_base + CRTCX); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
589 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
590 writeb(0x20, mga_mmio_base + CRTCD ); /* clear 0, enable off */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
591 writeb(0x00, mga_mmio_base + CRTCD ); /* enable on */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
592 writeb(0x10, mga_mmio_base + CRTCD ); /* clear = 1 */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
593 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
594 writel( regs.besglobctl , mga_mmio_base + BESGLOBCTL); |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
595 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
596 return; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
597 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
598 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
599 static void disable_irq() |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
600 { |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
601 writeb( 0x11, mga_mmio_base + CRTCX); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
602 writeb(0x20, mga_mmio_base + CRTCD ); /* clear 0, enable off */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
603 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
604 return; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
605 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
606 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
607 void mga_handle_irq(int irq, void *dev_id/*, struct pt_regs *pregs*/) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
608 // static int frame=0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
609 // static int counter=0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
610 long int cc; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
611 // if ( ! mga_enabled_flag ) return; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
612 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
613 // printf("vcount = %d\n",readl(mga_mmio_base + VCOUNT)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
614 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
615 //printf("mga_interrupt #%d\n", irq); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
616 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
617 if ( irq != -1 ) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
618 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
619 cc = readl(mga_mmio_base + STATUS); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
620 if ( ! (cc & 0x10) ) return; /* vsyncpen */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
621 // debug_irqcnt++; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
622 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
623 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
624 // if ( debug_irqignore ) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
625 // debug_irqignore = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
626 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
627 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
628 /* |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
629 if ( mga_conf_deinterlace ) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
630 if ( mga_first_field ) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
631 // printf("mga_interrupt first field\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
632 if ( syncfb_interrupt() ) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
633 mga_first_field = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
634 } else { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
635 // printf("mga_interrupt second field\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
636 mga_select_buffer( mga_current_field | 2 ); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
637 mga_first_field = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
638 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
639 } else { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
640 syncfb_interrupt(); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
641 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
642 */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
643 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
644 // frame=(frame+1)&1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
645 regs.besctl = (regs.besctl & ~0x07000000) + (mga_next_frame << 25); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
646 writel( regs.besctl, mga_mmio_base + BESCTL ); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
647 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
648 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
649 // sem pridat vyber obrazku !!!! |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
650 crtc2_frame_sel(mga_next_frame); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
651 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
652 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
653 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
654 ++counter; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
655 if(!(counter&63)){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
656 printf("mga irq counter = %d\n",counter); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
657 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
658 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
659 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
660 // } else { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
661 // debug_irqignore = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
662 // } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
663 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
664 if ( irq != -1 ) { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
665 writeb( 0x11, mga_mmio_base + CRTCX); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
666 writeb( 0, mga_mmio_base + CRTCD ); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
667 writeb( 0x10, mga_mmio_base + CRTCD ); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
668 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
669 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
670 // writel( regs.besglobctl, mga_mmio_base + BESGLOBCTL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
671 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
672 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
673 return; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
674 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
675 } |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
676 #endif /* MGA_ALLOW_IRQ */ |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
677 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
678 int vixConfigPlayback(vidix_playback_t *config) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
679 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
680 int x, y, sw, sh, dw, dh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
681 int besleft, bestop, ifactor, ofsleft, ofstop, baseadrofs, weight, weights; |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
682 int frame_size; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
683 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
684 #define right_margin 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
685 #define left_margin 18 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
686 #define hsync_len 46 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
687 #define lower_margin 10 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
688 #define vsync_len 4 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
689 #define upper_margin 39 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
690 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
691 unsigned int hdispend = (config->src.w + 31) & ~31; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
692 unsigned int hsyncstart = hdispend + (right_margin & ~7); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
693 unsigned int hsyncend = hsyncstart + (hsync_len & ~7); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
694 unsigned int htotal = hsyncend + (left_margin & ~7); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
695 unsigned int vdispend = config->src.h; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
696 unsigned int vsyncstart = vdispend + lower_margin; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
697 unsigned int vsyncend = vsyncstart + vsync_len; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
698 unsigned int vtotal = vsyncend + upper_margin; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
699 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
700 int frame; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
701 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
702 if ((config->num_frames < 1) || (config->num_frames > 4)) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
703 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
704 printf("[mga] illegal num_frames: %d, setting to 2\n", config->num_frames); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
705 config->num_frames = 2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
706 // return(EINVAL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
707 } |
4238
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
708 |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
709 config->num_frames = 2; /* let it be for now */ |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
710 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
711 x = config->dest.x; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
712 y = config->dest.y; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
713 sw = config->src.w; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
714 sh = config->src.h; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
715 dw = config->dest.w; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
716 dh = config->dest.h; |
4144 | 717 |
718 config->dest.pitch.y=32; | |
719 config->dest.pitch.u= | |
720 config->dest.pitch.v=16; | |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
721 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
722 printf("[mga] Setting up a %dx%d+%d+%d video window (src %dx%d) format %X\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
723 dw, dh, x, y, sw, sh, config->fourcc); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
724 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
725 if ((sw < 4) || (sh < 4) || (dw < 4) || (dh < 4)) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
726 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
727 printf("[mga] Invalid src/dest dimenstions\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
728 return(EINVAL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
729 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
730 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
731 //FIXME check that window is valid and inside desktop |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
732 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
733 // printf("[mga] vcount = %d\n", readl(mga_mmio_base + VCOUNT)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
734 printf("[mga] mga_mmio_base = %p\n",mga_mmio_base); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
735 printf("[mga] mga_mem_base = %08x\n",mga_mem_base); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
736 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
737 switch(config->fourcc) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
738 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
739 case IMGFMT_I420: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
740 case IMGFMT_IYUV: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
741 case IMGFMT_YV12: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
742 config->frame_size = ((sw + 31) & ~31) * sh + (((sw + 31) & ~31) * sh) / 2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
743 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
744 case IMGFMT_YUY2: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
745 case IMGFMT_UYVY: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
746 config->frame_size = ((sw + 31) & ~31) * sh * 2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
747 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
748 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
749 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
750 // config->frame_size = config->src.h*config->src.w+(config->src.w*config->src.h)/2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
751 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
752 frame_size = config->frame_size; |
4144 | 753 |
4238
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
754 config->offsets[0] = 0; |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
755 config->offsets[1] = config->frame_size; /* ?? */ |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
756 |
4144 | 757 config->offset.y=0; |
758 config->offset.v=((sw + 31) & ~31) * sh; | |
759 config->offset.u=config->offset.v+((sw + 31) & ~31) * sh /4; | |
760 | |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
761 mga_src_base = (mga_ram_size*0x100000-config->num_frames*config->frame_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
762 if (mga_src_base < 0) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
763 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
764 printf("[mga] not enough memory for frames!\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
765 return(EFAULT); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
766 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
767 mga_src_base &= (~0xFFFF); /* 64k boundary */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
768 printf("[mga] YUV buffer base: %p\n", mga_src_base); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
769 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
770 config->dga_addr = mga_mem_base + mga_src_base; |
4238
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
771 |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
772 // config->offset.y = config->dga_addr; |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
773 // config->offset.u = config->offset.y+config->frame_size; |
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
774 // config->offset.v = config->offset.u+2*config->frame_size; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
775 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
776 //FIXME figure out a better way to allocate memory on card |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
777 //allocate 2 megs |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
778 //mga_src_base = mga_mem_base + (MGA_VIDMEM_SIZE-2) * 0x100000; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
779 //mga_src_base = (MGA_VIDMEM_SIZE-3) * 0x100000; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
780 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
781 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
782 //Setup the BES registers for a three plane 4:2:0 video source |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
783 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
784 regs.besglobctl = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
785 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
786 switch(config->fourcc) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
787 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
788 case IMGFMT_YV12: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
789 case IMGFMT_I420: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
790 case IMGFMT_IYUV: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
791 regs.besctl = 1 // BES enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
792 + (0<<6) // even start polarity |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
793 + (1<<10) // x filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
794 + (1<<11) // y filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
795 + (1<<16) // chroma upsampling |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
796 + (1<<17) // 4:2:0 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
797 + (1<<18); // dither enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
798 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
799 if(is_g400) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
800 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
801 //zoom disabled, zoom filter disabled, 420 3 plane format, proc amp |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
802 //disabled, rgb mode disabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
803 regs.besglobctl = (1<<5); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
804 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
805 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
806 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
807 //zoom disabled, zoom filter disabled, Cb samples in 0246, Cr |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
808 //in 1357, BES register update on besvcnt |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
809 regs.besglobctl = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
810 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
811 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
812 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
813 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
814 case IMGFMT_YUY2: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
815 regs.besctl = 1 // BES enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
816 + (0<<6) // even start polarity |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
817 + (1<<10) // x filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
818 + (1<<11) // y filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
819 + (1<<16) // chroma upsampling |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
820 + (0<<17) // 4:2:2 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
821 + (1<<18); // dither enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
822 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
823 regs.besglobctl = 0; // YUY2 format selected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
824 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
825 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
826 case IMGFMT_UYVY: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
827 regs.besctl = 1 // BES enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
828 + (0<<6) // even start polarity |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
829 + (1<<10) // x filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
830 + (1<<11) // y filtering enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
831 + (1<<16) // chroma upsampling |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
832 + (0<<17) // 4:2:2 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
833 + (1<<18); // dither enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
834 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
835 regs.besglobctl = 1<<6; // UYVY format selected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
836 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
837 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
838 default: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
839 printf("[mga] Unsupported pixel format: %x\n", config->fourcc); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
840 return(ENOTSUP); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
841 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
842 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
843 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
844 //Disable contrast and brightness control |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
845 regs.besglobctl |= (1<<5) + (1<<7); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
846 regs.beslumactl = (0x7f << 16) + (0x80<<0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
847 regs.beslumactl = 0x80<<0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
848 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
849 //Setup destination window boundaries |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
850 besleft = x > 0 ? x : 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
851 bestop = y > 0 ? y : 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
852 regs.beshcoord = (besleft<<16) + (x + dw-1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
853 regs.besvcoord = (bestop<<16) + (y + dh-1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
854 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
855 //Setup source dimensions |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
856 regs.beshsrclst = (sw - 1) << 16; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
857 regs.bespitch = (sw + 31) & ~31 ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
858 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
859 //Setup horizontal scaling |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
860 ifactor = ((sw-1)<<14)/(dw-1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
861 ofsleft = besleft - x; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
862 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
863 regs.beshiscal = ifactor<<2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
864 regs.beshsrcst = (ofsleft*ifactor)<<2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
865 regs.beshsrcend = regs.beshsrcst + (((dw - ofsleft - 1) * ifactor) << 2); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
866 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
867 //Setup vertical scaling |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
868 ifactor = ((sh-1)<<14)/(dh-1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
869 ofstop = bestop - y; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
870 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
871 regs.besviscal = ifactor<<2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
872 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
873 baseadrofs = ((ofstop*regs.besviscal)>>16)*regs.bespitch; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
874 //frame_size = ((sw + 31) & ~31) * sh + (((sw + 31) & ~31) * sh) / 2; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
875 regs.besa1org = (uint32_t) mga_src_base + baseadrofs; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
876 regs.besa2org = (uint32_t) mga_src_base + baseadrofs + 1*frame_size; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
877 regs.besb1org = (uint32_t) mga_src_base + baseadrofs + 2*frame_size; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
878 regs.besb2org = (uint32_t) mga_src_base + baseadrofs + 3*frame_size; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
879 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
880 if(config->fourcc==IMGFMT_YV12 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
881 ||config->fourcc==IMGFMT_IYUV |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
882 ||config->fourcc==IMGFMT_I420 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
883 ){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
884 // planar YUV frames: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
885 if (is_g400) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
886 baseadrofs = (((ofstop*regs.besviscal)/4)>>16)*regs.bespitch; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
887 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
888 baseadrofs = (((ofstop*regs.besviscal)/2)>>16)*regs.bespitch; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
889 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
890 if(config->fourcc==IMGFMT_YV12){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
891 regs.besa1corg = (uint32_t) mga_src_base + baseadrofs + regs.bespitch * sh ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
892 regs.besa2corg = (uint32_t) mga_src_base + baseadrofs + 1*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
893 regs.besb1corg = (uint32_t) mga_src_base + baseadrofs + 2*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
894 regs.besb2corg = (uint32_t) mga_src_base + baseadrofs + 3*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
895 regs.besa1c3org = regs.besa1corg + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
896 regs.besa2c3org = regs.besa2corg + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
897 regs.besb1c3org = regs.besb1corg + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
898 regs.besb2c3org = regs.besb2corg + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
899 } else { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
900 regs.besa1c3org = (uint32_t) mga_src_base + baseadrofs + regs.bespitch * sh ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
901 regs.besa2c3org = (uint32_t) mga_src_base + baseadrofs + 1*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
902 regs.besb1c3org = (uint32_t) mga_src_base + baseadrofs + 2*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
903 regs.besb2c3org = (uint32_t) mga_src_base + baseadrofs + 3*frame_size + regs.bespitch * sh; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
904 regs.besa1corg = regs.besa1c3org + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
905 regs.besa2corg = regs.besa2c3org + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
906 regs.besb1corg = regs.besb1c3org + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
907 regs.besb2corg = regs.besb2c3org + ((regs.bespitch * sh) / 4); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
908 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
909 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
910 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
911 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
912 weight = ofstop * (regs.besviscal >> 2); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
913 weights = weight < 0 ? 1 : 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
914 regs.besv2wght = regs.besv1wght = (weights << 16) + ((weight & 0x3FFF) << 2); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
915 regs.besv2srclst = regs.besv1srclst = sh - 1 - (((ofstop * regs.besviscal) >> 16) & 0x03FF); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
916 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
917 #ifdef CRTC2 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
918 // pridat hlavni registry - tj. casovani ... |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
919 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
920 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
921 switch(config->fourcc){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
922 case IMGFMT_YV12: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
923 case IMGFMT_I420: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
924 case IMGFMT_IYUV: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
925 cregs.c2ctl = 1 // CRTC2 enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
926 + (1<<1) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
927 + (0<<2) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
928 + (1<<3) // pixel clock enable - not needed ??? |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
929 + (0<<4) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
930 + (1<<5) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
931 + (0<<6) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
932 + (1<<8) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
933 + (0<<9) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
934 + (0<<10) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
935 + (0<<20) // CRTC1 to DAC |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
936 + (1<<21) // 420 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
937 + (1<<22) // 420 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
938 + (1<<23) // 420 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
939 + (0<<24) // single chroma line for 420 mode - need to be corrected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
940 + (0<<25) /*/ interlace mode - need to be corrected*/ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
941 + (0<<26) // field legth polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
942 + (0<<27) // field identification polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
943 + (1<<28) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
944 + (0<<29) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
945 + (1<<30) // Horizontal counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
946 + (1<<31) // Vertical counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
947 ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
948 cregs.c2datactl = 1 // disable dither - propably not needed, we are already in YUV mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
949 + (1<<1) // Y filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
950 + (1<<2) // CbCr filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
951 + (0<<3) // subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
952 + (0<<4) // NTSC enable (disabled - PAL) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
953 + (0<<5) // C2 static subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
954 + (0<<6) // C2 subpicture offset division (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
955 + (0<<7) // 422 subformat selection ! |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
956 /* + (0<<8) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
957 + (0<<9) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
958 + (0<<10) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
959 + (0<<11) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
960 + (0<<12) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
961 + (0<<13) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
962 + (0<<14) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
963 + (0<<15) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
964 + (0<<16) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
965 + (0<<17) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
966 + (0<<18) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
967 + (0<<19) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
968 + (0<<20) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
969 + (0<<21) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
970 + (0<<22) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
971 + (0<<23) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
972 + (0<<24) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
973 + (0<<25) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
974 + (0<<26) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
975 + (0<<27) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
976 + (0<<28) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
977 */ ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
978 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
979 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
980 case IMGFMT_YUY2: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
981 cregs.c2ctl = 1 // CRTC2 enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
982 + (1<<1) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
983 + (0<<2) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
984 + (1<<3) // pixel clock enable - not needed ??? |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
985 + (0<<4) // high prioryty req - acc to spec |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
986 + (1<<5) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
987 + (0<<6) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
988 // 7 reserved |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
989 + (1<<8) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
990 + (0<<9) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
991 + (0<<10) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
992 // 11-19 reserved |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
993 + (0<<20) // CRTC1 to DAC |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
994 + (1<<21) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
995 + (0<<22) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
996 + (1<<23) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
997 + (0<<24) // single chroma line for 420 mode - need to be corrected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
998 + (0<<25) /*/ interlace mode - need to be corrected*/ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
999 + (0<<26) // field legth polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1000 + (0<<27) // field identification polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1001 + (1<<28) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1002 + (0<<29) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1003 + (1<<30) // Horizontal counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1004 + (1<<31) // Vertical counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1005 ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1006 cregs.c2datactl = 1 // disable dither - propably not needed, we are already in YUV mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1007 + (1<<1) // Y filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1008 + (1<<2) // CbCr filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1009 + (0<<3) // subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1010 + (0<<4) // NTSC enable (disabled - PAL) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1011 + (0<<5) // C2 static subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1012 + (0<<6) // C2 subpicture offset division (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1013 + (0<<7) // 422 subformat selection ! |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1014 /* + (0<<8) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1015 + (0<<9) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1016 + (0<<10) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1017 + (0<<11) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1018 + (0<<12) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1019 + (0<<13) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1020 + (0<<14) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1021 + (0<<15) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1022 + (0<<16) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1023 + (0<<17) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1024 + (0<<18) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1025 + (0<<19) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1026 + (0<<20) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1027 + (0<<21) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1028 + (0<<22) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1029 + (0<<23) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1030 + (0<<24) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1031 + (0<<25) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1032 + (0<<26) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1033 + (0<<27) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1034 + (0<<28) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1035 */ ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1036 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1037 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1038 case IMGFMT_UYVY: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1039 cregs.c2ctl = 1 // CRTC2 enabled |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1040 + (1<<1) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1041 + (0<<2) // external clock |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1042 + (1<<3) // pixel clock enable - not needed ??? |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1043 + (0<<4) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1044 + (1<<5) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1045 + (0<<6) // high prioryty req |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1046 + (1<<8) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1047 + (0<<9) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1048 + (0<<10) // high prioryty req max |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1049 + (0<<20) // CRTC1 to DAC |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1050 + (1<<21) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1051 + (0<<22) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1052 + (1<<23) // 422 mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1053 + (1<<24) // single chroma line for 420 mode - need to be corrected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1054 + (1<<25) /*/ interlace mode - need to be corrected*/ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1055 + (0<<26) // field legth polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1056 + (0<<27) // field identification polariry |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1057 + (1<<28) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1058 + (0<<29) // VIDRST detection mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1059 + (1<<30) // Horizontal counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1060 + (1<<31) // Vertical counter preload |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1061 ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1062 cregs.c2datactl = 0 // enable dither - propably not needed, we are already in YUV mode |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1063 + (1<<1) // Y filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1064 + (1<<2) // CbCr filter enable |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1065 + (0<<3) // subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1066 + (0<<4) // NTSC enable (disabled - PAL) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1067 + (0<<5) // C2 static subpicture enable (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1068 + (0<<6) // C2 subpicture offset division (disabled) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1069 + (1<<7) // 422 subformat selection ! |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1070 /* + (0<<8) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1071 + (0<<9) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1072 + (0<<10) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1073 + (0<<11) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1074 + (0<<12) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1075 + (0<<13) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1076 + (0<<14) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1077 + (0<<15) // 15 bpp high alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1078 + (0<<16) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1079 + (0<<17) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1080 + (0<<18) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1081 + (0<<19) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1082 + (0<<20) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1083 + (0<<21) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1084 + (0<<22) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1085 + (0<<23) // 15 bpp low alpha |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1086 + (0<<24) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1087 + (0<<25) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1088 + (0<<26) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1089 + (0<<27) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1090 + (0<<28) // static subpicture key |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1091 */ ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1092 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1093 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1094 default: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1095 printf("[mga] Unsupported pixel format: %x\n",config->fourcc); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1096 return(ENOTSUP); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1097 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1098 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1099 cregs.c2hparam=((hdispend - 8) << 16) | (htotal - 8); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1100 cregs.c2hsync=((hsyncend - 8) << 16) | (hsyncstart - 8); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1101 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1102 cregs.c2misc=0 // CRTCV2 656 togg f0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1103 +(0<<1) // CRTCV2 656 togg f0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1104 +(0<<2) // CRTCV2 656 togg f0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1105 +(0<<4) // CRTCV2 656 togg f1 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1106 +(0<<5) // CRTCV2 656 togg f1 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1107 +(0<<6) // CRTCV2 656 togg f1 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1108 +(0<<8) // Hsync active high |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1109 +(0<<9) // Vsync active high |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1110 // 16-27 c2vlinecomp - nevim co tam dat |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1111 ; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1112 cregs.c2offset=(regs.bespitch << 1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1113 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1114 cregs.c2pl2startadd0=regs.besa1corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1115 // cregs.c2pl2startadd1=regs.besa2corg; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1116 cregs.c2pl3startadd0=regs.besa1c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1117 // cregs.c2pl3startadd1=regs.besa2c3org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1118 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1119 cregs.c2preload=(vsyncstart << 16) | (hsyncstart); // from |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1120 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1121 cregs.c2spicstartadd0=0; // not used |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1122 // cregs.c2spicstartadd1=0; // not used |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1123 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1124 cregs.c2startadd0=regs.besa1org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1125 // cregs.c2startadd1=regs.besa2org; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1126 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1127 cregs.c2subpiclut=0; //not used |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1128 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1129 cregs.c2vparam=((vdispend - 1) << 16) | (vtotal - 1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1130 cregs.c2vsync=((vsyncend - 1) << 16) | (vsyncstart - 1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1131 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1132 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1133 mga_vid_write_regs(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1134 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1135 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1136 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1137 int vixPlaybackOn(void) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1138 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1139 printf("[mga] playback on\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1140 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1141 vid_src_ready = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1142 if(vid_overlay_on) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1143 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1144 regs.besctl |= 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1145 mga_vid_write_regs(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1146 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1147 #ifdef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1148 if (mga_irq != -1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1149 enable_irq(); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1150 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1151 mga_next_frame=0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1152 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1153 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1154 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1155 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1156 int vixPlaybackOff(void) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1157 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1158 printf("[mga] playback off\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1159 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1160 vid_src_ready = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1161 #ifdef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1162 if (mga_irq != -1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1163 disable_irq(); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1164 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1165 regs.besctl &= ~1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1166 regs.besglobctl &= ~(1<<6); /* UYVY format selected */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1167 mga_vid_write_regs(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1168 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1169 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1170 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1171 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1172 static int mga_vid_release(/*struct inode *inode, struct file *file*/) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1173 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1174 //Close the window just in case |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1175 printf("[mga] Video OFF (release)\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1176 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1177 vid_src_ready = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1178 regs.besctl &= ~1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1179 regs.besglobctl &= ~(1<<6); // UYVY format selected |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1180 // mga_config.colkey_on=0; //!!! |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1181 mga_vid_write_regs(1); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1182 mga_vid_in_use = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1183 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1184 // MOD_DEC_USE_COUNT; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1185 return 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1186 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1187 |
4191 | 1188 int vixProbe(int verbose,int force) |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1189 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1190 pciinfo_t lst[MAX_PCI_DEVICES]; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1191 unsigned int i, num_pci; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1192 int err; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1193 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1194 printf("[mga] probe\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1195 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1196 mga_verbose = verbose; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1197 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1198 is_g400 = -1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1199 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1200 err = pci_scan(&lst, &num_pci); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1201 if (err) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1202 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1203 printf("[mga] Error occured during pci scan: %s\n", strerror(err)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1204 return(err); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1205 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1206 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1207 if (mga_verbose > 1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1208 printf("[mga] found %d pci devices\n", num_pci); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1209 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1210 for (i = 0; i < num_pci; i++) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1211 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1212 if (mga_verbose > 2) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1213 printf("pci[%d] vendor: %d device: %d\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1214 i, lst[i].vendor, lst[i].device); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1215 if (lst[i].vendor == VENDOR_MATROX) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1216 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1217 switch(lst[i].device) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1218 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1219 case DEVICE_MATROX_MGA_G550_AGP: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1220 printf("[mga] Found MGA G550\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1221 is_g400 = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1222 goto card_found; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1223 case DEVICE_MATROX_MGA_G400_AGP: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1224 printf("[mga] Found MGA G400/G450\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1225 is_g400 = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1226 goto card_found; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1227 case DEVICE_MATROX_MGA_G200_AGP: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1228 printf("[mga] Found MGA G200 AGP\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1229 is_g400 = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1230 goto card_found; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1231 case DEVICE_MATROX_MGA_G200: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1232 printf("[mga] Found MGA G200 PCI\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1233 is_g400 = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1234 goto card_found; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1235 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1236 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1237 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1238 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1239 if (is_g400 == -1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1240 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1241 printf("[mga] No supported cards found\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1242 return(ENXIO); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1243 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1244 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1245 card_found: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1246 probed = 1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1247 memcpy(&pci_info, &lst[i], sizeof(pciinfo_t)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1248 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1249 mga_cap.device_id = pci_info.device; /* set device id in capabilites */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1250 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1251 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1252 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1253 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1254 int vixInit(void) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1255 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1256 unsigned int card_option; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1257 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1258 printf("[mga] init\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1259 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1260 mga_vid_in_use = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1261 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1262 printf("Matrox MGA G200/G400/G450 YUV Video interface v2.01 (c) Aaron Holtzman & A'rpi\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1263 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1264 if (!probed) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1265 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1266 printf("[mga] driver was not probed but is being initializing\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1267 return(EINTR); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1268 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1269 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1270 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1271 #if LINUX_VERSION_CODE >= 0x020300 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1272 mga_mmio_base = ioremap_nocache(dev->resource[1].start,0x4000); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1273 mga_mem_base = dev->resource[0].start; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1274 #else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1275 mga_mmio_base = ioremap_nocache(dev->base_address[1] & PCI_BASE_ADDRESS_MEM_MASK,0x4000); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1276 mga_mem_base = dev->base_address[0] & PCI_BASE_ADDRESS_MEM_MASK; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1277 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1278 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1279 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1280 #warning "FIXME: implement pciconfig_read! (or enable syscall)\n" |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1281 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1282 /* from linux/pci.h */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1283 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1284 |
4238
9eada2812ed3
i think, it's better [playback->offsets and offset implemented/corrected]
alex
parents:
4191
diff
changeset
|
1285 pci_config_read(pci_info.bus, PCI_DEVFN(pci_info.card, pci_info.func), |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1286 0x40, 4, &card_option); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1287 // pci_read_config_dword(dev, 0x40, &card_option); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1288 printf("[mga] OPTION word: 0x%08X mem: 0x%02X %s\n", card_option, |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1289 (card_option>>10)&0x17, ((card_option>>14)&1)?"SGRAM":"SDRAM"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1290 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1291 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1292 // temp = (card_option >> 10) & 0x17; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1293 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1294 if (mga_ram_size) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1295 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1296 printf("[mga] RAMSIZE forced to %d MB\n", mga_ram_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1297 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1298 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1299 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1300 #ifdef MGA_MEMORY_SIZE |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1301 mga_ram_size = MGA_MEMORY_SIZE; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1302 printf("[mga] hard-coded RAMSIZE is %d MB\n", (unsigned int) mga_ram_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1303 #else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1304 if (is_g400) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1305 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1306 switch((card_option>>10)&0x17) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1307 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1308 // SDRAM: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1309 case 0x00: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1310 case 0x04: mga_ram_size = 16; break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1311 case 0x03: mga_ram_size = 32; break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1312 // SGRAM: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1313 case 0x10: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1314 case 0x14: mga_ram_size = 32; break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1315 case 0x11: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1316 case 0x12: mga_ram_size = 16; break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1317 default: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1318 mga_ram_size = 16; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1319 printf("[mga] Couldn't detect RAMSIZE, assuming 16MB!\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1320 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1321 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1322 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1323 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1324 switch((card_option>>10)&0x17) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1325 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1326 // case 0x10: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1327 // case 0x13: mga_ram_size = 8; break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1328 default: mga_ram_size = 8; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1329 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1330 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1331 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1332 #if 0 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1333 // printf("List resources -----------\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1334 for(temp=0;temp<DEVICE_COUNT_RESOURCE;temp++){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1335 struct resource *res=&pci_dev->resource[temp]; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1336 if(res->flags){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1337 int size=(1+res->end-res->start)>>20; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1338 printf("res %d: start: 0x%X end: 0x%X (%d MB) flags=0x%X\n",temp,res->start,res->end,size,res->flags); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1339 if(res->flags&(IORESOURCE_MEM|IORESOURCE_PREFETCH)){ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1340 if(size>mga_ram_size && size<=64) mga_ram_size=size; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1341 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1342 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1343 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1344 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1345 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1346 printf("[mga] detected RAMSIZE is %d MB\n", (unsigned int) mga_ram_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1347 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1348 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1349 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1350 if (mga_ram_size) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1351 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1352 if ((mga_ram_size < 4) || (mga_ram_size > 64)) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1353 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1354 printf("[mga] invalid RAMSIZE: %d MB\n", mga_ram_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1355 return(EINVAL); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1356 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1357 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1358 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1359 printf("[mga] hardware addresses: mmio: %p, framebuffer: %p\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1360 pci_info.base1, pci_info.base0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1361 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1362 mga_mmio_base = map_phys_mem(pci_info.base1,0x4000); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1363 mga_mem_base = map_phys_mem(pci_info.base0,mga_ram_size*1024*1024); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1364 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1365 printf("[mga] MMIO at %p, IRQ: %d, framebuffer: %p\n", |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1366 mga_mmio_base, mga_irq, mga_mem_base); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1367 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1368 #ifdef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1369 if (mga_irq != -1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1370 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1371 int tmp = request_irq(mga_irq, mga_handle_irq, SA_INTERRUPT | SA_SHIRQ, "Syncfb Time Base", &mga_irq); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1372 if (tmp) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1373 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1374 printf("syncfb (mga): cannot register irq %d (Err: %d)\n", mga_irq, tmp); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1375 mga_irq=-1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1376 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1377 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1378 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1379 printf("syncfb (mga): registered irq %d\n", mga_irq); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1380 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1381 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1382 else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1383 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1384 printf("syncfb (mga): No valid irq was found\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1385 mga_irq=-1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1386 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1387 #else |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1388 printf("syncfb (mga): IRQ disabled in mga_vid.c\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1389 mga_irq=-1; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1390 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1391 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1392 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1393 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1394 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1395 void vixDestroy(void) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1396 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1397 printf("[mga] destroy\n"); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1398 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1399 #ifdef MGA_ALLOW_IRQ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1400 if (mga_irq != -1) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1401 free_irq(mga_irq, &mga_irq); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1402 #endif |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1403 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1404 if (mga_mmio_base) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1405 unmap_phys_mem(mga_mmio_base, 0x4000); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1406 if (mga_mem_base) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1407 unmap_phys_mem(mga_mem_base, mga_ram_size); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1408 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1409 /* FIXME turn off BES */ |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1410 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1411 return; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1412 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1413 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1414 int vixQueryFourcc(vidix_fourcc_t *to) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1415 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1416 printf("[mga] query fourcc (%x)\n", to->fourcc); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1417 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1418 switch(to->fourcc) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1419 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1420 case IMGFMT_YV12: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1421 case IMGFMT_IYUV: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1422 case IMGFMT_I420: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1423 case IMGFMT_YUY2: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1424 case IMGFMT_UYVY: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1425 break; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1426 default: |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1427 to->depth = to->flags = 0; |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1428 return(ENOTSUP); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1429 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1430 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1431 to->depth = VID_DEPTH_12BPP | |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1432 VID_DEPTH_15BPP | VID_DEPTH_16BPP | |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1433 VID_DEPTH_24BPP | VID_DEPTH_32BPP; |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1434 to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY; |
4139
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1435 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1436 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1437 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1438 unsigned int vixGetVersion(void) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1439 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1440 return(VIDIX_VERSION); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1441 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1442 |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1443 int vixGetCapability(vidix_capability_t *to) |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1444 { |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1445 memcpy(to, &mga_cap, sizeof(vidix_capability_t)); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1446 return(0); |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1447 } |
13d6395e8daa
added mga_vid (also playback->offset is not set (fixing it on monday)
alex
parents:
diff
changeset
|
1448 |
4239
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1449 int vixGetGrKeys(vidix_grkey_t *grkey) |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1450 { |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1451 memcpy(grkey, &mga_grkey, sizeof(vidix_grkey_t)); |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1452 return(0); |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1453 } |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1454 |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1455 int vixSetGrKeys(const vidix_grkey_t *grkey) |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1456 { |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1457 memcpy(&mga_grkey, grkey, sizeof(vidix_grkey_t)); |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1458 return(0); |
acadddf56508
updated, colorkey support, pontscho reported it's working fine, only faulting with very-very-very big resolution
alex
parents:
4238
diff
changeset
|
1459 } |
4250 | 1460 |
1461 #ifdef TEST_ME_PLEASE | |
1462 vidix_video_eq_t equal = { 0, 0, 0, 0, 0, 0, 0, 0 }; | |
1463 int vixPlaybackSetEq( const vidix_video_eq_t * eq) | |
1464 { | |
1465 uint32_t beslumactl; | |
1466 int brightness,contrast; | |
1467 memcpy(&equal,eq,sizeof(vidix_video_eq_t)); | |
1468 //Enable contrast and brightness control | |
1469 writel(readl(mga_mmio_base + BESGLOBCTL) & ~((1<<5) + (1<<7)),mga_mmio_base + BESGLOBCTL); | |
1470 brightness = (equal.brightness * 128) / 1000; | |
1471 if(brightness < -128) brightness = -128; | |
1472 if(brightness > 127) brightness = 127; | |
1473 contrast = ((equal.contrast + 1000) * 128) / 1000; | |
1474 if(contrast < 0) contrast = 0; | |
1475 if(contrast > 255) contrast = 255; | |
1476 beslumactl = ((brightness & 0xff) << 16) | (contrast & 0xff); | |
1477 writel(beslumactl,mga_mmio_base + BESLUMACTL); | |
1478 return 0; | |
1479 } | |
1480 | |
1481 int vixPlaybackGetEq( vidix_video_eq_t * eq) | |
1482 { | |
1483 memcpy(eq,&equal,sizeof(vidix_video_eq_t)); | |
1484 return 0; | |
1485 } | |
1486 #endif |