* Re: controlfb and X (fixed)
2000-11-07 21:22 controlfb and X bob
@ 2000-11-18 18:31 ` Michel Lanners
0 siblings, 0 replies; 2+ messages in thread
From: Michel Lanners @ 2000-11-18 18:31 UTC (permalink / raw)
To: bob, bh40, Paul Mackerras; +Cc: linuxppc-dev
[-- Attachment #1: Type: TEXT/plain, Size: 920 bytes --]
Hi all,
Some time ago, there were reports of crashes with controlfb and 2.4
kernels, while starting XF4.0.
I've taken a look, and it seems that indeed the mmap code recently added
to controlfb is to blame.
Below is the patch that fixes the hanging box while starting X for me.
It seems while implementing mmap() for 2.4 kernels in controlfb, I
forgot to copy 2 lines :-((
Ben and Paul, could you apply this patch to all your 2.4 / 2.5 trees? It
also fixes the 7_spaces_instead_of_tab problem in the mmap() code ;-)
Cheers, happy hacking, and sorry for this bug :-)
Michel
-------------------------------------------------------------------------
Michel Lanners | " Read Philosophy. Study Art.
23, Rue Paul Henkes | Ask Questions. Make Mistakes.
L-1710 Luxembourg |
email mlan@cpu.lu |
http://www.cpu.lu/~mlan | Learn Always. "
[-- Attachment #2: 2.4-control-mmap-fix.diff --]
[-- Type: TEXT/plain, Size: 2497 bytes --]
--- /mnt/r4/usr/src/linux-2.4.paul/drivers/video/controlfb.c Thu Oct 19 03:36:07 2000
+++ linux-2.4.0-test10/drivers/video/controlfb.c Sat Nov 18 19:23:10 2000
@@ -338,38 +343,41 @@
static int control_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma)
{
- struct fb_ops *fb = info->fbops;
- struct fb_fix_screeninfo fix;
- struct fb_var_screeninfo var;
- unsigned long off, start;
- u32 len;
-
- fb->fb_get_fix(&fix, PROC_CONSOLE(info), info);
- off = vma->vm_pgoff << PAGE_SHIFT;
-
- /* frame buffer memory */
- start = fix.smem_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.smem_len);
- if (off >= len) {
- /* memory mapped io */
- off -= len;
- fb->fb_get_var(&var, PROC_CONSOLE(info), info);
- if (var.accel_flags)
- return -EINVAL;
- start = fix.mmio_start;
- len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.mmio_len);
- pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
- } else {
- /* framebuffer */
- pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
- }
- start &= PAGE_MASK;
- vma->vm_pgoff = off >> PAGE_SHIFT;
- if (io_remap_page_range(vma->vm_start, off,
- vma->vm_end - vma->vm_start, vma->vm_page_prot))
- return -EAGAIN;
+ struct fb_ops *fb = info->fbops;
+ struct fb_fix_screeninfo fix;
+ struct fb_var_screeninfo var;
+ unsigned long off, start;
+ u32 len;
- return 0;
+ fb->fb_get_fix(&fix, PROC_CONSOLE(info), info);
+ off = vma->vm_pgoff << PAGE_SHIFT;
+
+ /* frame buffer memory */
+ start = fix.smem_start;
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.smem_len);
+ if (off >= len) {
+ /* memory mapped io */
+ off -= len;
+ fb->fb_get_var(&var, PROC_CONSOLE(info), info);
+ if (var.accel_flags)
+ return -EINVAL;
+ start = fix.mmio_start;
+ len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.mmio_len);
+ pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
+ } else {
+ /* framebuffer */
+ pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
+ }
+ start &= PAGE_MASK;
+ if ((vma->vm_end - vma->vm_start + off) > len)
+ return -EINVAL;
+ off += start;
+ vma->vm_pgoff = off >> PAGE_SHIFT;
+ if (io_remap_page_range(vma->vm_start, off,
+ vma->vm_end - vma->vm_start, vma->vm_page_prot))
+ return -EAGAIN;
+
+ return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: controlfb and X (fixed)
[not found] <200011191036.LAA00685@piglet.grunz.lu>
@ 2000-11-20 4:39 ` Robert E Brose II
0 siblings, 0 replies; 2+ messages in thread
From: Robert E Brose II @ 2000-11-20 4:39 UTC (permalink / raw)
To: mlan; +Cc: linuxppc-devel
User Michel Lanners says:
>
> > Which 2.4.0 kernel source are YOU using?
>
> I'm running BenH's 2.5 kernel, that's the only one I was able to boot on
> my 7600. Paulus' 2.4 kernels lock my machine 90% of the time at boot. I
> haven't found what's wrong with them, though...
>
> BenH's kernel is at:
>
> rsync -arvz penguinppc.org::linux-benh-devel .
>
> Happy compiling ;-)
FINALLY got the 2.4.0-test10 benh kernel going.
I had to turn off a bunch of stuff to get it to run (i.e. to avoid
the black screen of death on boot) and I'm not sure the
PPP async driver works yet, had to compile it as a module.
The controlfb driver now senses the 4m video memory properly
on the 7500.
XFree4.01 runs (though the keyboard is messed up. I have to investigate
the new input layer)
The stock XFree86 (XFree86-3.3.6-11.2) also works in 24/32 bits now!!!
HOORAY!! Hopefully the changes will eventually make it to the stock
trees.
Thanks Michel!
Bob
--
Robert E. Brose II N0QBJ
http://www.jriver.com/~bob/
bob@kunk.jriver.com
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-11-20 4:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200011191036.LAA00685@piglet.grunz.lu>
2000-11-20 4:39 ` controlfb and X (fixed) Robert E Brose II
2000-11-07 21:22 controlfb and X bob
2000-11-18 18:31 ` controlfb and X (fixed) Michel Lanners
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).