Native surface creation

Jon Smirl jonsmirl at gmail.com
Mon Mar 14 09:11:52 PST 2005


On Mon, 14 Mar 2005 09:03:45 -0700, Brian Paul
<brian.paul at tungstengraphics.com> wrote:
> It's clear that you're working at a lower level of implementation
> detail than I am in trying to specify an EGL API extension.

I'm working right at the hardware implementing the modesetting.

A major thing being fixed is to allow normal users to set modes
without being root. Writing arbitrary modelines let you burn up
monitors so it has to be a root operation. To get around the need to
be root a fixed list of modes is exposed and you have to choose from
the list.

Right now the interface for this is very human readable in sysfs:
cat /sys/class/graphics/fb0/modes  --- list of mode names in human readable form
echo name >/sys/class/graphics/fb0/mode -- set one of the modes from the list

This is in current linus bk and it works with fbcon but it isn't
machine friendly, it relies on the human to know what the mode names
mean.

I could alter the attributes to work like this:

echo "width=1000, height=800, depth=32" >/sys/class/graphics/fb0/mode
would pick the closest mode and set it

echo "HDTV 1080i" >/sys/class/graphics/fb0/mode
would search the names since there is no equal sign.

cat /sys/class/graphics/fb0/mode
name="HDTV 720P", width=1024, height=720, depth=32, interlace=no, refresh=60

cat /sys/class/graphics/fb0/modes -- read only
name="v:1024x768", width=1024, height=768, depth=32, interlace=no, refresh=60
name="HDTV 720P", width=1024, height=720, depth=32, interlace=no, refresh=60
name="HDTV 1080i", width=1280, height=1080, depth=32, interlace=yes, refresh=60

I'll also change the root priv attribute that builds the mode list to
take in attribute/value pairs but egl can't change the list.

> 
> typedef unsigned int EGLMode;
> 
> EGLBoolean eglChooseMode(EGLDisplay dpy, const EGLint *attrib_list,
> EGLMode *modes, EGLint modes_size, EGLint *num_modes);
translates to 
open("/sys/class/graphics/fb0/mode")
write("width=1000, height=800, depth=32");
close()
> 
> EGLBoolean eglGetModes(EGLDisplay dpy, EGLint screen_number, EGLMode
> *modes, EGLint modes_size, EGLint *num_modes);
translates to 
open("/sys/class/graphics/fb0/modes")
read()
close()
> 
> EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLMode mode, EGLint
> attribute, EGLint *value);

I can only do this for the currently active mode.

Note that the list of modes can change due to a monitor hotplug. This
will generate a hal/dbus event.

> 
> They mirror the EGL Config functions.  Among the attribute tokens
> would be: EGL_WIDTH, EGL_HEIGHT, EGL_DEPTH, EGL_REFRESH_RATE, etc.
> 

> 
> -Brian
> 


-- 
Jon Smirl
jonsmirl at gmail.com


More information about the dri-egl mailing list