aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/btext.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-07-03 03:19:48 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-03 03:19:48 -0400
commitab13446616118dc61c00ea50cc49919400717dd0 (patch)
tree3758a9db2938e354ea77629330551d7be8236ccd /arch/powerpc/kernel/btext.c
parent4ce631e7a229a0e073078a197ed37d437cabcde0 (diff)
[POWERPC] Fix various offb and BootX-related issues
This patch fixes various issues with offb (the default fbdev used on powerpc when no proper fbdev is supported). It was broken when using BootX under some circumstances and would fail to properly get the framebuffer base address in others. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/btext.c')
-rw-r--r--arch/powerpc/kernel/btext.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index a6920919d68e..f4e5e14ee2b6 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -111,7 +111,7 @@ void __init btext_setup_display(int width, int height, int depth, int pitch,
111 logicalDisplayBase = (unsigned char *)address; 111 logicalDisplayBase = (unsigned char *)address;
112 dispDeviceBase = (unsigned char *)address; 112 dispDeviceBase = (unsigned char *)address;
113 dispDeviceRowBytes = pitch; 113 dispDeviceRowBytes = pitch;
114 dispDeviceDepth = depth; 114 dispDeviceDepth = depth == 15 ? 16 : depth;
115 dispDeviceRect[0] = dispDeviceRect[1] = 0; 115 dispDeviceRect[0] = dispDeviceRect[1] = 0;
116 dispDeviceRect[2] = width; 116 dispDeviceRect[2] = width;
117 dispDeviceRect[3] = height; 117 dispDeviceRect[3] = height;
@@ -160,20 +160,28 @@ int btext_initialize(struct device_node *np)
160 unsigned long address = 0; 160 unsigned long address = 0;
161 u32 *prop; 161 u32 *prop;
162 162
163 prop = (u32 *)get_property(np, "width", NULL); 163 prop = (u32 *)get_property(np, "linux,bootx-width", NULL);
164 if (prop == NULL)
165 prop = (u32 *)get_property(np, "width", NULL);
164 if (prop == NULL) 166 if (prop == NULL)
165 return -EINVAL; 167 return -EINVAL;
166 width = *prop; 168 width = *prop;
167 prop = (u32 *)get_property(np, "height", NULL); 169 prop = (u32 *)get_property(np, "linux,bootx-height", NULL);
170 if (prop == NULL)
171 prop = (u32 *)get_property(np, "height", NULL);
168 if (prop == NULL) 172 if (prop == NULL)
169 return -EINVAL; 173 return -EINVAL;
170 height = *prop; 174 height = *prop;
171 prop = (u32 *)get_property(np, "depth", NULL); 175 prop = (u32 *)get_property(np, "linux,bootx-depth", NULL);
176 if (prop == NULL)
177 prop = (u32 *)get_property(np, "depth", NULL);
172 if (prop == NULL) 178 if (prop == NULL)
173 return -EINVAL; 179 return -EINVAL;
174 depth = *prop; 180 depth = *prop;
175 pitch = width * ((depth + 7) / 8); 181 pitch = width * ((depth + 7) / 8);
176 prop = (u32 *)get_property(np, "linebytes", NULL); 182 prop = (u32 *)get_property(np, "linux,bootx-linebytes", NULL);
183 if (prop == NULL)
184 prop = (u32 *)get_property(np, "linebytes", NULL);
177 if (prop) 185 if (prop)
178 pitch = *prop; 186 pitch = *prop;
179 if (pitch == 1) 187 if (pitch == 1)
@@ -194,7 +202,7 @@ int btext_initialize(struct device_node *np)
194 g_max_loc_Y = height / 16; 202 g_max_loc_Y = height / 16;
195 dispDeviceBase = (unsigned char *)address; 203 dispDeviceBase = (unsigned char *)address;
196 dispDeviceRowBytes = pitch; 204 dispDeviceRowBytes = pitch;
197 dispDeviceDepth = depth; 205 dispDeviceDepth = depth == 15 ? 16 : depth;
198 dispDeviceRect[0] = dispDeviceRect[1] = 0; 206 dispDeviceRect[0] = dispDeviceRect[1] = 0;
199 dispDeviceRect[2] = width; 207 dispDeviceRect[2] = width;
200 dispDeviceRect[3] = height; 208 dispDeviceRect[3] = height;