Subject: mmap on non-aligned region

From: [email-masked]
Date: Thu, 4 Mar 1999 17:27:32 -0500

I am developing a fbmem driver for an SA-1100 based board and am stuck in
the fb_mmap
function.  The video memory on the SA-1100 cannot be page aligned due to an
LCD driver
requirement that the palette be page aligned.  The video memory must be
contiguously
located at the end of the palette area (512 bytes).

The fb_mmap function is being called with vma->offset=0 and the vma->start
and vma->end
corresponding to the video memory size (640x480).  The vma->start parameter
passed
into the function is page aligned; presumably by the kernel in the mmap
system call.

Since the video memory is not page aligned, I cannot call remap_page_range
to map it
into the page aligned vma->start address.  In the fbmem function, I have
tried using
remap_page_range to map in the surrounding aligned page and modifying
vma->start
to point to a non-aligned address before returning.  However, the kernel
(2.0.35) still
returns the original vma->start address to the mmap system caller. Thus, the
application does not get the updated value.

How can I accomplish the fb_mmap function for this fbmem driver?

Thanks,
Eric

---

From: [email-masked]
Date: Fri, 5 Mar 1999 09:23:05 -0500

> On  4 Mar 99 at 17:27, [email-masked] wrote:
> > I am developing a fbmem driver for an SA-1100 based board 
> > and am stuck in the fb_mmap
> ...
> > The fb_mmap function is being called with vma->offset=0 and 
> > the vma->start and vma->end
> ...
> > Since the video memory is not page aligned, I cannot call 
> > remap_page_range to map it
>
>   I know nothing about SA-1100, but is not it possible to set 
> `video_start' (this register does exist on VGA compatibles 
> (to allow virtual scrolling...)) so that first pixel will be 
> present on page boundary? If palette is 512 bytes 
> long, it should be possible for all depths on 4KB machines 
> and for all except 24bpp on 8KB machines (if it is in pixels; 
> if base is in bytes, you should not have any problems).

Thanks, but the 'video_start' on the SA-1100 is fixed at the end
of the palette area.  

However, a quick re-read of the video controller spec and I realized
the palette area only has to be aligned on a 16 byte boundry.  
Modifying the FrameBuffer address so that the start of the
video data area was aligned on a 4k boundry became trivial.  
Simple confusion on my part.

Thanks anyway,
Eric

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]