Thread (13 messages) 13 messages, 4 authors, 2003-09-12

Re: New API and X option UseFBDev

flat view

From: Sven Luther <hidden>
Date: 2003-09-10 04:53:00

On Tue, Sep 09, 2003 at 11:59:53PM +0100, Jim Hague wrote:
On 09-Sep-2003 Sven Luther wrote:
quoted
Mmm, notice that the :

(--) GLINT(0): Linear framebuffer at 0xCE800000
(--) GLINT(0): MMIO registers at 0xCFFE0000
(EE) GLINT(0): mmap mmio: Invalid argument
(EE) GLINT(0): mmap mmio: Invalid argument

means that the linear framebuffer and mmio registers, values given to
you by pm2fb, are correct (but check this fact with lspci). GLINTMapMem
should call fbdevHWMapVidmem, so i suppose the message you see are from
fbdevhw. Try enabling the DEBUG #define in glint_driver.c to get a bit
more context. 
I'd notice that. The code in question is in fbdevhw.c.
Ok.
I've abstracted the problem out into the test program below. It mimics what
fbdehhw.c does, namely open the frame buffer device, get the fix screen info
and (I'm assuming) mmap() the io (I haven't delved through the detail
of /dev/fb0).

I've run this on 2.4.22-pre6-ac1 and it works fine, and by implication, since
X via UseFBDev has worked since then, since early 2.4. Here's the output:

PAGE_MASK 0xfffff000, ~PAGE_MASK 0xfff
smem_start 0xcf000000 smem_len 0x400000, mmio_start 0xcffe0000, mmio_len 0x10000
fb_off 0x0 fb_len 0x400000, mmio_off 0x0, mmio_len 0x10000
mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, 3, 0x400000)
Worked - map 0x40016000

On 2.6.0-test3 and 2.6.0-test5 the mmap() fails with EINVAL. Again, the output:

PAGE_MASK 0xfffff000, ~PAGE_MASK 0xfff
smem_start 0xcf000000 smem_len 0x400000, mmio_start 0xcffe0000, mmio_len 0x10000
fb_off 0x0 fb_len 0x400000, mmio_off 0x0, mmio_len 0x10000
mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, 3, 0x400000)
mmap mmio: Invalid argument (22)

As you see, the parameters to mmap() are identical. The problem is fb_len -
reduce this to, say, 0x3f0000 and mmap() works.

Any suggestions as to where to look next?
It sounds like a kernel problem, and i can't help you more about this.
Still, and sorry if i am speaking non-sense, but it is early morning,
but in the :
        map = mmap(NULL, mmio_len, PROT_READ | PROT_WRITE, MAP_SHARED,
                   fd, fb_len);
Code, i see nowhere that you make mention of the corresponding offsets.
In a small program i did myself for accessing my graphic card by hand, i
did :

      base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
	          MAP_SHARED|MAP_LOCKED, fd, (off_t)Base);

so your fb_len should maybe have been mmio_start, i think.

Friendly,

Sven Luther


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help