Native surface creation
Brian Paul
brian.paul at tungstengraphics.com
Mon Mar 14 08:03:45 PST 2005
Jon Smirl wrote:
> On Sun, 13 Mar 2005 15:50:03 -0700, Brian Paul
> <brian.paul at tungstengraphics.com> wrote:
>
>>In any case, the point of all this isn't really stereo, but
>>consideration of other mode attributes that we might have to be
>>concerned with. Other examples might be interlacing or syncing to
>>external signals and the fact that the application may need to control
>>those things to some degree.
>
>
> My plan was to add all of these as drop downs in a list box. The mode
> names are just strings that select from a set of fbdev fb_mode
> structures.
You've mentioned this drop-down list box twice now but I don't know
what you're talking about. Is this a particular application you're
writing?
> One upside is that the list could contain things like:
> HDTV 1080p
> HDTV 1080i
> HDTV 720p
>
> On the other hand let's say you have a movie that plays at 640x480 and
> you want to go full screen. I do need to make a way for you to figure
> out the string for the 640x480 mode.
>
> I could make a sysfs attribute named match. Write an fb_mode structure
> to it and then read the attribute back and you get the mode string for
> the closest matching mode.
>
> struct fb_videomode {
> const char *name; /* optional */
> u32 refresh; /* optional */
> u32 xres;
> u32 yres;
> u32 pixclock;
> u32 left_margin;
> u32 right_margin;
> u32 upper_margin;
> u32 lower_margin;
> u32 hsync_len;
> u32 vsync_len;
> u32 sync;
> u32 vmode;
> u32 flag;
> };
>
> #define FB_SYNC_HOR_HIGH_ACT 1 /* horizontal sync high active */
> #define FB_SYNC_VERT_HIGH_ACT 2 /* vertical sync high active */
> #define FB_SYNC_EXT 4 /* external sync */
> #define FB_SYNC_COMP_HIGH_ACT 8 /* composite sync high active */
> #define FB_SYNC_BROADCAST 16 /* broadcast video timings */
> /* vtotal = 144d/288n/576i => PAL */
> /* vtotal = 121d/242n/484i => NTSC */
> #define FB_SYNC_ON_GREEN 32 /* sync on green */
>
> #define FB_VMODE_NONINTERLACED 0 /* non interlaced */
> #define FB_VMODE_INTERLACED 1 /* interlaced */
> #define FB_VMODE_DOUBLE 2 /* double scan */
>
> flags
> #define FB_MODE_IS_DETAILED 1
> #define FB_MODE_IS_STANDARD 2
> #define FB_MODE_IS_VESA 4
> #define FB_MODE_IS_CALCULATED 8
> #define FB_MODE_IS_FIRST 16
> #define FB_MODE_IS_FROM_VAR 32
>
> I need to fix this to use enums. We could remove the unneeded fields
> from this structure and add it to egl.h.
This would not be appropriate for egl.h. Traditionally, the various
OpenGL interfaces don't expose structures or machine-specific details.
Here's more of what I hand in mind for an mode API in EGL:
typedef unsigned int EGLMode;
EGLBoolean eglChooseMode(EGLDisplay dpy, const EGLint *attrib_list,
EGLMode *modes, EGLint modes_size, EGLint *num_modes);
EGLBoolean eglGetModes(EGLDisplay dpy, EGLint screen_number, EGLMode
*modes, EGLint modes_size, EGLint *num_modes);
EGLBoolean eglGetModeAttribMESA(EGLDisplay dpy, EGLMode mode, EGLint
attribute, EGLint *value);
They mirror the EGL Config functions. Among the attribute tokens
would be: EGL_WIDTH, EGL_HEIGHT, EGL_DEPTH, EGL_REFRESH_RATE, etc.
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.
-Brian
More information about the dri-egl
mailing list