bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SVGA console


From: Peter 'p2' De Schrijver
Subject: Re: SVGA console
Date: Tue, 19 Aug 2003 20:58:28 +0200
User-agent: Mutt/1.5.4i

Hi Marco,

On Mon, Aug 18, 2003 at 12:02:32AM +0200, Marco Gerards wrote:
> Marco Gerards <metgerards@student.han.nl> writes:
> 
> > Hi,
> > 
> > Currently the console client only support (minimally) VGA. It it not
> > really hard to add some more VGA support and even basic SVGA support.
> 
> Today I wrote some code. I got almost everything done, but I want t
> make sure the driver interfaces are sane. These interfaces can be used
> for textmode, but should also be usable for the framebuffer. Do I need
> to add something for textmode and what needs to be done/changed to
> make it more useful for framebuffer support?
> 
> Thanks,
> Marco
> 
> /* display_driver.h - Video clock interfaces.
>    Copyright (C) 2003 Free Software Foundation, Inc.
>    Written by Marco Gerards.
> 
>    This file is part of the GNU Hurd.
> 
>    The GNU Hurd is free software; you can redistribute it and/or
>    modify it under the terms of the GNU General Public License as
>    published by the Free Software Foundation; either version 2, or (at
>    your option) any later version.
> 
>    The GNU Hurd is distributed in the hope that it will be useful, but
>    WITHOUT ANY WARRANTY; without even the implied warranty of
>    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>    General Public License for more details.
> 
>    You should have received a copy of the GNU General Public License
>    along with this program; if not, write to the Free Software
>    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
> 
> 

struct syncinfo {
        enum { SPLIT_SYNC, CSYNC, SYNC_ON_COLOR } type;
        union {
                struct {
                        polarity hsync_pol;
                        polarity vsync_pol;
                } split_sync;
                struct {
                        polarity csync_pol;
                } csync;
                struct {
                        polarity pol;
                        enum {RED, GREEN, BLUE} color;
                } sync_on_color;
        } sync_parameters;
};

typedef unsigned int display_flags;

#define DISPLAY_FLAGS_LACE      (1<<0)
#define DISPLAY_FLAGS_EXTSYNC   (1<<1)
#define DISPLAY_FLAGS_DOUBLE    (1<<2)

> /* Information and interfaces for a display driver.  */
> struct display_driver
> {
>   /* Name of driver name.  */
>   const char *driver_name;
> 
>   /* Name of videocard or videochipset.  This information is available
>      after initialization with display_init.  It can be set to NULL
>      when it is not relevant.  */
>   char *card_sub_name;
> 
>   /* Maximum allowed values.  XXX: Are more maximum values
>      required?  */
>   int max_hdisplay_end;
>   int max_hsync_start;
>   int max_hblank_start;
>   int max_htotal;
>   int max_vdisplay_end;
>   int max_vsync_start;
>   int max_vblank_start;
>   int max_vtotal;
> 
>   /* Initialize display driver.  If the hardware is not available or
>      usable ENODEV is returned.  */
>   error_t (*display_init);
> 
>   /* Deinitialize the driver.  */
>   error_t (*display_fini);
> 
>   /* Set the last visible pixel on the display to END.  Set the first
>      pixel of the horizontal retrace to SYNC_START and its last pixel
>      to SYNC_END.  Set the last pixel of the screen to TOTAL, after
>      this the new line will begin.  END, SYNC_START, SYNC_END and
>      TOTAL must be multiples of 8.  Return EOVERFLOW when the hardware
>      can't setup the hardware registers without overflowing them, in
>      that case the videomode is not available.  */
>   error_t (*set_horiz_timings) (int end, int sync_start, int sync_end,
>                               int total);
> 

I wuould rather have :
error_t (*set_horiz_timings) (unsigned xres, unsigned left, unsigned
right, unsigned hslen);

/* set number of visible horizontal pixels to xres,
   set number of left margin pixels to left,
   set number of right margin pixels to right,
   set horizontal sync pulse width to hslen */

>   /* Return in END the last visible pixel on the screen, in SYNC_START
>      the pixel on which the horizontal retrace starts, in SYNC_END the
>      pixel on which the horizontal retrace ends and in TOTAL the last
>      pixel of the screen.  Never return values that are not usable
>      with set_horiz_timings.  */
>   error_t (*get_horiz_timings) (int *end, int *sync_start, int *sync_end,
>                               int *total);
> 

error_t (*get_horiz_timings) (unsigned *xres, unsigned *left, unsigned
*right, unsigned *hslen)

get equivalent of set_horiz_timings :)

>   /* Set the last visible scanline on the display to END.  Set the
>      first scanline of the horizontal retrace to SYNC_START and its
>      last scanline to SYNC_END.  Set the last scanline of the screen
>      to TOTAL, after this the new vertical period will begin.  Return
>      EOVERFLOW when the hardware can't setup the hardware registers
>      without overflowing them, in that case the videomode is not
>      available.  */
>   error_t (*set_vert_timings) (int *end, int *sync_start, int *sync_end,
>                              int *total);

error_t (*set_vert_timings) (unsigned yres, unsigned upper, unsigned
lower, unsigned vslen);

/* set number of visible vertical pixels to yres,
   set number of top margin pixels to upper,
   set number of bottom margin pixels to lower,
   set vertical sync pulse width to vslen */

> 
>   /* Return in END the last visible scanline on the screen, in
>      SYNC_START the scanline on which the horizontal retrace starts,
>      in SYNC_END the scanline on which the horizontal retrace ends and
>      in TOTAL the last scanline of the screen.  Never return values
>      that are not usable with set_vert_timings.  */
>   error_t (*get_vert_timings) (int *end, int *sync_start, int *sync_end,
>                              int *total);
> 

make this the get equivalent for set_vert_timings.

>   /* Set the timer to FREQUENCY Khz, the frequency used by the
>      hardware may be DEVIATION Hhz more or less than FREQUENCY.  If
>      the pixelclock cannot be set to FREQUENCE with the diviation
>      DEVIATION return EINVAL.  */
>   error_t (*set_pixclock) (long frequency, int deviation);
> 
>   /* Test if there is a pixelclock with FREQUENCY Khz available, the
>      frequency used by the hardware may be DEVIATION Khz more or less
>      than FREQUENCY.  Return 1 if a clock is available, return 0
>      otherwise.  */
>   int (*test_pixclock) (long frequency, int deviation);

error_t (*set_syncinfo) (struct syncinfo *si);

error_t (*get_syncinfo) (struct syncinfo *si);

error_t (*set_options) (display_flags flags);

error_t (*get_options) (display_flags *flags);


> };
> 

(basically read man fb.modes :))

Cheers,

Peter.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]