From: Fido, M. <Mar...@eu...> - 2003-11-18 11:55:55
|
Hi guys & gals, I'm trying to implement a frame buffer driver on a MIPS32 4Kc processor, using the MontaVista toolkit (2.4.17 kernel). The product is a set top box, so the console is on a serial port and the framebuffer is visible on a TV. The processor has no video memory, so the driver has to allocate memory for the frame buffer in RAM, and one of the CPUs registers is given the allocated address. I'm currently trying to simply insmod my driver and then open /dev/fb/0 and read some bytes from the file handle. When the drivers init function is called I fill the framebuffer with a colour for debugging. I can't allocate the buffer with kmalloc as it's too big. If I declare it statically or use vmalloc then the CPU doesn't seem to be able to see the buffer (I see garbage on the screen). I've tried using virt_to_phys etc but this doesn't help (the CPU register doesn't read the top 6 bits of the address anyway). If I pass the "mem" option to the kernel at boot to reserve some memory and then allocate the buffer with ioremap then the CPU can see the buffer. This isn't the best solution, since a static buffer has to be big enough to hold the max resolution in 32 bit colour mode, which is quite large. It would be much better if I could dynamically create the buffer according to the res & colour mode requested, but I'm not sure this is possible (I believe the memory must be contiguous in physical address space). The real problem however is that regardless of how I allocate the buffer, when reading from the file handle all I see is zeros. I've filled in fix.smem_start & fix.smem_len with the address & size of the buffer. Do I need to do any more than this? I've filled in info.screen_base in my init function as well (possibly incorrectly - what's the best way to determine the virtual address?). I've also tried implementing my own mmap function and calling it from an application, but with no success - I figure I need to sort out basic read & write from the filehandle first anyway. Ok, I think my problems are more to do with memory management (or my lack of understanding of mm at least) than framebuffers, so please let me know if there's a more suitable list I can post my questions too. Many thanks for any advice, Martin. *********************************************************************************************** The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. This email and any response may be monitored by Sony United Kingdom Limited. (04) *********************************************************************************************** |