Subject: Re: struct videomode
To: Christos Zoulas <christos@astron.com>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 03/03/2006 15:56:47
Christos Zoulas wrote:
> In article <4408BC45.2080407@tadpole.com>,
> Garrett D'Amore <garrett_damore@tadpole.com> wrote:
>   
>> In order to implement a framebuffer driver for Radeon boards, I need a
>> reasonable database of video timings.  (Yes, I know I could use EDID and
>> DDC, but I'm not that far yet.  And not all monitors support these.  And
>> some folks might want to use a resolution other than what the monitor
>> advertises.)
>>
>> Anyway, in dev/ic/ there is videomode.h, which has the structure I need
>> to use.
>>
>> There are two questions here.  First, anyone object to me moving this to
>> dev/ic/videomode/ and placing a .c file here with a reasonable database
>> (an array of struct  videomode)?  (Actually, the .c will be generated by
>> an awk script, from a file containing a bunch of XFree86 Modeline
>> definitions -- such as
>> xsrc/xc/programs/Xserver/hw/xfree86/etc/vesamodes.)  Both the source
>> file(s) and the awk script will also be in that new directory.
>>
>> Second, struct videomode has a void* member called misc_data.  I want to
>> replace this with a const char *, which will be a "name" for the mode in
>> the form "XxYxR" where X = x resolution, Y = y resolution, and R =
>> vertical refresh rate.  So you get a string like "800x600x60" or
>> "1280x1024x72"
>>     
>
>   
>> This would allow device drivers to locate potential video modes by
>> scanning for them in the list by name.  The name would presumably come
>>     
> >from some other configuration mechanism, such as device properties, etc.
>   
>> Right now the only place struct videomode is used is in vga_raster.c and
>> machfb.c.  Neither of them initialize or use the opaque misc_data member.
>>
>> Thoughts?
>>     
>
> Sounds fine to me. Drivers should also look at the flags field so that
> they can tell if the mode is interlaced etc. The whole struct array should
> be const right?
>   
Right.  :-)

Btw, I'm probably going to move this to dev/videomode rather than than
dev/ic/.

    -- Garrett
> christos
>   


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191