[Mesa-dev] OSMesa Help

Brian Paul brianp at vmware.com
Wed Jul 10 06:49:09 PDT 2013


On 07/09/2013 11:20 PM, Andy Li wrote:
> Hello everyone,
>
>
> I have some questions regarding to OSMesa.
>
> I am currently working on a project which I have to use Mesa on an
> embedded system.
>
> My current goal is to port the base functions over to the embedded
> system, so that I can draw a line on a provided VGA screen.
>
> Since the embedded system I am using does not contain a GPU, therefore I
> have decided to use OSMesa for rendering process.
>
> I am wondering if there are any documentations/ specifications for OSMesa?

End users of OSMesa generally get by on the comments in osmesa.h and the 
example programs.  But you're working on the driver implementation side.


> Anyone know which are the base functions that OSMesa used for the
> rendering process?

I don't know what you mean by base functions.  In Mesa/master git, the 
OSMesa can either be used with the legacy swrast driver or with the 
gallium softpipe/llvmpipe drivers.


> I have looked into src/mesa/swrast/s_lines.c and s_drawpix.c and trying
> to figure out how the code works, am I in the right direction?

That code is used by the legacy OSMesa driver, but it's also used by the 
old Xlib driver too.


> Moreover, for example, if I found a drawpix() function, how do I know if
> OSMesa actually used this function during rendering process? Is there
> any tool/debugger I can use to confirm my findings?

One would normally set a breakpoint on the function in gdb or another 
debugger.

Let's take a few steps back here first.  You said you want to display 
graphics on your VGA screen.  OSMesa will not do that for you. 
OS=Off-Screen.  The whole point of OSMesa is to draw into malloc'd 
framebuffer memory, rather than drawing to a real/displayed framebuffer.

You could use OSMesa and then do some sort of memcpy of the image into 
your devices's actual frame buffer.  Is that what you want to do?

-Brian



More information about the mesa-dev mailing list