~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/drivers/video/valkyriefb.h

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * valkyriefb.h: Constants of all sorts for valkyriefb
  3  *
  4  *  Created 8 August 1998 by 
  5  *  Martin Costabel <costabel@wanadoo.fr> and Kevin Schoedel
  6  *
  7  * Vmode-switching changes and vmode 15/17 modifications created 29 August
  8  * 1998 by Barry K. Nathan <barryn@pobox.com>.
  9  * 
 10  * vmode 10 changed by Steven Borley <sjb@salix.demon.co.uk>, 14 mai 2000
 11  *
 12  * This program is free software; you can redistribute it and/or
 13  * modify it under the terms of the GNU General Public License
 14  * as published by the Free Software Foundation; either version
 15  * 2 of the License, or (at your option) any later version.
 16  *
 17  * Based directly on:
 18  *
 19  *  controlfb.h: Constants of all sorts for controlfb
 20  *  Copyright (C) 1998 Daniel Jacobowitz <dan@debian.org>
 21  *
 22  *  pmc-valkyrie.h: Console support for PowerMac "control" display adaptor.
 23  *  Copyright (C) 1997 Paul Mackerras.
 24  *
 25  *  pmc-valkyrie.c: Console support for PowerMac "control" display adaptor.
 26  *  Copyright (C) 1997 Paul Mackerras.
 27  *
 28  * and indirectly from:
 29  *
 30  *  pmc-control.h: Console support for PowerMac "control" display adaptor.
 31  *  Copyright (C) 1997 Paul Mackerras.
 32  *
 33  *  pmc-control.c: Console support for PowerMac "control" display adaptor.
 34  *  Copyright (C) 1996 Paul Mackerras.
 35  *
 36  *  platinumfb.c: Console support for PowerMac "platinum" display adaptor.
 37  *  Copyright (C) 1998 Jon Howell
 38  */
 39 
 40 /*
 41  * Structure of the registers for the Valkyrie colormap registers.
 42  */
 43 struct cmap_regs {
 44         unsigned char addr;
 45         char pad1[7];
 46         unsigned char lut;
 47 };
 48 
 49 /*
 50  * Structure of the registers for the "valkyrie" display adaptor.
 51  */
 52 
 53 struct vpreg {                  /* padded register */
 54         unsigned char r;
 55         char pad[7];
 56 };
 57 
 58 
 59 struct valkyrie_regs {
 60         struct vpreg mode;
 61         struct vpreg depth;
 62         struct vpreg status;
 63         struct vpreg reg3;
 64         struct vpreg intr;
 65         struct vpreg reg5;
 66         struct vpreg intr_enb;
 67         struct vpreg msense;
 68 };
 69 
 70 /*
 71  * Register initialization tables for the valkyrie display.
 72  *
 73  * Dot clock rate is
 74  * 3.9064MHz * 2**clock_params[2] * clock_params[1] / clock_params[0].
 75  */
 76 struct valkyrie_regvals {
 77         unsigned char mode;
 78         unsigned char clock_params[3];
 79         int     pitch[2];               /* bytes/line, indexed by color_mode */
 80         int     hres;
 81         int     vres;
 82 };
 83 
 84 /* Register values for 1024x768, 75Hz mode (17) */
 85 /* I'm not sure which mode this is (16 or 17), so I'm defining it as 17,
 86  * since the equivalent mode in controlfb (which I adapted this from) is
 87  * also 17. Just because MacOS can't do this on Valkyrie doesn't mean we
 88  * can't! :)
 89  *
 90  * I was going to use 12, 31, 3, which I found by myself, but instead I'm
 91  * using 11, 28, 3 like controlfb, for consistency's sake.
 92  */
 93 
 94 static struct valkyrie_regvals valkyrie_reg_init_17 = {
 95     15, 
 96     { 11, 28, 3 },  /* pixel clock = 79.55MHz for V=74.50Hz */
 97     { 1024, 0 },
 98         1024, 768
 99 };
100 
101 /* Register values for 1024x768, 72Hz mode (15) */
102 /* This used to be 12, 30, 3 for pixel clock = 78.12MHz for V=72.12Hz, but
103  * that didn't match MacOS in the same video mode on this chip, and it also
104  * caused the 15" Apple Studio Display to not work in this mode. While this
105  * mode still doesn't match MacOS exactly (as far as I can tell), it's a lot
106  * closer now, and it works with the Apple Studio Display.
107  *
108  * Yes, even though MacOS calls it "72Hz", in reality it's about 70Hz.
109  */
110 static struct valkyrie_regvals valkyrie_reg_init_15 = {
111     15,
112     { 12, 29, 3 },  /* pixel clock = 75.52MHz for V=69.71Hz? */
113                     /* I interpolated the V=69.71 from the vmode 14 and old 15
114                      * numbers. Is this result correct?
115                      */
116     { 1024, 0 },
117         1024, 768
118 };
119 
120 /* Register values for 1024x768, 60Hz mode (14) */
121 static struct valkyrie_regvals valkyrie_reg_init_14 = {
122     14,
123     { 15, 31, 3 },  /* pixel clock = 64.58MHz for V=59.62Hz */
124     { 1024, 0 },
125         1024, 768
126 };
127 
128 /* Register values for 832x624, 75Hz mode (13) */
129 static struct valkyrie_regvals valkyrie_reg_init_13 = {
130     9,
131     { 23, 42, 3 },  /* pixel clock = 57.07MHz for V=74.27Hz */
132     { 832, 0 },
133         832, 624
134 };
135 
136 /* Register values for 800x600, 72Hz mode (11) */
137 static struct valkyrie_regvals valkyrie_reg_init_11 = {
138     13,
139     { 17, 27, 3 },  /* pixel clock = 49.63MHz for V=71.66Hz */
140     { 800, 0 },
141         800, 600
142 };
143 
144 /* Register values for 800x600, 60Hz mode (10) */
145 static struct valkyrie_regvals valkyrie_reg_init_10 = {
146     12,
147     { 25, 32, 3 },  /* pixel clock = 40.0015MHz,
148                      used to be 20,53,2, pixel clock 41.41MHz for V=59.78Hz */
149     { 800, 1600 },
150         800, 600
151 };
152 
153 /* Register values for 640x480, 67Hz mode (6) */
154 static struct valkyrie_regvals valkyrie_reg_init_6 = {
155     6,
156     { 14, 27, 2 },  /* pixel clock = 30.13MHz for V=66.43Hz */
157     { 640, 1280 },
158         640, 480
159 };
160 
161 /* Register values for 640x480, 60Hz mode (5) */
162 static struct valkyrie_regvals valkyrie_reg_init_5 = {
163     11,
164     { 23, 37, 2 },  /* pixel clock = 25.14MHz for V=59.85Hz */
165     { 640, 1280 },
166         640, 480
167 };
168 
169 static struct valkyrie_regvals *valkyrie_reg_init[VMODE_MAX] = {
170         NULL,
171         NULL,
172         NULL,
173         NULL,
174         &valkyrie_reg_init_5,
175         &valkyrie_reg_init_6,
176         NULL,
177         NULL,
178         NULL,
179         &valkyrie_reg_init_10,
180         &valkyrie_reg_init_11,
181         NULL,
182         &valkyrie_reg_init_13,
183         &valkyrie_reg_init_14,
184         &valkyrie_reg_init_15,
185         NULL,
186         &valkyrie_reg_init_17,
187         NULL,
188         NULL,
189         NULL
190 };
191 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.