aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/vesafb.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-06-26 03:26:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:30 -0400
commit6dbde380ca525bbfedd65e11402f345e1d64cba9 (patch)
tree4782592646559a4bef308ec1d055bb9a09bd72cf /drivers/video/vesafb.c
parent313ca22f0bfab792adeb447146d9cb86536c64d3 (diff)
[PATCH] vesafb: Prefer VGA registers over PMI
- As per VESA specs, use the VGA registers to set the palette if the mode is VGA compatible. Otherwise, use the protected mode interface. - Make pmi_setpal default to 1 Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/vesafb.c')
-rw-r--r--drivers/video/vesafb.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index eff2ebcf1f7c..5718924b677f 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -51,7 +51,7 @@ static int inverse = 0;
51static int mtrr = 0; /* disable mtrr */ 51static int mtrr = 0; /* disable mtrr */
52static int vram_remap __initdata = 0; /* Set amount of memory to be used */ 52static int vram_remap __initdata = 0; /* Set amount of memory to be used */
53static int vram_total __initdata = 0; /* Set total amount of memory */ 53static int vram_total __initdata = 0; /* Set total amount of memory */
54static int pmi_setpal = 0; /* pmi for palette changes ??? */ 54static int pmi_setpal = 1; /* pmi for palette changes ??? */
55static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */ 55static int ypan = 0; /* 0..nothing, 1..ypan, 2..ywrap */
56static unsigned short *pmi_base = NULL; 56static unsigned short *pmi_base = NULL;
57static void (*pmi_start)(void); 57static void (*pmi_start)(void);
@@ -86,10 +86,24 @@ static int vesa_setpalette(int regno, unsigned red, unsigned green,
86 int shift = 16 - depth; 86 int shift = 16 - depth;
87 int err = -EINVAL; 87 int err = -EINVAL;
88 88
89/*
90 * Try VGA registers first...
91 */
92 if (vga_compat) {
93 outb_p(regno, dac_reg);
94 outb_p(red >> shift, dac_val);
95 outb_p(green >> shift, dac_val);
96 outb_p(blue >> shift, dac_val);
97 err = 0;
98 }
99
89#ifdef __i386__ 100#ifdef __i386__
90 struct { u_char blue, green, red, pad; } entry; 101/*
102 * Fallback to the PMI....
103 */
104 if (err && pmi_setpal) {
105 struct { u_char blue, green, red, pad; } entry;
91 106
92 if (pmi_setpal) {
93 entry.red = red >> shift; 107 entry.red = red >> shift;
94 entry.green = green >> shift; 108 entry.green = green >> shift;
95 entry.blue = blue >> shift; 109 entry.blue = blue >> shift;
@@ -107,18 +121,6 @@ static int vesa_setpalette(int regno, unsigned red, unsigned green,
107 } 121 }
108#endif 122#endif
109 123
110/*
111 * without protected mode interface and if VGA compatible,
112 * try VGA registers...
113 */
114 if (err && vga_compat) {
115 outb_p(regno, dac_reg);
116 outb_p(red >> shift, dac_val);
117 outb_p(green >> shift, dac_val);
118 outb_p(blue >> shift, dac_val);
119 err = 0;
120 }
121
122 return err; 124 return err;
123} 125}
124 126