using drivers directly; getting frame buffer address

If we want to use the drivers directly, instead of going through Photon, how
would we go about getting the address of the active frame buffer? I can see
some interesting functions, like:
disp_modefuncs_t.set_display_offset()
disp_memfuncs_t.alloc(free)_surface()
but no way to get the current address. We’d also like to be able to swap
frame buffers in and out …

Patrick_Mueller@oti.com

Patrick Mueller <patrick_mueller@oti.com> wrote:

If we want to use the drivers directly, instead of going through Photon, how
would we go about getting the address of the active frame buffer? I can see
some interesting functions, like:
disp_modefuncs_t.set_display_offset()
disp_memfuncs_t.alloc(free)_surface()
but no way to get the current address. We’d also like to be able to swap
frame buffers in and out …

First of all, you allocate one or more displayable buffers
using alloc_surface() with the DISP_SURFACE_DISPLAYABLE flag.
Refer to the “bench” utility in the DDK for an example.

Beware, some drivers only let you allocate one displayable
surface, since they cannot double-buffer.

When you allocate the surface, you get back a pointer to
a disp_surface_t structure which contains all the info
you need, including the virtual address of the buffer,
and an offset. You can make a buffer be the “active” buffer
by calling set_display_offset() with the “offset” value
from its surface structure.