bug-hurd
[Top][All Lists]
Advanced

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

Re: SVGA console


From: Marco Gerards
Subject: Re: SVGA console
Date: 18 Aug 2003 00:02:32 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

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. */


/* 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);

  /* 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);

  /* 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);

  /* 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);

  /* 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);
};

typedef struct display_driver *display_driver_t;

/* Avialable display drivers.  */

/* The VGA driver.  It only supports the minimal VGA hardware, a 25
   and 28 Mhz clock.  This driver is also used by other drivers for
   SVGA cards.  */
display_driver_t display_driver_vga;

/* The driver for S3 videochips.  Only the S3 Trio is currently
   supported.  */
display_driver_t display_driver_s3;





reply via email to

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