Chameleon

Chameleon Svn Source Tree

Root/branches/diebuche/i386/libsaio/915resolution.h

Source at commit 106 created 10 years 10 months ago.
By diebuche, Adding 915patch and edid
1/* Copied from 915 resolution created by steve tomljenovic
2 * This source code is into the public domain.
3 *
4 * Included to Chameleon RC3 by meklort
5 *
6 * Included to RC4 and edited by deviato to match more intel chipsets
7 *
8 */
9
10#ifndef __915_RESOLUTION_H
11#define __915_RESOLUTION_H
12
13#define NEW(a) ((a *)(malloc(sizeof(a))))
14#define FREE(a) (free(a))
15
16#define VBIOS_START 0xc0000
17#define VBIOS_SIZE 0x10000
18
19#define FALSE 0
20#define TRUE 1
21
22#define MODE_TABLE_OFFSET_845G 617
23
24
25#define ATI_SIGNATURE1 "ATI MOBILITY RADEON"
26#define ATI_SIGNATURE2 "ATI Technologies Inc"
27#define NVIDIA_SIGNATURE "NVIDIA Corp"
28#define INTEL_SIGNATURE "Intel Corp"
29
30
31
32
33typedef enum {
34CT_UNKWN, CT_830, CT_845G, CT_855GM, CT_865G, CT_915G, CT_915GM, CT_945G, CT_945GM, CT_945GME,
35CT_946GZ, CT_G965, CT_Q965, CT_965GM, CT_GM45, CT_G41, CT_G31, CT_G45, CT_500
36} chipset_type;
37
38
39typedef enum {
40BT_UNKWN, BT_1, BT_2, BT_3
41} bios_type;
42
43
44typedef struct {
45UInt8 mode;
46UInt8 bits_per_pixel;
47UInt16 resolution;
48UInt8 unknown;
49} __attribute__((packed)) vbios_mode;
50
51typedef struct {
52UInt8 unknow1[2];
53UInt8 x1;
54UInt8 x_total;
55UInt8 x2;
56UInt8 y1;
57UInt8 y_total;
58UInt8 y2;
59} __attribute__((packed)) vbios_resolution_type1;
60
61typedef struct {
62unsigned long clock;
63
64UInt16 x1;
65UInt16 htotal;
66UInt16 x2;
67UInt16 hblank;
68UInt16 hsyncstart;
69UInt16 hsyncend;
70UInt16 y1;
71 UInt16 vtotal;
72 UInt16 y2;
73UInt16 vblank;
74UInt16 vsyncstart;
75UInt16 vsyncend;
76} __attribute__((packed)) vbios_modeline_type2;
77
78typedef struct {
79UInt8 xchars;
80UInt8 ychars;
81UInt8 unknown[4];
82
83vbios_modeline_type2 modelines[];
84} __attribute__((packed)) vbios_resolution_type2;
85
86typedef struct {
87unsigned long clock;
88
89UInt16 x1;
90UInt16 htotal;
91UInt16 x2;
92UInt16 hblank;
93UInt16 hsyncstart;
94UInt16 hsyncend;
95
96UInt16 y1;
97UInt16 vtotal;
98UInt16 y2;
99UInt16 vblank;
100UInt16 vsyncstart;
101UInt16 vsyncend;
102
103UInt16 timing_h;
104UInt16 timing_v;
105
106UInt8 unknown[6];
107} __attribute__((packed)) vbios_modeline_type3;
108
109typedef struct {
110unsigned char unknown[6];
111
112 vbios_modeline_type3 modelines[];
113} __attribute__((packed)) vbios_resolution_type3;
114
115typedef struct {
116UInt32 chipset_id;
117chipset_type chipset;
118bios_type bios;
119
120UInt32 bios_fd;
121char* bios_ptr;
122
123vbios_mode * mode_table;
124UInt32 mode_table_size;
125UInt8 b1, b2;
126
127UInt8 unlocked;
128} vbios_map;
129
130
131
132void display_map_info(vbios_map*);
133vbios_map * open_vbios(chipset_type);
134void close_vbios (vbios_map*);
135void unlock_vbios(vbios_map*);
136void relock_vbios(vbios_map*);
137void set_mode(vbios_map*, UInt32, UInt32, UInt32, UInt32, UInt32);
138void list_modes(vbios_map *map, UInt32 raw);
139
140#endif
141

Archive Download this file

Revision: 106