|
From: Sottek, M. J <mat...@in...> - 2001-11-17 00:16:06
|
I've been working on a sane i810 framebuffer that makes use of the chipset in the manner that it was designed to be used. This turns out to be very hard to work into the existing 2.4.x framebuffer API due to lots of assumptions and generic code not being very well suited to my needs. My basic issues surround the mixing of driver private information (memory pointers, mmio regions and other stuff that should NEVER be touched outside the driver) with information that gets leaked outside the driver, and even into user space. On i810 there is a region (512k or 1MB) that is stolen from the top of memory by the bios before the OS gains control. This memory is used, via hardware remapping of 0xa0000 and memory paging, for vga compatibility and for video drivers that do not use AGP services. In order to make the framebuffer play nicely with the DRM and X server I am making a framebuffer driver that, by default, only uses this stolen memory. The X server and framebuffer will then never have problems with ringbuffer corruption, Gart resource sharing etc. Now to the problem. I do not have a physical memory region that can be accessed linearly for the entire contents of the framebuffer. Not an issue provided that no one outside the driver tries to access the memory pointers (I was concerned from the beginning when I was asked to provide pointers to data structures that shouldn't have them). I wrote my own character functions that are aware of my memory bank switching, and I have a mmap function that will use zero page fault handlers to bank switch, map, and unmap regions to provide a linear appearance to user space. BUT, it seems that the logo code, and possibly some other things still want to touch the video memory. This can't happen! I saw reference to an imageblit function in some documents but it may be from an older implementation. Clearly that is what I need since I cannot allow anyone outside my driver to directly access memory pointers. Can someone offer some advice as to what I should do to prevent the logo code and others from touching my memory pointers. Second, there is no reason that driver private information should be provided outside the driver. Can we make sure that these things go away in the redesign (I haven't looked though the new code yet, hopefully such nonsense is gone already) -Matt |