annotate vidix/nvidia_vid.c @ 26539:d572ecfb34ae

Make sure all autogenerated .h and .c files exist in the vidix subdirectory before trying to create object or dependency files there.
author diego
date Mon, 28 Apr 2008 13:28:36 +0000
parents 0d255d03016f
children 051b2632f121
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1 /*
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
2 * VIDIX driver for nVidia chipsets.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
3 * Copyright (C) 2003-2004 Sascha Sommer
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
4 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
5 * This file is part of MPlayer.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
6 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
7 * MPlayer is free software; you can redistribute it and/or modify
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
8 * it under the terms of the GNU General Public License as published by
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
10 * (at your option) any later version.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
11 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
12 * MPlayer is distributed in the hope that it will be useful,
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
15 * GNU General Public License for more details.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
16 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
17 * You should have received a copy of the GNU General Public License
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
18 * along with MPlayer; if not, write to the Free Software
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
20 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
21 * This file is based on sources from RIVATV (rivatv.sf.net)
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
22 * Multi buffer support and TNT2 fixes by Dmitry Baryshkov.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22955
diff changeset
23 */
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
24
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
25 #include <errno.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
26 #include <stdio.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
27 #include <stdlib.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
28 #include <string.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
29 #include <math.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
30 #include <inttypes.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
31 #include <unistd.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
33
26203
0d255d03016f #include config.h before all other headers.
diego
parents: 26167
diff changeset
34 #include "config.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
35 #include "vidix.h"
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
36 #include "vidixlib.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
37 #include "fourcc.h"
22901
a7605669b114 renamed libdha.[hc] to dha.[hc]
ben
parents: 22900
diff changeset
38 #include "dha.h"
22900
a9e111b88c4a merged libdha and libvidix, moved all files from libdha to vidix directory
ben
parents: 22880
diff changeset
39 #include "pci_ids.h"
a9e111b88c4a merged libdha and libvidix, moved all files from libdha to vidix directory
ben
parents: 22880
diff changeset
40 #include "pci_names.h"
22905
f34e5d778267 consistent include paths for config.h et al.
diego
parents: 22901
diff changeset
41 #include "libavutil/common.h"
f34e5d778267 consistent include paths for config.h et al.
diego
parents: 22901
diff changeset
42 #include "mpbswap.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
43
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
44
23055
ac9905bdacc2 declare variable as static
ben
parents: 23046
diff changeset
45 static pciinfo_t pci_info;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
46
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
47
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
48 #define MAX_FRAMES 3
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
49 #define NV04_BES_SIZE 1024*2000*4
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
50
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
51
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
52 static vidix_capability_t nvidia_cap = {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
53 "NVIDIA RIVA OVERLAY DRIVER",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
54 "Sascha Sommer <saschasommer@freenet.de>",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
55 TYPE_OUTPUT,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
56 { 0, 0, 0, 0 },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
57 2046,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
58 2046,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
59 4,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
60 4,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
61 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
62 FLAG_UPSCALER|FLAG_DOWNSCALER,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
63 VENDOR_NVIDIA2,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
64 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
65 { 0, 0, 0, 0 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
66 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
67
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
68 #define NV_ARCH_03 0x03
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
69 #define NV_ARCH_04 0x04
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
70 #define NV_ARCH_10 0x10
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
71 #define NV_ARCH_20 0x20
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
72 #define NV_ARCH_30 0x30
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
73 #define NV_ARCH_40 0x40
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
74
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
75 // since no useful information whatsoever is passed
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
76 // to the equalizer functions we need this
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
77 static struct {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
78 uint32_t lum; // luminance (brightness + contrast)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
79 uint32_t chrom; // chrominance (saturation + hue)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
80 uint8_t red_off; // for NV03/NV04
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
81 uint8_t green_off;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
82 uint8_t blue_off;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
83 vidix_video_eq_t vals;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
84 } eq;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
85
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
86 struct nvidia_cards {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
87 unsigned short chip_id;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
88 unsigned short arch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
89 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
90
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
91
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
92 static struct nvidia_cards nvidia_card_ids[] = {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
93 /*NV03*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
94 {DEVICE_NVIDIA2_RIVA128, NV_ARCH_03},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
95 {DEVICE_NVIDIA2_RIVA128ZX,NV_ARCH_03},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
96 /*NV04*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
97 {DEVICE_NVIDIA_NV4_RIVA_TNT,NV_ARCH_04},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
98 {DEVICE_NVIDIA_NV5_RIVA_TNT2_TNT2,NV_ARCH_04},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
99 {DEVICE_NVIDIA_NV5_RIVA_TNT2,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
100 {DEVICE_NVIDIA_NV5_RIVA_TNT22,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
101 {DEVICE_NVIDIA_NV5_RIVA_TNT23,NV_ARCH_04},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
102 {DEVICE_NVIDIA_NV6_VANTA_VANTA_LT,NV_ARCH_04},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
103 {DEVICE_NVIDIA_NV5M64_RIVA_TNT2,NV_ARCH_04},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
104 {DEVICE_NVIDIA_NV6_VANTA,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
105 {DEVICE_NVIDIA_NV6_VANTA2,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
106 {DEVICE_NVIDIA2_TNT,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
107 {DEVICE_NVIDIA2_TNT2,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
108 {DEVICE_NVIDIA2_VTNT2,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
109 {DEVICE_NVIDIA2_UTNT2 ,NV_ARCH_04},
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
110 {DEVICE_NVIDIA2_ITNT2,NV_ARCH_04},
22954
b9bd992d5d4c this TnT2 chipset is actually NV4/5 arch but for sure not NV30
ben
parents: 22905
diff changeset
111 {DEVICE_NVIDIA_NV5_ALADDIN_TNT2,NV_ARCH_04},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
112 /*NV10*/
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
113 {DEVICE_NVIDIA_NV18_GEFORCE_PCX,NV_ARCH_10},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
114 {DEVICE_NVIDIA_NV10_GEFORCE_256,NV_ARCH_10},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
115 {DEVICE_NVIDIA_NV10DDR_GEFORCE_256,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
116 {DEVICE_NVIDIA_NV10GL_QUADRO,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
117 {DEVICE_NVIDIA_NV11_GEFORCE2_MX_MX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
118 {DEVICE_NVIDIA_NV11DDR_GEFORCE2_MX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
119 {DEVICE_NVIDIA_NV11_GEFORCE2_GO,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
120 {DEVICE_NVIDIA_NV11GL_QUADRO2_MXR_EX_GO,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
121 {DEVICE_NVIDIA_NV15_GEFORCE2_GTS_PRO,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
122 {DEVICE_NVIDIA_NV15DDR_GEFORCE2_TI,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
123 {DEVICE_NVIDIA_NV15BR_GEFORCE2_ULTRA,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
124 {DEVICE_NVIDIA_NV15GL_QUADRO2_PRO,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
125 {DEVICE_NVIDIA_NV17_GEFORCE4_MX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
126 {DEVICE_NVIDIA_NV17_GEFORCE4_MX2,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
127 {DEVICE_NVIDIA_NV17_GEFORCE4_MX3,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
128 {DEVICE_NVIDIA_NV17_GEFORCE4_MX4,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
129 {DEVICE_NVIDIA_NV17_GEFORCE4_440,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
130 {DEVICE_NVIDIA_NV17_GEFORCE4_420,NV_ARCH_10},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
131 {DEVICE_NVIDIA_NV17_GEFORCE4_4202,NV_ARCH_10},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
132 {DEVICE_NVIDIA_NV17_GEFORCE4_460,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
133 {DEVICE_NVIDIA_NV17GL_QUADRO4_550,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
134 {DEVICE_NVIDIA_NV17_GEFORCE4_4203,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
135 {DEVICE_NVIDIA_NV17GL_QUADRO4_200_400,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
136 {DEVICE_NVIDIA_NV17GL_QUADRO4_5502,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
137 {DEVICE_NVIDIA_NV17GL_QUADRO4_550,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
138 {DEVICE_NVIDIA_NV17_GEFORCE4_410,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
139 {DEVICE_NVIDIA_NV18_GEFORCE4_MX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
140 {DEVICE_NVIDIA_NV18_GEFORCE4_MX2,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
141 {DEVICE_NVIDIA_NV18_GEFORCE4_MX3,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
142 {DEVICE_NVIDIA_NV18_GEFORCE4_MX4,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
143 {DEVICE_NVIDIA_NV18_GEFORCE4_MX5,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
144 {DEVICE_NVIDIA_NV18M_GEFORCE4_448,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
145 {DEVICE_NVIDIA_NV18M_GEFORCE4_488,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
146 {DEVICE_NVIDIA_NV18GL_QUADRO_FX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
147 {DEVICE_NVIDIA_NV18GL_QUADRO4_580,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
148 {DEVICE_NVIDIA_NV18GL_QUADRO4_NVS,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
149 {DEVICE_NVIDIA_NV18GL_QUADRO4_380,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
150 {DEVICE_NVIDIA_NV18M_GEFORCE4_4482,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
151 {DEVICE_NVIDIA_NVCRUSH11_GEFORCE2_MX,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
152 {DEVICE_NVIDIA_NV18_GEFORCE4_MX5,NV_ARCH_10},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
153 {DEVICE_NVIDIA_NV18_GEFORCE_PCX,NV_ARCH_10},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
154 /*NV20*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
155 {DEVICE_NVIDIA_NV20_GEFORCE3,NV_ARCH_20},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
156 {DEVICE_NVIDIA_NV20_GEFORCE3_TI,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
157 {DEVICE_NVIDIA_NV20_GEFORCE3_TI2,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
158 {DEVICE_NVIDIA_NV20DCC_QUADRO_DCC,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
159 {DEVICE_NVIDIA_NV25_GEFORCE4_TI,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
160 {DEVICE_NVIDIA_NV25_GEFORCE4_TI2,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
161 {DEVICE_NVIDIA_NV25_GEFORCE4_TI3,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
162 {DEVICE_NVIDIA_NV25_GEFORCE4_TI4,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
163 {DEVICE_NVIDIA_NV25GL_QUADRO4_900,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
164 {DEVICE_NVIDIA_NV25GL_QUADRO4_750,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
165 {DEVICE_NVIDIA_NV25GL_QUADRO4_700,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
166 {DEVICE_NVIDIA_NV28_GEFORCE4_TI,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
167 {DEVICE_NVIDIA_NV28_GEFORCE4_TI2,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
168 {DEVICE_NVIDIA_NV28_GEFORCE4_TI3,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
169 {DEVICE_NVIDIA_NV28_GEFORCE4_TI4,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
170 {DEVICE_NVIDIA_NV28GL_QUADRO4_980,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
171 {DEVICE_NVIDIA_NV28GL_QUADRO4_780,NV_ARCH_20},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
172 {DEVICE_NVIDIA_NV28GLM_QUADRO4_700,NV_ARCH_20},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
173 /*NV30*/
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
174 {DEVICE_NVIDIA_NV30_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
175 {DEVICE_NVIDIA_NV30_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
176 {DEVICE_NVIDIA_NV30_GEFORCE_FX3,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
177 {DEVICE_NVIDIA_NV30GL_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
178 {DEVICE_NVIDIA_NV30GL_QUADRO_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
179 {DEVICE_NVIDIA_NV31_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
180 {DEVICE_NVIDIA_NV31_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
181 {DEVICE_NVIDIA_NV31,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
182 {DEVICE_NVIDIA_NV31_GEFORCE_FX3,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
183 {DEVICE_NVIDIA_NV31M,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
184 {DEVICE_NVIDIA_NV31M_PRO,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
185 {DEVICE_NVIDIA_NV31M_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
186 {DEVICE_NVIDIA_NV31M_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
187 {DEVICE_NVIDIA_NVIDIA_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
188 {DEVICE_NVIDIA_NV31GLM,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
189 {DEVICE_NVIDIA_NV31GLM_PRO,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
190 {DEVICE_NVIDIA_NV31GLM_PRO2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
191 {DEVICE_NVIDIA_NV34_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
192 {DEVICE_NVIDIA_NV34_GEFORCE_FX2,NV_ARCH_30},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
193 {DEVICE_NVIDIA_NV34_GEFORCE_FX3,NV_ARCH_30},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
194 {DEVICE_NVIDIA_NV34_GEFORCE_FX4,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
195 {DEVICE_NVIDIA_NV34M_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
196 {DEVICE_NVIDIA_NV34M_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
197 {DEVICE_NVIDIA_NV34_GEFORCE_FX5,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
198 {DEVICE_NVIDIA_NV34_GEFORCE_FX6,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
199 {DEVICE_NVIDIA_NV34M_GEFORCE_FX3,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
200 {DEVICE_NVIDIA_NV34M_GEFORCE_FX4,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
201 {DEVICE_NVIDIA_NV34GL_QUADRO_NVS,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
202 {DEVICE_NVIDIA_NV34GL_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
203 {DEVICE_NVIDIA_NV34GLM_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
204 {DEVICE_NVIDIA_NV34_GEFORCE_FX7,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
205 {DEVICE_NVIDIA_NV34GL,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
206 {DEVICE_NVIDIA_NV35_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
207 {DEVICE_NVIDIA_NV35_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
208 {DEVICE_NVIDIA_NV35_GEFORCE_FX3,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
209 {DEVICE_NVIDIA_NV38_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
210 {DEVICE_NVIDIA_NV35_GEFORCE_FX4,NV_ARCH_30},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
211 {DEVICE_NVIDIA_NV35GL_QUADRO_FX,NV_ARCH_30},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
212 {DEVICE_NVIDIA_NV35GL_QUADRO_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
213 {DEVICE_NVIDIA_NV35_GEFORCE_PCX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
214 {DEVICE_NVIDIA_NV36_1_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
215 {DEVICE_NVIDIA_NV36_2_GEFORCE_FX,NV_ARCH_30},
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
216 {DEVICE_NVIDIA_NV36_GEFORCE_FX,NV_ARCH_30},
22874
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
217 {DEVICE_NVIDIA_NV36_4_GEFORCE_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
218 {DEVICE_NVIDIA_NV36_5,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
219 {DEVICE_NVIDIA_NV36_GEFORCE_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
220 {DEVICE_NVIDIA_NV36_GEFORCE_FX3,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
221 {DEVICE_NVIDIA_NV36_GEFORCE_PCX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
222 {DEVICE_NVIDIA_NV36M_PRO,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
223 {DEVICE_NVIDIA_NV36MAP,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
224 {DEVICE_NVIDIA_NV36_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
225 {DEVICE_NVIDIA_NV36GL_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
226 {DEVICE_NVIDIA_NV36GL,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
227 {DEVICE_NVIDIA_NV36_GEFORCE_PCX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
228 {DEVICE_NVIDIA_NV35_GEFORCE_PCX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
229 {DEVICE_NVIDIA_NV37GL_QUADRO_FX,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
230 {DEVICE_NVIDIA_NV37GL_QUADRO_FX2,NV_ARCH_30},
9a8f6901e888 updated pci ids list, fixed vidix drivers compilation and added nearly exhaustive pci ids for nvidia driver
ben
parents: 22858
diff changeset
231 {DEVICE_NVIDIA_NV38GL_QUADRO_FX,NV_ARCH_30},
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
232 /* NV40: GeForce 6x00 to 7x00 */
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
233 {DEVICE_NVIDIA_NV40_GEFORCE_6800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
234 {DEVICE_NVIDIA_NV40_GEFORCE_68002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
235 {DEVICE_NVIDIA_NV40_2_GEFORCE_6800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
236 {DEVICE_NVIDIA_NV40_3,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
237 {DEVICE_NVIDIA_NV40_GEFORCE_68003,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
238 {DEVICE_NVIDIA_NV40_GEFORCE_68004,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
239 {DEVICE_NVIDIA_NV40_GEFORCE_68005,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
240 {DEVICE_NVIDIA_NV40_GEFORCE_68006,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
241 {DEVICE_NVIDIA_NV40_GEFORCE_68007,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
242 {DEVICE_NVIDIA_NV40_GEFORCE_68008,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
243 {DEVICE_NVIDIA_NV40_GEFORCE_68009,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
244 {DEVICE_NVIDIA_NV40_GEFORCE_680010,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
245 {DEVICE_NVIDIA_NV40_GEFORCE_680011,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
246 {DEVICE_NVIDIA_NV40_GEFORCE_680012,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
247 {DEVICE_NVIDIA_NV40_GEFORCE_68008,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
248 {DEVICE_NVIDIA_NV40GL,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
249 {DEVICE_NVIDIA_NV40GL_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
250 {DEVICE_NVIDIA_NV40GL_QUADRO_FX2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
251 {DEVICE_NVIDIA_NV41_GEFORCE_6800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
252 {DEVICE_NVIDIA_NV41_1_GEFORCE_6800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
253 {DEVICE_NVIDIA_NV41_2_GEFORCE_6800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
254 {DEVICE_NVIDIA_NV41_8_GEFORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
255 {DEVICE_NVIDIA_NV41_9_GEFORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
256 {DEVICE_NVIDIA_NV41_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
257 {DEVICE_NVIDIA_NV41_QUADRO_FX2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
258 {DEVICE_NVIDIA_NV41GL_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
259 {DEVICE_NVIDIA_NV40_GEFORCE_6800_GEFORCE,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
260 {DEVICE_NVIDIA_NV43_GEFORCE_6600_GEFORCE,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
261 {DEVICE_NVIDIA_NV43_GEFORCE_6600_GEFORCE2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
262 {DEVICE_NVIDIA_NV43_GEFORCE_6200,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
263 {DEVICE_NVIDIA_NV43_GEFORCE_62002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
264 {DEVICE_NVIDIA_NV43_GEFORCE_6600,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
265 {DEVICE_NVIDIA_NV43_GEFORCE_66002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
266 {DEVICE_NVIDIA_NV43_GEFORCE_66003,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
267 {DEVICE_NVIDIA_NV43_GEFORCE_66004,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
268 {DEVICE_NVIDIA_NV43_GEFORCE_66005,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
269 {DEVICE_NVIDIA_NV43_GEFORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
270 {DEVICE_NVIDIA_NV43_GEFORCE_GO2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
271 {DEVICE_NVIDIA_NV43_GEFORCE_GO3,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
272 {DEVICE_NVIDIA_NV43_GEFORCE_GO4,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
273 {DEVICE_NVIDIA_NV43_GEFORCE_GO5,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
274 {DEVICE_NVIDIA_NV43_GEFORCE_GO6,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
275 {DEVICE_NVIDIA_NV43_GEFORCE_6610,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
276 {DEVICE_NVIDIA_NV43GL_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
277 {DEVICE_NVIDIA_GEFORCE_6100_NFORCE,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
278 {DEVICE_NVIDIA_GEFORCE_6100_NFORCE2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
279 {DEVICE_NVIDIA_GEFORCE_6100_NFORCE3,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
280 {DEVICE_NVIDIA_GEFORCE_6100_NFORCE4,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
281 {DEVICE_NVIDIA_C51G_GEFORCE_6100,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
282 {DEVICE_NVIDIA_C51PV_GEFORCE_6150,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
283 {DEVICE_NVIDIA_NV44_GEFORCE_6200,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
284 {DEVICE_NVIDIA_NV44_GEFORCE_62002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
285 {DEVICE_NVIDIA_NV44_GEFORCE_62003,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
286 {DEVICE_NVIDIA_NV44_GEFORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
287 {DEVICE_NVIDIA_NV44_QUADRO_NVS,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
288 {DEVICE_NVIDIA_GEFORCE_GO_6200,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
289 {DEVICE_NVIDIA_NV44A_GEFORCE_6200,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
290 {DEVICE_NVIDIA_NV45GL_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
291 {DEVICE_NVIDIA_GEFORCE_GO_7200,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
292 {DEVICE_NVIDIA_QUADRO_NVS_110M,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
293 {DEVICE_NVIDIA_GEFORCE_GO_7400,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
294 {DEVICE_NVIDIA_QUADRO_NVS_110M2,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
295 {DEVICE_NVIDIA_QUADRO_FX_350,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
296 {DEVICE_NVIDIA_G70_GEFORCE_7300,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
297 {DEVICE_NVIDIA_GEFORCE_7300_GS,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
298 {DEVICE_NVIDIA_G70_GEFORCE_7600,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
299 {DEVICE_NVIDIA_G70_GEFORCE_76002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
300 {DEVICE_NVIDIA_GEFORCE_7600_GS,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
301 {DEVICE_NVIDIA_G70_GEFORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
302 {DEVICE_NVIDIA_QUADRO_FX_560,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
303 {DEVICE_NVIDIA_G70_GEFORCE_7800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
304 {DEVICE_NVIDIA_G70_GEFORCE_78002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
305 {DEVICE_NVIDIA_G70_GEFORCE_78003,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
306 {DEVICE_NVIDIA_G70_GEFORCE_78004,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
307 {DEVICE_NVIDIA_G70_GEFORCE_78005,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
308 {DEVICE_NVIDIA_GEFORCE_GO_7800,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
309 {DEVICE_NVIDIA_GEFORCE_7900_GTX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
310 {DEVICE_NVIDIA_GEFORCE_7900_GT,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
311 {DEVICE_NVIDIA_GEFORCE_7900_GS,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
312 {DEVICE_NVIDIA_GEFORCE_GO_7900,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
313 {DEVICE_NVIDIA_GEFORCE_GO_79002,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
314 {DEVICE_NVIDIA_GE_FORCE_GO,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
315 {DEVICE_NVIDIA_G70GL_QUADRO_FX4500,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
316 {DEVICE_NVIDIA_G71_QUADRO_FX,NV_ARCH_40},
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
317 {DEVICE_NVIDIA_G71_QUADRO_FX2,NV_ARCH_40}
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
318 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
319
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
320
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
321 static int find_chip(unsigned chip_id){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
322 unsigned i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
323 for(i = 0;i < sizeof(nvidia_card_ids)/sizeof(struct nvidia_cards);i++)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
324 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
325 if(chip_id == nvidia_card_ids[i].chip_id)return i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
326 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
327 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
328 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
329
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
330 static int nv_probe(int verbose, int force){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
331 pciinfo_t lst[MAX_PCI_DEVICES];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
332 unsigned i,num_pci;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
333 int err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
334
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
335 if (force)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
336 printf("[nvidia_vid]: warning: forcing not supported yet!\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
337 err = pci_scan(lst,&num_pci);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
338 if(err){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
339 printf("[nvidia_vid] Error occurred during pci scan: %s\n",strerror(err));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
340 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
341 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
342 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
343 err = ENXIO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
344 for(i=0; i < num_pci; i++){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
345 if(lst[i].vendor == VENDOR_NVIDIA2 || lst[i].vendor == VENDOR_NVIDIA){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
346 int idx;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
347 const char *dname;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
348 idx = find_chip(lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
349 if(idx == -1)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
350 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
351 dname = pci_device_name(lst[i].vendor, lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
352 dname = dname ? dname : "Unknown chip";
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
353 printf("[nvidia_vid] Found chip: %s\n", dname);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
354 if ((lst[i].command & PCI_COMMAND_IO) == 0){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
355 printf("[nvidia_vid] Device is disabled, ignoring\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
356 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
357 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
358 nvidia_cap.device_id = lst[i].device;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
359 err = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
360 memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
361 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
362 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
363 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
364 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
365 if(err && verbose) printf("[nvidia_vid] Can't find chip\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
366 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
367 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
368
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
369
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
370
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
371
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
372 /*
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
373 * PCI-Memory IO access macros.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
374 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
375
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
376 #define MEM_BARRIER() __asm__ __volatile__ ("" : : : "memory")
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
377
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
378 #undef VID_WR08
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
379 #define VID_WR08(p,i,val) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]=(val); })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
380 #undef VID_RD08
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
381 #define VID_RD08(p,i) ({ MEM_BARRIER(); ((uint8_t *)(p))[(i)]; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
382
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
383 #undef VID_WR32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
384 #define VID_WR32(p,i,val) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]=val; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
385 #undef VID_RD32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
386 #define VID_RD32(p,i) ({ MEM_BARRIER(); ((uint32_t *)(p))[(i)/4]; })
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
387
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
388 #define VID_AND32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)&(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
389 #define VID_OR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)|(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
390 #define VID_XOR32(p,i,val) VID_WR32(p,i,VID_RD32(p,i)^(val))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
391
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
392
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
393
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
394
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
395
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
396
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
397 struct rivatv_chip {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
398 volatile uint32_t *PMC; /* general control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
399 volatile uint32_t *PME; /* multimedia port */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
400 volatile uint32_t *PFB; /* framebuffer control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
401 volatile uint32_t *PVIDEO; /* overlay control */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
402 volatile uint8_t *PCIO; /* SVGA (CRTC, ATTR) registers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
403 volatile uint8_t *PVIO; /* SVGA (MISC, GRAPH, SEQ) registers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
404 volatile uint32_t *PRAMIN; /* instance memory */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
405 volatile uint32_t *PRAMHT; /* hash table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
406 volatile uint32_t *PRAMFC; /* fifo context table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
407 volatile uint32_t *PRAMRO; /* fifo runout table */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
408 volatile uint32_t *PFIFO; /* fifo control region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
409 volatile uint32_t *FIFO; /* fifo channels (USER) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
410 volatile uint32_t *PGRAPH; /* graphics engine */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
411
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
412 unsigned long fbsize; /* framebuffer size */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
413 int arch; /* compatible NV_ARCH_XX define */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
414 int realarch; /* real architecture */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
415 void (* lock) (struct rivatv_chip *, int);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
416 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
417 typedef struct rivatv_chip rivatv_chip;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
418
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
419
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
420 struct rivatv_info {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
421 unsigned int use_colorkey;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
422 unsigned int colorkey; /* saved xv colorkey*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
423 unsigned int vidixcolorkey; /*currently used colorkey*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
424 unsigned int depth;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
425 unsigned int format;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
426 unsigned int pitch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
427 unsigned int width,height;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
428 unsigned int d_width,d_height; /*scaled width && height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
429 unsigned int wx,wy; /*window x && y*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
430 unsigned int screen_x; /*screen width*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
431 unsigned int screen_y; /*screen height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
432 unsigned long buffer_size; /* size of the image buffer */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
433 struct rivatv_chip chip; /* NV architecture structure */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
434 void* video_base; /* virtual address of control region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
435 void* control_base; /* virtual address of fb region */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
436 void* picture_base; /* direct pointer to video picture */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
437 unsigned long picture_offset; /* offset of video picture in frame buffer */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
438 // struct rivatv_dma dma; /* DMA structure */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
439 unsigned int cur_frame;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
440 unsigned int num_frames; /* number of buffers */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
441 int bps; /* bytes per line */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
442 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
443 typedef struct rivatv_info rivatv_info;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
444
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
445 uint8_t nvReadVGA (struct rivatv_chip *chip, int index) {
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
446 VID_WR08 (chip->PCIO, 0x3D4, index);
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
447 return VID_RD08 (chip->PCIO, 0x3D5);
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
448 }
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
449
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
450 void nvWriteVGA (struct rivatv_chip *chip, int index, int data) {
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
451 VID_WR08 (chip->PCIO, 0x3D4, index);
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
452 VID_WR08 (chip->PCIO, 0x3D5, data);
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
453 }
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
454
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
455 //framebuffer size funcs
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
456 static unsigned long rivatv_fbsize_nv03 (struct rivatv_chip *chip){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
457 if (VID_RD32 (chip->PFB, 0) & 0x00000020) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
458 if (((VID_RD32 (chip->PMC, 0) & 0xF0) == 0x20)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
459 && ((VID_RD32 (chip->PMC, 0) & 0x0F) >= 0x02)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
460 /* SDRAM 128 ZX. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
461 return ((1 << (VID_RD32 (chip->PFB, 0) & 0x03)) * 1024 * 1024);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
462 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
463 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
464 return 1024 * 1024 * 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
465 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
466 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
467 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
468 /* SGRAM 128. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
469 switch (VID_RD32(chip->PFB, 0) & 0x00000003) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
470 case 0:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
471 return 1024 * 1024 * 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
472 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
473 case 2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
474 return 1024 * 1024 * 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
475 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
476 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
477 return 1024 * 1024 * 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
478 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
479 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
480 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
481 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
482 static unsigned long rivatv_fbsize_nv04 (struct rivatv_chip *chip){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
483 if (VID_RD32 (chip->PFB, 0) & 0x00000100) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
484 return ((VID_RD32 (chip->PFB, 0) >> 12) & 0x0F) * 1024 * 1024 * 2
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
485 + 1024 * 1024 * 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
486 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
487 switch (VID_RD32 (chip->PFB, 0) & 0x00000003) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
488 case 0:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
489 return 1024 * 1024 * 32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
490 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
491 case 1:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
492 return 1024 * 1024 * 4;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
493 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
494 case 2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
495 return 1024 * 1024 * 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
496 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
497 case 3:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
498 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
499 return 1024 * 1024 * 16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
500 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
501 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
502 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
503 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
504
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
505 static unsigned long rivatv_fbsize_nv10 (struct rivatv_chip *chip){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
506 return VID_RD32 (chip->PFB, 0x20C) & 0xFFF00000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
507 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
508
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
509 //lock funcs
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
510 static void rivatv_lock_nv03 (struct rivatv_chip *chip, int LockUnlock){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
511 VID_WR08 (chip->PVIO, 0x3C4, 0x06);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
512 VID_WR08 (chip->PVIO, 0x3C5, LockUnlock ? 0x99 : 0x57);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
513 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
514
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
515 static void rivatv_lock_nv04 (struct rivatv_chip *chip, int LockUnlock){
24565
a5255ffdcfaf rivatv_lock_nv04 is actually an extended version of rivatv_lock_nv03 (patch by Guillaume LECERF <foxcore at gmail.com>)
faust3
parents: 24547
diff changeset
516 rivatv_lock_nv03 (chip, LockUnlock);
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
517 nvWriteVGA (chip, 0x1F, LockUnlock ? 0x99 : 0x57);
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
518 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
519
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
520
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
521
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
522
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
523 /* Enable PFB (Framebuffer), PVIDEO (Overlay unit) and PME (Mediaport) if neccessary. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
524 static void rivatv_enable_PMEDIA (struct rivatv_info *info){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
525 uint32_t reg;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
526
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
527 /* switch off interrupts once for a while */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
528 // VID_WR32 (info->chip.PME, 0x200140, 0x00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
529 // VID_WR32 (info->chip.PMC, 0x000140, 0x00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
530
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
531 reg = VID_RD32 (info->chip.PMC, 0x000200);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
532
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
533 /* NV3 (0x10100010): NV03_PMC_ENABLE_PMEDIA, NV03_PMC_ENABLE_PFB, NV03_PMC_ENABLE_PVIDEO */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
534
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
535 if ((reg & 0x10100010) != 0x10100010) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
536 printf("PVIDEO and PFB disabled, enabling...\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
537 VID_OR32 (info->chip.PMC, 0x000200, 0x10100010);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
538 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
539
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
540 /* save the current colorkey */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
541 switch (info->chip.arch ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
542 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
543 case NV_ARCH_20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
544 case NV_ARCH_30:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
545 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
546 /* NV_PVIDEO_COLOR_KEY */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
547 info->colorkey = VID_RD32 (info->chip.PVIDEO, 0xB00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
548 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
549 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
550 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
551 /* NV_PVIDEO_KEY */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
552 info->colorkey = VID_RD32 (info->chip.PVIDEO, 0x240);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
553 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
554 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
555
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
556
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
557 /* re-enable interrupts again */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
558 // VID_WR32 (info->chip.PMC, 0x000140, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
559 // VID_WR32 (info->chip.PME, 0x200140, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
560 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
561
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
562 /* Stop overlay video. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
563 static void rivatv_overlay_stop (struct rivatv_info *info) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
564 switch (info->chip.arch ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
565 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
566 case NV_ARCH_20:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
567 case NV_ARCH_30:
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
568 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
569 /* NV_PVIDEO_COLOR_KEY */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
570 /* Xv-Extension-Hack: Restore previously saved value. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
571 VID_WR32 (info->chip.PVIDEO, 0xB00, info->colorkey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
572 /* NV_PVIDEO_STOP */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
573 VID_OR32 (info->chip.PVIDEO, 0x704, 0x11);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
574 /* NV_PVIDEO_BUFFER */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
575 VID_AND32 (info->chip.PVIDEO, 0x700, ~0x11);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
576 /* NV_PVIDEO_INTR_EN_BUFFER */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
577 // VID_AND32 (info->chip.PVIDEO, 0x140, ~0x11);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
578 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
579 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
580 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
581 /* NV_PVIDEO_KEY */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
582 VID_WR32 (info->chip.PVIDEO, 0x240, info->colorkey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
583 /* NV_PVIDEO_OVERLAY_VIDEO_OFF */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
584 VID_AND32 (info->chip.PVIDEO, 0x244, ~0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
585 /* NV_PVIDEO_INTR_EN_0_NOTIFY */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
586 // VID_AND32 (info->chip.PVIDEO, 0x140, ~0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
587 /* NV_PVIDEO_OE_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
588 VID_WR32 (info->chip.PVIDEO, 0x224, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
589 /* NV_PVIDEO_SU_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
590 VID_WR32 (info->chip.PVIDEO, 0x228, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
591 /* NV_PVIDEO_RM_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
592 VID_WR32 (info->chip.PVIDEO, 0x22C, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
593 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
594 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
595 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
596
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
597 /* Get pan offset of the physical screen. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
598 static uint32_t rivatv_overlay_pan (struct rivatv_info *info){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
599 uint32_t pan;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
600 info->chip.lock (&info->chip, 0);
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
601 pan = nvReadVGA (&info->chip, 0x0D);
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
602 pan |= nvReadVGA (&info->chip, 0x0C) << 8;
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
603 pan |= (nvReadVGA (&info->chip, 0x19) & 0x1F) << 16;
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
604 pan |= (nvReadVGA (&info->chip, 0x2D) & 0x60) << 16;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
605 return pan << 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
606 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
607
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
608 /* Compute and set colorkey depending on the colour depth. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
609 static void rivatv_overlay_colorkey (rivatv_info* info, unsigned int chromakey){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
610 uint32_t r, g, b, key = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
611
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
612 r = (chromakey & 0x00FF0000) >> 16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
613 g = (chromakey & 0x0000FF00) >> 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
614 b = chromakey & 0x000000FF;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
615 switch (info->depth) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
616 case 15:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
617 key = ((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
618 #ifndef WIN32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
619 key = key | 0x00008000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
620 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
621 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
622 case 16: // XXX unchecked
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
623 key = ((r >> 3) << 11) | ((g >> 2) << 5) | ((b >> 3));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
624 #ifndef WIN32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
625 key = key | 0x00008000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
626 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
627 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
628 case 24: // XXX unchecked, maybe swap order of masking - FIXME Can the card be in 24 bit mode anyway?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
629 key = (chromakey & 0x00FFFFFF) | 0x00800000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
630 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
631 case 32:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
632 key = chromakey;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
633 #ifndef WIN32
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
634 key = key | 0x80000000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
635 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
636 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
637 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
638 //printf("[nvidia_vid] depth=%d %08X \n", info->depth, chromakey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
639 switch (info->chip.arch) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
640 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
641 case NV_ARCH_20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
642 case NV_ARCH_30:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
643 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
644 VID_WR32 (info->chip.PVIDEO, 0xB00, key);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
645 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
646 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
647 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
648 VID_WR32 (info->chip.PVIDEO, 0x240, key);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
649 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
650 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
651 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
652
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
653 static void nv_getscreenproperties(struct rivatv_info *info){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
654 uint32_t bpp=0,x;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
655 info->chip.lock(&info->chip, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
656 /*get screen depth*/
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
657 bpp = nvReadVGA (&info->chip, 0x28) & 0x3;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
658 if((bpp == 2) && (VID_RD32(info->chip.PVIDEO,0x600) & 0x00001000) == 0x0)info->depth=15;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
659 else info->depth = 0x04 << bpp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
660 /*get screen width*/
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
661 info->screen_x = nvReadVGA (&info->chip, 0x1);
24516
610500ad2e6c fix screen width and height calculation on nvidia vidix (patch by Guillaume Lecerf (fox at geexbox dot org)
ben
parents: 23922
diff changeset
662 /* NV_PCRTC_HORIZ_EXTRA_DISPLAY_END_8 */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
663 info->screen_x |= (nvReadVGA (&info->chip, 0x2D) & 0x02) << 7;
24516
610500ad2e6c fix screen width and height calculation on nvidia vidix (patch by Guillaume Lecerf (fox at geexbox dot org)
ben
parents: 23922
diff changeset
664 info->screen_x = (info->screen_x + 1) << 3;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
665 /*get screen height*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
666 /* get first 8 bits in VT_DISPLAY_END*/
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
667 info->screen_y = nvReadVGA (&info->chip, 0x12);
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
668 /* get 9th bit in CRTC_OVERFLOW*/
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
669 info->screen_y |= (nvReadVGA (&info->chip, 0x07) & 0x02) << 7;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
670 /* and the 10th in CRTC_OVERFLOW*/
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
671 info->screen_y |= (nvReadVGA (&info->chip, 0x07) & 0x40) << 3;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
672 ++info->screen_y;
24537
104e3dafa1ad fix resolution detection for NV03 and NV04 cards, patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24517
diff changeset
673
104e3dafa1ad fix resolution detection for NV03 and NV04 cards, patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24517
diff changeset
674 if(info->chip.arch >= NV_ARCH_10){
24547
cb6afcd110a9 fix indentation after the last change (patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24537
diff changeset
675 /* NV_PCRTC_EXTRA_VERT_DISPLAY_END_10 */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
676 info->screen_y |= (nvReadVGA (&info->chip, 0x25) & 0x02) << 9;
24547
cb6afcd110a9 fix indentation after the last change (patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24537
diff changeset
677 /* NV_PCRTC_???_VERT_DISPLAY_END_11 */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
678 info->screen_y |= (nvReadVGA (&info->chip, 0x41) & 0x04) << 9;
24537
104e3dafa1ad fix resolution detection for NV03 and NV04 cards, patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24517
diff changeset
679 }
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
680
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
681 /* NV_PCRTC_OFFSET */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
682 x = nvReadVGA (&info->chip, 0x13);
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
683 /* NV_PCRTC_REPAINT0_OFFSET_10_8 */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
684 x |= (nvReadVGA (&info->chip, 0x19) & 0xE0) << 3;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
685 /* NV_PCRTC_EXTRA_OFFSET_11 */
24574
f89d135bcae0 add functions for the vga register access patch by Guillaume LECERF <foxcore at gmail.com>
faust3
parents: 24568
diff changeset
686 x |= (nvReadVGA (&info->chip, 0x25) & 0x20) << 6; x <<= 3;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
687 info->bps = x * bpp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
688 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
689
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
690
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
691
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
692
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
693 /* Start overlay video. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
694 static void rivatv_overlay_start (struct rivatv_info *info,int bufno){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
695 uint32_t base, size, offset, xscale, yscale, pan;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
696 uint32_t value;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
697 int x=info->wx, y=info->wy;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
698 int lwidth=info->d_width, lheight=info->d_height;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
699
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
700 size = info->buffer_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
701 base = info->picture_offset;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
702 offset = bufno*size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
703 /*update depth & dimensions here because it may change with vo vesa or vo fbdev*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
704 nv_getscreenproperties(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
705
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
706 if(info->depth){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
707 /* get pan offset of the physical screen */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
708 pan = rivatv_overlay_pan (info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
709 /* adjust window position depending on the pan offset */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
710 if (info->bps != 0)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
711 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
712 x = info->wx - (pan % info->bps) * 8 / info->depth;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
713 y = info->wy - (pan / info->bps);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
714 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
715 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
716 // we can't adjust the window position correctly in textmode
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
717 // setting y to 8 seems to work ok, though
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
718 if(info->chip.arch < NV_ARCH_10 && y < 8) y = 8;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
719 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
720
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
721 /* adjust negative output window variables */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
722 if (x < 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
723 lwidth = info->d_width + x;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
724 offset += (-x * info->width / info->d_width) << 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
725 // offset += (-window->x * port->vld_width / window->width) << 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
726 x = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
727 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
728 if (y < 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
729 lheight = info->d_height + y;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
730 offset += (-y * info->height / info->d_height * info->width) << 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
731 // offset += (-window->y * port->vld_height / window->height * port->org_width) << 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
732 y = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
733 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
734
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
735 switch (info->chip.arch) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
736 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
737 case NV_ARCH_20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
738 case NV_ARCH_30:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
739 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
740
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
741 /* NV_PVIDEO_BASE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
742 VID_WR32 (info->chip.PVIDEO, 0x900 + 0, base + offset);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
743 //VID_WR32 (info->chip.PVIDEO, 0x900 + 4, base);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
744 /* NV_PVIDEO_LIMIT */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
745 VID_WR32 (info->chip.PVIDEO, 0x908 + 0, base + offset + size - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
746 //VID_WR32 (info->chip.PVIDEO, 0x908 + 4, base + size - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
747
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
748 /* extra code for NV20 && NV30 architectures */
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
749 if (info->chip.arch == NV_ARCH_20 || info->chip.arch == NV_ARCH_30 || info->chip.arch == NV_ARCH_40) {
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
750 VID_WR32 (info->chip.PVIDEO, 0x800 + 0, base + offset);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
751 //VID_WR32 (info->chip.PVIDEO, 0x800 + 4, base);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
752 VID_WR32 (info->chip.PVIDEO, 0x808 + 0, base + offset + size - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
753 //VID_WR32 (info->chip.PVIDEO, 0x808 + 4, base + size - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
754 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
755
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
756 /* NV_PVIDEO_LUMINANCE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
757 VID_WR32 (info->chip.PVIDEO, 0x910 + 0, eq.lum);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
758 //VID_WR32 (info->chip.PVIDEO, 0x910 + 4, 0x00001000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
759 /* NV_PVIDEO_CHROMINANCE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
760 VID_WR32 (info->chip.PVIDEO, 0x918 + 0, eq.chrom);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
761 //VID_WR32 (info->chip.PVIDEO, 0x918 + 4, 0x00001000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
762
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
763 /* NV_PVIDEO_OFFSET */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
764 VID_WR32 (info->chip.PVIDEO, 0x920 + 0, 0x0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
765 //VID_WR32 (info->chip.PVIDEO, 0x920 + 4, offset + pitch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
766 /* NV_PVIDEO_SIZE_IN */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
767 VID_WR32 (info->chip.PVIDEO, 0x928 + 0, ((info->height) << 16) | info->width);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
768 //VID_WR32 (info->chip.PVIDEO, 0x928 + 4, ((port->org_height/2) << 16) | port->org_width);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
769 /* NV_PVIDEO_POINT_IN */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
770 VID_WR32 (info->chip.PVIDEO, 0x930 + 0, 0x00000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
771 //VID_WR32 (info->chip.PVIDEO, 0x930 + 4, 0x00000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
772 /* NV_PVIDEO_DS_DX_RATIO */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
773 VID_WR32 (info->chip.PVIDEO, 0x938 + 0, (info->width << 20) / info->d_width);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
774 //VID_WR32 (info->chip.PVIDEO, 0x938 + 4, (port->org_width << 20) / window->width);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
775 /* NV_PVIDEO_DT_DY_RATIO */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
776 VID_WR32 (info->chip.PVIDEO, 0x940 + 0, ((info->height) << 20) / info->d_height);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
777 //VID_WR32 (info->chip.PVIDEO, 0x940 + 4, ((port->org_height/2) << 20) / window->height);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
778
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
779 /* NV_PVIDEO_POINT_OUT */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
780 VID_WR32 (info->chip.PVIDEO, 0x948 + 0, ((y + 0) << 16) | x);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
781 //VID_WR32 (info->chip.PVIDEO, 0x948 + 4, ((y + 0) << 16) | x);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
782 /* NV_PVIDEO_SIZE_OUT */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
783 VID_WR32 (info->chip.PVIDEO, 0x950 + 0, (lheight << 16) | lwidth);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
784 //VID_WR32 (info->chip.PVIDEO, 0x950 + 4, (height << 16) | width);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
785
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
786 /* NV_PVIDEO_FORMAT */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
787 value = info->pitch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
788 if(info->use_colorkey)value |= 1 << 20;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
789 if(info->format == IMGFMT_YUY2)value |= 1 << 16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
790 VID_WR32 (info->chip.PVIDEO, 0x958 + 0, value);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
791 //VID_WR32 (info->chip.PVIDEO, 0x958 + 4, (pitch << 1) | 0x00100000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
792
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
793 /* NV_PVIDEO_INTR_EN_BUFFER */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
794 // VID_OR32 (info->chip.PVIDEO, 0x140, 0x01/*0x11*/);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
795 /* NV_PVIDEO_STOP */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
796 VID_WR32 (info->chip.PVIDEO, 0x704,0x0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
797 /* NV_PVIDEO_BUFFER */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
798 VID_WR32 (info->chip.PVIDEO, 0x700, 0x01/*0x11*/);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
799 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
800
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
801 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
802 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
803
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
804
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
805 /* NV_PVIDEO_OE_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
806 VID_WR32 (info->chip.PVIDEO, 0x224, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
807 /* NV_PVIDEO_SU_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
808 VID_WR32 (info->chip.PVIDEO, 0x228, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
809 /* NV_PVIDEO_RM_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
810 VID_WR32 (info->chip.PVIDEO, 0x22C, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
811
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
812 /* NV_PVIDEO_BUFF0_START_ADDRESS */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
813 VID_WR32 (info->chip.PVIDEO, 0x20C + 0, base + offset + 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
814 VID_WR32 (info->chip.PVIDEO, 0x20C + 4, base + offset + 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
815 /* NV_PVIDEO_BUFF0_PITCH_LENGTH */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
816 VID_WR32 (info->chip.PVIDEO, 0x214 + 0, info->pitch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
817 VID_WR32 (info->chip.PVIDEO, 0x214 + 4, info->pitch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
818
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
819 /* NV_PVIDEO_WINDOW_START */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
820 VID_WR32 (info->chip.PVIDEO, 0x230, (y << 16) | x);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
821 /* NV_PVIDEO_WINDOW_SIZE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
822 VID_WR32 (info->chip.PVIDEO, 0x234, (lheight << 16) | lwidth);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
823 /* NV_PVIDEO_STEP_SIZE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
824 yscale = ((info->height - 1) << 11) / (info->d_height - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
825 xscale = ((info->width - 1) << 11) / (info->d_width - 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
826 VID_WR32 (info->chip.PVIDEO, 0x200, (yscale << 16) | xscale);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
827
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
828 /* NV_PVIDEO_RED_CSC_OFFSET */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
829 VID_WR32 (info->chip.PVIDEO, 0x280, eq.red_off);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
830 /* NV_PVIDEO_GREEN_CSC_OFFSET */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
831 VID_WR32 (info->chip.PVIDEO, 0x284, eq.green_off);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
832 /* NV_PVIDEO_BLUE_CSC_OFFSET */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
833 VID_WR32 (info->chip.PVIDEO, 0x288, eq.blue_off);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
834 /* NV_PVIDEO_CSC_ADJUST */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
835 VID_WR32 (info->chip.PVIDEO, 0x28C, 0x00000); /* No colour correction! */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
836
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
837 /* NV_PVIDEO_CONTROL_Y (BLUR_ON, LINE_HALF) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
838 VID_WR32 (info->chip.PVIDEO, 0x204, 0x001);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
839 /* NV_PVIDEO_CONTROL_X (WEIGHT_HEAVY, SHARPENING_ON, SMOOTHING_ON) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
840 VID_WR32 (info->chip.PVIDEO, 0x208, 0x111); /*directx overlay 0x110 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
841
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
842 /* NV_PVIDEO_FIFO_BURST_LENGTH */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
843 VID_WR32 (info->chip.PVIDEO, 0x23C, 0x03);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
844 /* NV_PVIDEO_FIFO_THRES_SIZE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
845 VID_WR32 (info->chip.PVIDEO, 0x238, 0x38); /*windows uses 0x40*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
846
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
847 /* NV_PVIDEO_BUFF0_OFFSET */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
848 VID_WR32 (info->chip.PVIDEO, 0x21C + 0, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
849 VID_WR32 (info->chip.PVIDEO, 0x21C + 4, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
851 /* NV_PVIDEO_INTR_EN_0_NOTIFY_ENABLED */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
852 // VID_OR32 (info->chip.PVIDEO, 0x140, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
853
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
854 /* NV_PVIDEO_OVERLAY (KEY_ON, VIDEO_ON, FORMAT_CCIR) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
855 value = 0x1; /*video on*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
856 if(info->format==IMGFMT_YUY2)value |= 0x100;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
857 if(info->use_colorkey)value |=0x10;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
858 VID_WR32 (info->chip.PVIDEO, 0x244, value);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
859
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
860 /* NV_PVIDEO_SU_STATE */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
861 VID_XOR32 (info->chip.PVIDEO, 0x228, 1 << 16);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
862 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
863 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
864 /*set colorkey*/
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
865 rivatv_overlay_colorkey(info,info->vidixcolorkey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
866
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
867 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
868
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
869
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
870
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
871
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
872
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
873
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
874
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
875 static rivatv_info* info;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
876
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
877
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
878
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
879
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
880 static int nv_init(void){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
881 int mtrr;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
882 info = calloc(1,sizeof(rivatv_info));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
883 info->control_base = map_phys_mem(pci_info.base0, 0x00C00000 + 0x00008000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
884 info->chip.arch = nvidia_card_ids[find_chip(pci_info.device)].arch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
885 printf("[nvidia_vid] arch %x register base %p\n",info->chip.arch,info->control_base);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
886 info->chip.PFIFO = (uint32_t *) (info->control_base + 0x00002000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
887 info->chip.FIFO = (uint32_t *) (info->control_base + 0x00800000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
888 info->chip.PMC = (uint32_t *) (info->control_base + 0x00000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
889 info->chip.PFB = (uint32_t *) (info->control_base + 0x00100000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
890 info->chip.PME = (uint32_t *) (info->control_base + 0x00000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
891 info->chip.PCIO = (uint8_t *) (info->control_base + 0x00601000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
892 info->chip.PVIO = (uint8_t *) (info->control_base + 0x000C0000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
893 info->chip.PGRAPH = (uint32_t *) (info->control_base + 0x00400000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
894 /* setup chip specific functions */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
895 switch (info->chip.arch) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
896 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
897 info->chip.lock = rivatv_lock_nv03;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
898 info->chip.fbsize = rivatv_fbsize_nv03 (&info->chip);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
899 info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00680000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
900 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
901 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
902 info->chip.lock = rivatv_lock_nv04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
903 info->chip.fbsize = rivatv_fbsize_nv04 (&info->chip);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
904 info->chip.PRAMIN = (uint32_t *) (info->control_base + 0x00700000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
905 info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00680000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
906 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
907 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
908 case NV_ARCH_20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
909 case NV_ARCH_30:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
910 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
911 info->chip.lock = rivatv_lock_nv04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
912 info->chip.fbsize = rivatv_fbsize_nv10 (&info->chip);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
913 info->chip.PRAMIN = (uint32_t *) (info->control_base + 0x00700000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
914 info->chip.PVIDEO = (uint32_t *) (info->control_base + 0x00008000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
915 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
916 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
917 switch (info->chip.arch) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
918 case NV_ARCH_03:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
919 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
920 /* This maps framebuffer @6MB, thus 2MB are left for video. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
921 info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
922 /* This may trash your screen for resolutions greater than 1024x768, sorry. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
923 info->picture_offset = 1024*768* 4 * ((info->chip.fbsize > 4194304)?2:1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
924 info->picture_base = info->video_base + info->picture_offset;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
925 info->chip.PRAMIN = (uint32_t *) (info->video_base + 0x00C00000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
926 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
927 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
928 case NV_ARCH_04:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
929 case NV_ARCH_10:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
930 case NV_ARCH_20:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
931 case NV_ARCH_30:
22880
8b0cfdc71759 GeForce 6x00 and above are actually referenced as NV40 in X.Org driver (though it doesn't work better right now)
ben
parents: 22874
diff changeset
932 case NV_ARCH_40:
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
933 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
934 info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
935 info->picture_offset = info->chip.fbsize - NV04_BES_SIZE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
936 if(info->chip.fbsize > 16*1024*1024)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
937 info->picture_offset -= NV04_BES_SIZE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
938 // info->picture_base = (unsigned long)map_phys_mem(pci_info.base1+info->picture_offset,NV04_BES_SIZE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
939 info->picture_base = info->video_base + info->picture_offset;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
940 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
941 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
942 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
943
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
944 printf("[nvidia_vid] detected memory size %u MB\n",(uint32_t)(info->chip.fbsize /1024/1024));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
945
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
946 if ((mtrr = mtrr_set_type(pci_info.base1, info->chip.fbsize, MTRR_TYPE_WRCOMB))!= 0)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
947 printf("[nvidia_vid] unable to setup MTRR: %s\n", strerror(mtrr));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
948 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
949 printf("[nvidia_vid] MTRR set up\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
950
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
951 nv_getscreenproperties(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
952 if(!info->depth)printf("[nvidia_vid] text mode: %ux%u\n",info->screen_x,info->screen_y);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
953 else printf("[nvidia_vid] video mode: %ux%u@%u\n",info->screen_x,info->screen_y, info->depth);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
954
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
955
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
956 rivatv_enable_PMEDIA(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
957 info->cur_frame = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
958 info->use_colorkey = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
959
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
960 eq.lum = 0x00001000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
961 eq.chrom = 0x00001000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
962 memset(&eq.vals, 0, sizeof(vidix_video_eq_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
963 eq.vals.cap = VEQ_CAP_BRIGHTNESS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
964 if (info->chip.arch > NV_ARCH_04)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
965 eq.vals.cap |= VEQ_CAP_CONTRAST | VEQ_CAP_SATURATION | VEQ_CAP_HUE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
966 eq.red_off = 0x69;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
967 eq.green_off = 0x3e;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
968 eq.blue_off = 0x89;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
969 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
970 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
971
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
972 static void nv_destroy(void){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
973 unmap_phys_mem(info->control_base ,0x00C00000 + 0x00008000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
974 unmap_phys_mem(info->video_base, info->chip.fbsize);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
975 free(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
976 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
977
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
978 static int nv_get_caps(vidix_capability_t *to){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
979 memcpy(to, &nvidia_cap, sizeof(vidix_capability_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
980 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
981 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
982
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
983 inline static int is_supported_fourcc(uint32_t fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
984 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
985 if (fourcc == IMGFMT_UYVY || fourcc == IMGFMT_YUY2)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
986 return 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
987 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
988 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
989 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
990
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
991 static int nv_query_fourcc(vidix_fourcc_t *to){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
992 if(is_supported_fourcc(to->fourcc)){
23060
91ad6d4d6a54 simplified depth definition
ben
parents: 23055
diff changeset
993 to->depth = VID_DEPTH_ALL;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
994 to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
995 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
996 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
997 else to->depth = to->flags = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
998 return ENOSYS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
999 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1000
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1001 static int nv_config_playback(vidix_playback_t *vinfo){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1002 uint32_t i;
23922
ee2cf48d6659 Comment out purely debugging printf that in addition uses __FUNCTION__ which
reimar
parents: 23060
diff changeset
1003 // printf("called %s\n", __FUNCTION__);
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1004 if (! is_supported_fourcc(vinfo->fourcc))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1005 return ENOSYS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1006
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1007 info->width = vinfo->src.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1008 info->height = vinfo->src.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1009
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1010 info->d_width = vinfo->dest.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1011 info->d_height = vinfo->dest.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1012 info->wx = vinfo->dest.x;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1013 info->wy = vinfo->dest.y;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1014 info->format = vinfo->fourcc;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1015
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1016 printf("[nvidia_vid] setting up a %dx%d-%dx%d video window (src %dx%d), format 0x%X\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1017 info->d_width, info->d_height, info->wx, info->wy, info->width, info->height, vinfo->fourcc);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1018
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1019
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1020 vinfo->dga_addr=info->picture_base;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1021
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1022 switch (vinfo->fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1023 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1024 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1025 case IMGFMT_UYVY:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1026
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1027 vinfo->dest.pitch.y = 64;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1028 vinfo->dest.pitch.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1029 vinfo->dest.pitch.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1030
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1031 vinfo->offset.y = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1032 vinfo->offset.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1033 vinfo->offset.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1034 info->pitch = ((info->width << 1) + (vinfo->dest.pitch.y-1)) & ~(vinfo->dest.pitch.y-1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1035 vinfo->frame_size = info->pitch * info->height;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1036 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1037 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1038 info->buffer_size = vinfo->frame_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1039 info->num_frames = vinfo->num_frames= (info->chip.fbsize - info->picture_offset)/vinfo->frame_size;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1040 if(vinfo->num_frames > MAX_FRAMES)vinfo->num_frames = MAX_FRAMES;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1041 // vinfo->num_frames = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1042 // printf("[nvidia_vid] Number of frames %i\n",vinfo->num_frames);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1043 for(i=0;i <vinfo->num_frames;i++)vinfo->offsets[i] = vinfo->frame_size*i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1044 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1045 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1046
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1047 static int nv_playback_on(void){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1048 rivatv_overlay_start(info,info->cur_frame);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1049 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1050 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1051
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1052 static int nv_playback_off(void){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1053 rivatv_overlay_stop(info);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1054 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1055 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1056
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1057 static int nv_set_gkeys( const vidix_grkey_t * grkey){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1058 if (grkey->ckey.op == CKEY_FALSE)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1059 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1060 info->use_colorkey = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1061 printf("[nvidia_vid] colorkeying disabled\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1062 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1063 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1064 info->use_colorkey = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1065 info->vidixcolorkey = ((grkey->ckey.red<<16)|(grkey->ckey.green<<8)|grkey->ckey.blue);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1066 printf("[nvidia_vid] set colorkey 0x%x\n",info->vidixcolorkey);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1067 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1068 if(info->d_width && info->d_height)rivatv_overlay_start(info,0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1069 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1070 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1071
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1072 static int nv_frame_sel(unsigned int frame){
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1073 // printf("selecting buffer %d\n", frame);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1074 rivatv_overlay_start(info, frame);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1075 if (info->num_frames >= 1)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1076 info->cur_frame = frame/*(frame+1)%info->num_frames*/;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1077 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1078 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1079
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1080 static int nv_set_eq(const vidix_video_eq_t *eq_parm) {
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1081 double angle;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1082 int16_t chrom_cos, chrom_sin;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1083 if (eq_parm->cap & VEQ_CAP_BRIGHTNESS)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1084 eq.vals.brightness = eq_parm->brightness;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1085 if (eq_parm->cap & VEQ_CAP_CONTRAST)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1086 eq.vals.contrast = eq_parm->contrast;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1087 if (eq_parm->cap & VEQ_CAP_SATURATION)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1088 eq.vals.saturation = eq_parm->saturation;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1089 if (eq_parm->cap & VEQ_CAP_HUE)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1090 eq.vals.hue = eq_parm->hue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1091 eq.lum = (((eq.vals.brightness * 512 + 500) / 1000) << 16) |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1092 ((((eq.vals.contrast + 1000) * 8191 + 1000) / 2000) & 0xffff);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1093 angle = (double)eq.vals.hue / 1000.0 * 3.1415927;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1094 chrom_cos = ((eq.vals.saturation + 1000) * 8191 * cos(angle) + 1000) / 2000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1095 chrom_sin = ((eq.vals.saturation + 1000) * 8191 * sin(angle) + 1000) / 2000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1096 eq.chrom = chrom_sin << 16 | chrom_cos;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1097 eq.red_off = 0x69 - eq.vals.brightness * 62 / 1000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1098 eq.green_off = 0x3e + eq.vals.brightness * 62 / 1000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1099 eq.blue_off = 0x89 - eq.vals.brightness * 62 / 1000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1100 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1101 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1102
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1103 static int nv_get_eq(vidix_video_eq_t *eq_parm) {
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1104 memcpy(eq_parm, &eq.vals, sizeof(vidix_video_eq_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1105 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1106 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
1107
22857
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1108 VDXDriver nvidia_drv = {
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1109 "nvidia",
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1110 NULL,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1111 .probe = nv_probe,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1112 .get_caps = nv_get_caps,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1113 .query_fourcc = nv_query_fourcc,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1114 .init = nv_init,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1115 .destroy = nv_destroy,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1116 .config_playback = nv_config_playback,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1117 .playback_on = nv_playback_on,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1118 .playback_off = nv_playback_off,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1119 .frame_sel = nv_frame_sel,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1120 .get_eq = nv_get_eq,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1121 .set_eq = nv_set_eq,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1122 .set_gkey = nv_set_gkeys,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
1123 };
24568
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1124
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1125
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1126 #if 0
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1127 //gcc -o nvidia_vid nvidia_vid.c -I ../ -lm ../vidix/libvidix.a
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1128
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1129 int main(int argc,char* argv[]){
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1130 if(nv_probe(0,0)){
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1131 printf("no supported chip found\n");
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1132 return 1;
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1133 }
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1134 if(nv_init()){
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1135 printf("could not init\n");
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1136 return 1;
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1137 }
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1138 if(info->chip.arch >= NV_ARCH_10){
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1139 printf("NV_PVIDEO_BASE (0x900) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x900));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1140 printf("NV_PVIDEO_LIMIT (0x908) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x908));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1141 printf("NV_PVIDEO_OFFSET (0x920) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x920));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1142 printf("NV_PVIDEO_FORMAT (0x958) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x958));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1143 printf("NV_PVIDEO_STOP (0x704) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x704));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1144 printf("NV_PVIDEO_BUFFER (0x700) 0x%x\n",VID_RD32(info->chip.PVIDEO, 0x700));
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1145 }
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1146
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1147 nv_destroy();
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1148 return 0;
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1149 }
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1150
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1151 #endif
83c2e53e6e4d add some commented register dumping code
faust3
parents: 24565
diff changeset
1152