annotate vidix/pm3_vid.c @ 24886:9846871187fa

Replace hopefully unreachable code with abort()
author uau
date Thu, 01 Nov 2007 06:51:53 +0000
parents acfe034e5386
children 0d255d03016f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
diff changeset
1 /*
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
diff changeset
2 * VIDIX driver for 3DLabs Glint R3 and Permedia 3 chipsets.
23734
acfe034e5386 ISO8859-1 --> UTF-8
diego
parents: 23167
diff changeset
3 * Copyright (C) 2002 Måns Rullgård
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
diff changeset
4 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
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: 22905
diff changeset
6 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
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: 22905
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: 22905
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: 22905
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: 22905
diff changeset
11 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
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: 22905
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: 22905
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: 22905
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: 22905
diff changeset
16 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22905
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: 22905
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: 22905
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: 22905
diff changeset
20 */
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
21
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
22 #include <errno.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
23 #include <stdio.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
24 #include <stdlib.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
25 #include <string.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
26 #include <inttypes.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
27 #include <unistd.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
28
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
29 #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
30 #include "vidixlib.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
31 #include "fourcc.h"
22901
a7605669b114 renamed libdha.[hc] to dha.[hc]
ben
parents: 22900
diff changeset
32 #include "dha.h"
22900
a9e111b88c4a merged libdha and libvidix, moved all files from libdha to vidix directory
ben
parents: 22869
diff changeset
33 #include "pci_ids.h"
a9e111b88c4a merged libdha and libvidix, moved all files from libdha to vidix directory
ben
parents: 22869
diff changeset
34 #include "pci_names.h"
22905
f34e5d778267 consistent include paths for config.h et al.
diego
parents: 22901
diff changeset
35 #include "config.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
36
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
37 #include "pm3_regs.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
38
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
39 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
40 #define TRACE_ENTER() fprintf(stderr, "%s: enter\n", __FUNCTION__)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
41 #define TRACE_EXIT() fprintf(stderr, "%s: exit\n", __FUNCTION__)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
42 #else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
43 #define TRACE_ENTER()
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
44 #define TRACE_EXIT()
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
45 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
46
23056
e0b4fe583282 declare variables as static
ben
parents: 23046
diff changeset
47 static pciinfo_t pci_info;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
48
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
49 void *pm3_reg_base;
23056
e0b4fe583282 declare variables as static
ben
parents: 23046
diff changeset
50 static void *pm3_mem;
22850
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 pm3_cap =
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
53 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
54 "3DLabs GLINT R3/Permedia3 driver",
23734
acfe034e5386 ISO8859-1 --> UTF-8
diego
parents: 23167
diff changeset
55 "Måns Rullgård <mru@users.sf.net>",
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
56 TYPE_OUTPUT,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
57 { 0, 0, 0, 0 },
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
58 2048,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
59 2048,
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 4,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
62 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
63 FLAG_UPSCALER|FLAG_DOWNSCALER,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
64 VENDOR_3DLABS,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
65 -1,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
66 { 0, 0, 0, 0 }
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
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
69 static unsigned short pm3_card_ids[] =
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
70 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
71 DEVICE_3DLABS_GLINT_R3
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
72 };
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
73
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
74 static int find_chip(unsigned chip_id)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
75 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
76 unsigned i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
77 for(i = 0;i < sizeof(pm3_card_ids)/sizeof(unsigned short);i++)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
78 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
79 if(chip_id == pm3_card_ids[i]) return i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
80 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
81 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
82 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
83
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
84 static int pm3_probe(int verbose, int force)
22850
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 pciinfo_t lst[MAX_PCI_DEVICES];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
87 unsigned i,num_pci;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
88 int err;
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 err = pci_scan(lst,&num_pci);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
91 if(err)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
92 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
93 printf("[pm3] Error occurred during pci scan: %s\n",strerror(err));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
94 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
95 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
96 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
97 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
98 err = ENXIO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
99 for(i=0; i < num_pci; i++)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
100 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
101 if(lst[i].vendor == VENDOR_3DLABS)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
102 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
103 int idx;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
104 const char *dname;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
105 idx = find_chip(lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
106 if(idx == -1)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
107 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
108 dname = pci_device_name(VENDOR_3DLABS, lst[i].device);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
109 dname = dname ? dname : "Unknown chip";
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
110 printf("[pm3] Found chip: %s\n", dname);
23167
2ab3eac7f6da synced with upstream vidix, prevented some drivers to work on some configs/archs
ben
parents: 23060
diff changeset
111 #if 0
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
112 if ((lst[i].command & PCI_COMMAND_IO) == 0)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
113 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
114 printf("[pm3] Device is disabled, ignoring\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
115 continue;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
116 }
23167
2ab3eac7f6da synced with upstream vidix, prevented some drivers to work on some configs/archs
ben
parents: 23060
diff changeset
117 #endif
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
118 pm3_cap.device_id = lst[i].device;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
119 err = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
120 memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
121 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
122 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
123 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
124 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
125 if(err && verbose) printf("[pm3] Can't find chip\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
126 return err;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
127 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
128
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
129 #define PRINT_REG(reg) \
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
130 { \
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
131 long _foo = READ_REG(reg); \
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
132 printf("[pm3] " #reg " (%x) = %#lx (%li)\n", reg, _foo, _foo); \
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
133 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
134
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
135 static int pm3_init(void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
136 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
137 pm3_reg_base = map_phys_mem(pci_info.base0, 0x20000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
138 pm3_mem = map_phys_mem(pci_info.base2, 0x2000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
139 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
140 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
141
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
142 static void pm3_destroy(void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
143 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
144 unmap_phys_mem(pm3_reg_base, 0x20000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
145 unmap_phys_mem(pm3_mem, 0x2000000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
146 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
147
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
148 static int pm3_get_caps(vidix_capability_t *to)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
149 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
150 memcpy(to, &pm3_cap, sizeof(vidix_capability_t));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
151 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
152 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
153
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
154 static int is_supported_fourcc(uint32_t fourcc)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
155 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
156 switch(fourcc){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
157 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
158 case IMGFMT_UYVY:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
159 return 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
160 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
161 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
162 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
163 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
164
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
165 static int pm3_query_fourcc(vidix_fourcc_t *to)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
166 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
167 if(is_supported_fourcc(to->fourcc))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
168 {
23060
91ad6d4d6a54 simplified depth definition
ben
parents: 23056
diff changeset
169 to->depth = VID_DEPTH_ALL;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
170 to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
171 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
172 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
173 else to->depth = to->flags = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
174 return ENOSYS;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
175 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
176
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
177 #define FORMAT_RGB8888 PM3VideoOverlayMode_COLORFORMAT_RGB8888
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
178 #define FORMAT_RGB4444 PM3VideoOverlayMode_COLORFORMAT_RGB4444
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
179 #define FORMAT_RGB5551 PM3VideoOverlayMode_COLORFORMAT_RGB5551
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
180 #define FORMAT_RGB565 PM3VideoOverlayMode_COLORFORMAT_RGB565
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
181 #define FORMAT_RGB332 PM3VideoOverlayMode_COLORFORMAT_RGB332
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
182 #define FORMAT_BGR8888 PM3VideoOverlayMode_COLORFORMAT_BGR8888
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
183 #define FORMAT_BGR4444 PM3VideoOverlayMode_COLORFORMAT_BGR4444
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
184 #define FORMAT_BGR5551 PM3VideoOverlayMode_COLORFORMAT_BGR5551
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
185 #define FORMAT_BGR565 PM3VideoOverlayMode_COLORFORMAT_BGR565
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
186 #define FORMAT_BGR332 PM3VideoOverlayMode_COLORFORMAT_BGR332
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
187 #define FORMAT_CI8 PM3VideoOverlayMode_COLORFORMAT_CI8
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
188 #define FORMAT_VUY444 PM3VideoOverlayMode_COLORFORMAT_VUY444
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
189 #define FORMAT_YUV444 PM3VideoOverlayMode_COLORFORMAT_YUV444
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
190 #define FORMAT_VUY422 PM3VideoOverlayMode_COLORFORMAT_VUY422
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
191 #define FORMAT_YUV422 PM3VideoOverlayMode_COLORFORMAT_YUV422
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
192
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
193 /* Notice, have to check that we don't overflow the deltas here ... */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
194 static void
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
195 compute_scale_factor(
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
196 short* src_w, short* dst_w,
22869
e738da70c593 killed warnings in pm3 driver
ben
parents: 22858
diff changeset
197 uint32_t* shrink_delta, uint32_t* zoom_delta)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
198 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
199 /* NOTE: If we don't return reasonable values here then the video
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
200 * unit can potential shut off and won't display an image until re-enabled.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
201 * Seems as though the zoom_delta is o.k, and I've not had the problem.
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
202 * The 'shrink_delta' is prone to this the most - FIXME ! */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
203
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
204 if (*src_w >= *dst_w) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
205 *src_w &= ~0x3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
206 *dst_w &= ~0x3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
207 *shrink_delta = (((*src_w << 16) / *dst_w) + 0x0f) & 0x0ffffff0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
208 *zoom_delta = 1<<16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
209 if ( ((*shrink_delta * *dst_w) >> 16) & 0x03 )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
210 *shrink_delta += 0x10;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
211 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
212 *src_w &= ~0x3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
213 *dst_w &= ~0x3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
214 *zoom_delta = (((*src_w << 16) / *dst_w) + 0x0f) & 0x0001fff0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
215 *shrink_delta = 1<<16;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
216 if ( ((*zoom_delta * *dst_w) >> 16) & 0x03 )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
217 *zoom_delta += 0x10;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
218 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
219 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
220
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
221 static int frames[VID_PLAY_MAXFRAMES];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
222
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
223 static long overlay_mode, overlay_control;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
224
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
225 static int pm3_config_playback(vidix_playback_t *info)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
226 {
22869
e738da70c593 killed warnings in pm3 driver
ben
parents: 22858
diff changeset
227 uint32_t shrink, zoom;
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
228 short src_w, drw_w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
229 short src_h, drw_h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
230 long base0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
231 int pitch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
232 int format;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
233 unsigned int i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
234
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
235 TRACE_ENTER();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
236
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
237 if(!is_supported_fourcc(info->fourcc))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
238 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
239
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
240 switch(info->fourcc){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
241 case IMGFMT_YUY2:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
242 format = FORMAT_YUV422;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
243 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
244 case IMGFMT_UYVY:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
245 format = FORMAT_VUY422;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
246 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
247 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
248 return -1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
249 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
250
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
251 src_w = info->src.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
252 src_h = info->src.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
253
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
254 drw_w = info->dest.w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
255 drw_h = info->dest.h;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
256
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
257 pitch = src_w;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
258
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
259 /* Assume we have 16 MB to play with */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
260 info->num_frames = 0x1000000 / (pitch * src_h * 2);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
261 if(info->num_frames > VID_PLAY_MAXFRAMES)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
262 info->num_frames = VID_PLAY_MAXFRAMES;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
263
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
264 /* Start at 16 MB. Let's hope it's not in use. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
265 base0 = 0x1000000;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
266 info->dga_addr = pm3_mem + base0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
267
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
268 info->dest.pitch.y = 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
269 info->dest.pitch.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
270 info->dest.pitch.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
271 info->offset.y = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
272 info->offset.v = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
273 info->offset.u = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
274 info->frame_size = pitch * src_h * 2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
275 for(i = 0; i < info->num_frames; i++){
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
276 info->offsets[i] = info->frame_size * i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
277 frames[i] = (base0 + info->offsets[i]) >> 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
278 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
279
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
280 compute_scale_factor(&src_w, &drw_w, &shrink, &zoom);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
281
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
282 WRITE_REG(PM3VideoOverlayBase0, base0 >> 1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
283 WRITE_REG(PM3VideoOverlayStride, PM3VideoOverlayStride_STRIDE(pitch));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
284 WRITE_REG(PM3VideoOverlayWidth, PM3VideoOverlayWidth_WIDTH(src_w));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
285 WRITE_REG(PM3VideoOverlayHeight, PM3VideoOverlayHeight_HEIGHT(src_h));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
286 WRITE_REG(PM3VideoOverlayOrigin, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
287
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
288 /* Scale the source to the destinationsize */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
289 if (src_h == drw_h) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
290 WRITE_REG(PM3VideoOverlayYDelta, PM3VideoOverlayYDelta_NONE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
291 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
292 WRITE_REG(PM3VideoOverlayYDelta,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
293 PM3VideoOverlayYDelta_DELTA(src_h, drw_h));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
294 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
295 if (src_w == drw_w) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
296 WRITE_REG(PM3VideoOverlayShrinkXDelta, 1<<16);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
297 WRITE_REG(PM3VideoOverlayZoomXDelta, 1<<16);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
298 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
299 WRITE_REG(PM3VideoOverlayShrinkXDelta, shrink);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
300 WRITE_REG(PM3VideoOverlayZoomXDelta, zoom);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
301 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
302 WRITE_REG(PM3VideoOverlayIndex, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
303
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
304 /* Now set the ramdac video overlay region and mode */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
305 RAMDAC_SET_REG(PM3RD_VideoOverlayXStartLow, (info->dest.x & 0xff));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
306 RAMDAC_SET_REG(PM3RD_VideoOverlayXStartHigh, (info->dest.x & 0xf00)>>8);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
307 RAMDAC_SET_REG(PM3RD_VideoOverlayXEndLow, (info->dest.x+drw_w) & 0xff);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
308 RAMDAC_SET_REG(PM3RD_VideoOverlayXEndHigh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
309 ((info->dest.x+drw_w) & 0xf00)>>8);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
310 RAMDAC_SET_REG(PM3RD_VideoOverlayYStartLow, (info->dest.y & 0xff));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
311 RAMDAC_SET_REG(PM3RD_VideoOverlayYStartHigh, (info->dest.y & 0xf00)>>8);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
312 RAMDAC_SET_REG(PM3RD_VideoOverlayYEndLow, (info->dest.y+drw_h) & 0xff);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
313 RAMDAC_SET_REG(PM3RD_VideoOverlayYEndHigh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
314 ((info->dest.y+drw_h) & 0xf00)>>8);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
315
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
316 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyR, 0xff);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
317 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyG, 0x00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
318 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyB, 0xff);
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 overlay_mode =
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
321 1 << 5 |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
322 format |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
323 PM3VideoOverlayMode_FILTER_FULL |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
324 PM3VideoOverlayMode_BUFFERSYNC_MANUAL |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
325 PM3VideoOverlayMode_FLIP_VIDEO;
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 overlay_control =
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
328 PM3RD_VideoOverlayControl_KEY_COLOR |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
329 PM3RD_VideoOverlayControl_MODE_MAINKEY |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
330 PM3RD_VideoOverlayControl_DIRECTCOLOR_ENABLED;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
331
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
332 TRACE_EXIT();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
333 return 0;
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
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
336 static int pm3_playback_on(void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
337 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
338 TRACE_ENTER();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
339
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
340 WRITE_REG(PM3VideoOverlayMode,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
341 overlay_mode | PM3VideoOverlayMode_ENABLE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
342 RAMDAC_SET_REG(PM3RD_VideoOverlayControl,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
343 overlay_control | PM3RD_VideoOverlayControl_ENABLE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
344 WRITE_REG(PM3VideoOverlayUpdate,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
345 PM3VideoOverlayUpdate_ENABLE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
346
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
347 TRACE_EXIT();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
348 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
349 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
350
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
351 static int pm3_playback_off(void)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
352 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
353 RAMDAC_SET_REG(PM3RD_VideoOverlayControl,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
354 PM3RD_VideoOverlayControl_DISABLE);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
355 WRITE_REG(PM3VideoOverlayMode,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
356 PM3VideoOverlayMode_DISABLE);
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 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyR, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
359 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyG, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
360 RAMDAC_SET_REG(PM3RD_VideoOverlayKeyB, 0xfe);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
361
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
362 return 0;
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
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
365 static int pm3_frame_select(unsigned int frame)
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
366 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
367 WRITE_REG(PM3VideoOverlayBase0, frames[frame]);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
368 return 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
369 }
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
370
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
371 VDXDriver pm3_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
372 "pm3",
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
373 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
374 .probe = pm3_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
375 .get_caps = pm3_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
376 .query_fourcc = pm3_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
377 .init = pm3_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
378 .destroy = pm3_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
379 .config_playback = pm3_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
380 .playback_on = pm3_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
381 .playback_off = pm3_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
382 .frame_sel = pm3_frame_select,
77def5093daf switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents: 22850
diff changeset
383 };