vgaprobe.c revision 30f5cf21f0e4186919b67ac48223d09ca110f8fe
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/controlregs.h>
#include <sys/bootconf.h>
#include "multiboot.h"
#include "bootprop.h"
#include "biosint.h"
#include "machine.h"
#include "standalloc.h"
#include "console.h"
#include "util.h"
#include "debug.h"
#define VESABIOS_SUPP_FUNC 0x4f
#define VESABIOS_DISPLAY_ID_EXT 0x15
#pragma pack(1)
/*
* Structure returned by monitors that support VESA DDC
*/
struct EDIFinfo {
unsigned char hdr[8];
unsigned short mfname; /* EISA style compressed id */
unsigned short pid;
unsigned long serialno;
char mfweek;
unsigned char mfyear;
unsigned char edidver;
unsigned char edidrev;
unsigned char vidindef;
unsigned char maxHimagesz; /* cm */
unsigned char maxVimagesz; /* cm */
unsigned char displayxferchar;
unsigned char DPMSfeat;
unsigned char RGlowbits;
unsigned char BWlowbits;
unsigned char redx;
unsigned char redy;
unsigned char greenx;
unsigned char greeny;
unsigned char bluex;
unsigned char bluey;
unsigned char whitex;
unsigned char whitey;
unsigned char esttimings1;
unsigned char esttimings2;
unsigned char rsvdtimings;
short stdtimingid1;
short stdtimingid2;
short stdtimingid3;
short stdtimingid4;
short stdtimingid5;
short stdtimingid6;
short stdtimingid7;
short stdtimingid8;
unsigned char dettimingdesc1[18];
unsigned char dettimingdesc2[18];
unsigned char dettimingdesc3[18];
unsigned char dettimingdesc4[18];
unsigned char extflg;
unsigned char chksum;
};
#pragma pack()
/*
* in common with the bios.
*
* Current memory layout:
* 1mb: multiboot
* 0x6000: our scratch memory
* 0x5000: stack, grows downward
* 0x2000: biosint
* 0x1000: bios
*/
#define LOMEM_SCRATCH_ADDR 0x6000
int (*bios_doint)(int, struct int_pb *);
static const char hextab[] = "0123456789ABCDEF";
static void
{
/*
* Expand an EISA device name
*
* This converts a 32-bit EISA device "id" to a
* 7-byte ASCII device name, which is stored at "np".
*/
*np = 0;
}
void
vga_probe(void)
{
int ret;
char *fp;
char name[8];
/*
* See what level of VESA DDC is supported (if any)
*/
dprintf("vga probe report ddc: ret=%0x ax=0x%x dx=0x%x\n",
/*
*/
/*
* Get VESA DDC EDIF info
*/
dprintf("addr 0x%p, seg 0x%lx, off 0x%lx\n",
"vga probe read edid: ret=%0x ax=0x%x dx=0x%x\n",
dprintf("display-edif-block: len %d\n",
sizeof (struct EDIFinfo));
/*
* Set edif id as a property
*/
}
}
}
}