root/dev/vesa/vbe.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


    1 /*
    2  * Copyright (c) 2007 Gordon Willem Klok <gwk@openbsd.org>
    3  *
    4  * Permission to use, copy, modify, and distribute this software for any
    5  * purpose with or without fee is hereby granted, provided that the above
    6  * copyright notice and this permission notice appear in all copies.
    7  *
    8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   15  */
   16 
   17 /*
   18  * Information taken from VESA Bios Extention (VBE) Core Functions Standard
   19  * Version 3.0 found at http://www.vesa.org/public/VBE/vbe3.pdf
   20  */
   21 #ifndef VBE_H
   22 #define VBE_H
   23 
   24 #define BIOS_VIDEO_INTR                 0x10
   25 
   26 /* A well know address to locate a page at in the vm86 task */
   27 #define KVM86_CALL_TASKVA               0x2000
   28 
   29 /* Information contained in AH following a VBE function call */
   30 /* Low byte determins call support */
   31 #define VBECALL_SUPPORT(v)              (v & 0xff)
   32 #define VBECALL_SUPPORTED               0x4f
   33 
   34 /* High byte determins call sucess */
   35 #define VBECALL_SUCESS(v)               (v >> 8 & 0xFF)
   36 #define VBECALL_SUCCEDED                0x00
   37 #define VBECALL_FAILED                  0x01
   38 #define VBECALL_MISMATCH                0x02 /* BIOS SUPPORTS HW DOES NOT */
   39 #define VBECALL_INVALID                 0x03 /* INVALID IN CURRENT MODE */
   40 
   41 /* VBE Standard Function Calls */
   42 #define VBE_FUNC_CTRLINFO               0x4F00
   43 #define VBE_FUNC_MODEINFO               0x4F01
   44 #define VBE_FUNC_SETMODE                0x4F02
   45 #define VBE_FUNC_GETMODE                0x4F03
   46 #define VBE_FUNC_SAVEREST               0x4F04
   47 #define VBE_FUNC_DWC                    0x4F05 /* Display window control */
   48 #define VBE_FUNC_LSLL                   0x4F06 /* Logical Scan Line Length */
   49 #define VBE_FUNC_START                  0x4F07 /* Set/Get Display Start */
   50 #define VBE_FUNC_DAC                    0x4F08 /* Set/Get DAC Pallete Format */
   51 #define VBE_FUNC_PALETTE                0x4F09 /* Set/Get Pallete Data */
   52 #define VBE_FUNC_PMI                    0x4F0A /* Protected Mode Interface */
   53 #define VBE_FUNC_PIXELCLOCK             0x4F0B
   54 
   55 /* VBE Supplemental Function Calls */
   56 #define VBE_FUNC_PM                     0x4F10 /* Power Management Interface */
   57 #define VBE_FUNC_FLATPANEL              0x4F11 /* Flat Panel Interface */
   58 #define VBE_FUNC_AUDIO                  0x4F13 /* Audio Interface */
   59 #define VBE_FUNC_OEM                    0x4F14 /* OEM Extentions */
   60 #define VBE_FUNC_DDC                    0x4F15 /* Display Data Channel (DDC) */
   61 
   62 #define VBE_CTRLINFO_VERSION(v)         (v >> 8)
   63 #define VBE_CTRLINFO_REVISION(v)        (v & 0xff)
   64 #define VBE_DDC_GET                     0x01
   65 
   66 struct edid_chroma {
   67         uint8_t chroma_rglow;
   68         uint8_t chroma_bwlow;
   69         uint8_t chroma_redx;
   70         uint8_t chroma_redy;
   71         uint8_t chroma_greenx;
   72         uint8_t chroma_greeny;
   73         uint8_t chroma_bluex;
   74         uint8_t chroma_bluey;
   75         uint8_t chroma_whitex;
   76         uint8_t chroma_whitey;
   77 } __packed;
   78 
   79 struct edid_db {
   80         uint16_t db_pixelclock;
   81         uint8_t db_stor[16];
   82 } __packed;
   83 
   84 #define EDID_DB_FLAG_INTERLACED         0x80
   85 #define EDID_DB_FLAG_STEREO             0x10
   86 #define EDID_DB_POSITIVE_HSYNC          0x04
   87 #define EDID_DB_POSITIVE_VSYNC          0x02
   88 
   89 /* Types of Descriptor Blocks */
   90 #define EDID_DB_BT_MONSERIAL            0xff
   91 #define EDID_DB_BT_ASCIISTR             0xfe
   92 #define EDID_DB_BT_RANGELIMITS          0xfd
   93 #define EDID_DB_BT_MONITORNAME          0xfc
   94 #define EDID_DB_BT_COLORPOINT           0xfb
   95 #define EDID_DB_BT_STDTIMEDATA          0xfa
   96 #define EDID_DB_BT_UNDEF                0xf9
   97 #define EDID_DB_BT_MANUFDEF             0xf8
   98 
   99 struct edid_ranges {
  100         uint8_t range_minvertfreq;
  101         uint8_t range_maxvertfreq;
  102         uint8_t range_minhorizfreq;
  103         uint8_t range_maxhorizfreq;
  104         uint8_t range_pixelclock;
  105         uint16_t range_secgtftoggle;
  106         uint8_t range_starthorizfreq;
  107         uint8_t range_c;
  108         uint16_t range_m;
  109         uint16_t range_k;
  110         uint16_t range_y;
  111 } __packed;
  112 
  113 struct edid_timing {
  114         uint8_t timing_estb1;
  115         uint8_t timing_estb2;
  116         uint8_t timing_manu;
  117         uint16_t timing_std1;
  118         uint16_t timing_std2;
  119         uint16_t timing_std3;
  120         uint16_t timing_std4;
  121         uint16_t timing_std5;
  122         uint16_t timing_std6;
  123         uint16_t timing_std7;
  124         uint16_t timing_std8;
  125 } __packed;
  126 
  127 struct edid {
  128         uint8_t edid_header[8];
  129         uint16_t edid_manufacture;
  130         uint16_t edid_product;
  131         uint32_t edid_serialno;
  132         uint8_t edid_week;
  133         uint8_t edid_year;
  134         uint8_t edid_version;
  135         uint8_t edid_revision;
  136         uint8_t edid_vidid;
  137         uint8_t edid_maxhoriz_isize;
  138         uint8_t edid_maxvert_isize;
  139         uint8_t edid_gamma;
  140         uint8_t edid_pmfeatures;
  141         struct edid_chroma edid_chroma;
  142         struct edid_timing edid_timing;
  143         struct edid_db edid_db1;
  144         struct edid_db edid_db2;
  145         struct edid_db edid_db3;
  146         struct edid_db edid_db4;
  147         uint8_t edid_extblocks;
  148         uint8_t edid_chksum;
  149 } __packed;
  150 
  151 #endif

/* [<][>][^][v][top][bottom][index][help] */