vga, vesa: revert. this needs to be in aux/vga instead
This commit is contained in:
parent
2cc7c72f8e
commit
04ec990b67
4 changed files with 6 additions and 70 deletions
|
@ -198,17 +198,6 @@ enable or disable the use of DPMS blanking
|
||||||
.B blank
|
.B blank
|
||||||
above).
|
above).
|
||||||
.TP
|
.TP
|
||||||
.BI scaling " mode"
|
|
||||||
Set the GPU scaling
|
|
||||||
.I mode
|
|
||||||
to
|
|
||||||
.BR off ,
|
|
||||||
.B full
|
|
||||||
or
|
|
||||||
.B aspect
|
|
||||||
to either disable scaling, scale to full screen, or
|
|
||||||
to scale while preserving aspect ratio.
|
|
||||||
.TP
|
|
||||||
.BI linear " size align"
|
.BI linear " size align"
|
||||||
Use a linear screen aperture of size
|
Use a linear screen aperture of size
|
||||||
.I size
|
.I size
|
||||||
|
|
|
@ -48,7 +48,6 @@ enum {
|
||||||
CMunblank,
|
CMunblank,
|
||||||
CMsoftscreen,
|
CMsoftscreen,
|
||||||
CMpcidev,
|
CMpcidev,
|
||||||
CMscaling,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static Cmdtab vgactlmsg[] = {
|
static Cmdtab vgactlmsg[] = {
|
||||||
|
@ -68,7 +67,6 @@ static Cmdtab vgactlmsg[] = {
|
||||||
CMunblank, "unblank", 1,
|
CMunblank, "unblank", 1,
|
||||||
CMsoftscreen, "softscreen", 2,
|
CMsoftscreen, "softscreen", 2,
|
||||||
CMpcidev, "pcidev", 2,
|
CMpcidev, "pcidev", 2,
|
||||||
CMscaling, "scaling", 2,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -307,19 +305,6 @@ vgactl(Cmdbuf *cb)
|
||||||
error(Ebadarg);
|
error(Ebadarg);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case CMscaling:
|
|
||||||
if(scr != nil && scr->dev != nil){
|
|
||||||
if(scr->dev->scaling == nil)
|
|
||||||
error("scaling not supported");
|
|
||||||
else if(strcmp(cb->f[1], "aspect") == 0)
|
|
||||||
scr->dev->scaling(scr, Saspect);
|
|
||||||
else if(strcmp(cb->f[1], "full") == 0)
|
|
||||||
scr->dev->scaling(scr, Sfull);
|
|
||||||
else if(strcmp(cb->f[1], "off") == 0)
|
|
||||||
scr->dev->scaling(scr, Soff);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
|
|
||||||
case CMtype:
|
case CMtype:
|
||||||
for(i = 0; vgadev[i]; i++){
|
for(i = 0; vgadev[i]; i++){
|
||||||
if(strcmp(cb->f[1], vgadev[i]->name))
|
if(strcmp(cb->f[1], vgadev[i]->name))
|
||||||
|
|
|
@ -49,15 +49,6 @@ enum {
|
||||||
Pwhite = 0xFF,
|
Pwhite = 0xFF,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Scaling modes.
|
|
||||||
*/
|
|
||||||
enum {
|
|
||||||
Soff,
|
|
||||||
Sfull,
|
|
||||||
Saspect,
|
|
||||||
};
|
|
||||||
|
|
||||||
#define VGAMEM() 0xA0000
|
#define VGAMEM() 0xA0000
|
||||||
#define vgai(port) inb(port)
|
#define vgai(port) inb(port)
|
||||||
#define vgao(port, data) outb(port, data)
|
#define vgao(port, data) outb(port, data)
|
||||||
|
@ -83,7 +74,6 @@ struct VGAdev {
|
||||||
void (*ovlctl)(VGAscr*, Chan*, void*, int);
|
void (*ovlctl)(VGAscr*, Chan*, void*, int);
|
||||||
int (*ovlwrite)(VGAscr*, void*, int, vlong);
|
int (*ovlwrite)(VGAscr*, void*, int, vlong);
|
||||||
void (*flush)(VGAscr*, Rectangle);
|
void (*flush)(VGAscr*, Rectangle);
|
||||||
void (*scaling)(VGAscr*, int);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VGAcur {
|
struct VGAcur {
|
||||||
|
|
|
@ -23,7 +23,6 @@ enum {
|
||||||
Cdisable = 0,
|
Cdisable = 0,
|
||||||
Cenable,
|
Cenable,
|
||||||
Cblank,
|
Cblank,
|
||||||
Cscaling,
|
|
||||||
|
|
||||||
RealModeBuf = 0x9000,
|
RealModeBuf = 0x9000,
|
||||||
};
|
};
|
||||||
|
@ -33,7 +32,6 @@ static Chan *creg, *cmem;
|
||||||
static QLock vesaq;
|
static QLock vesaq;
|
||||||
static Rendez vesar;
|
static Rendez vesar;
|
||||||
static int vesactl;
|
static int vesactl;
|
||||||
static int scaling;
|
|
||||||
|
|
||||||
#define WORD(p) ((p)[0] | ((p)[1]<<8))
|
#define WORD(p) ((p)[0] | ((p)[1]<<8))
|
||||||
#define LONG(p) ((p)[0] | ((p)[1]<<8) | ((p)[2]<<16) | ((p)[3]<<24))
|
#define LONG(p) ((p)[0] | ((p)[1]<<8) | ((p)[2]<<16) | ((p)[3]<<24))
|
||||||
|
@ -185,17 +183,11 @@ vesaproc(void*)
|
||||||
sleep(&vesar, gotctl, &ctl);
|
sleep(&vesar, gotctl, &ctl);
|
||||||
ctl = vesactl;
|
ctl = vesactl;
|
||||||
|
|
||||||
if(ctl == Cscaling){
|
|
||||||
vbesetup(&u, 0x4f14);
|
|
||||||
u.bx = 0x102;
|
|
||||||
u.cx = scaling;
|
|
||||||
}else{
|
|
||||||
vbesetup(&u, 0x4f10);
|
vbesetup(&u, 0x4f10);
|
||||||
if(ctl == Cblank)
|
if(ctl == Cblank)
|
||||||
u.bx = 0x0101;
|
u.bx = 0x0101;
|
||||||
else
|
else
|
||||||
u.bx = 0x0001;
|
u.bx = 0x0001;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dont wait forever here. some BIOS get stuck
|
* dont wait forever here. some BIOS get stuck
|
||||||
|
@ -260,21 +252,6 @@ vesablank(VGAscr *, int blank)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
vesascaling(VGAscr *, int mode)
|
|
||||||
{
|
|
||||||
if(vesactl != Cdisable){
|
|
||||||
vesactl = Cscaling;
|
|
||||||
if(mode == Soff)
|
|
||||||
scaling = 1;
|
|
||||||
else if(mode == Saspect)
|
|
||||||
scaling = 3;
|
|
||||||
else if(mode == Sfull)
|
|
||||||
scaling = 0;
|
|
||||||
wakeup(&vesar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vesadrawinit(VGAscr *scr)
|
vesadrawinit(VGAscr *scr)
|
||||||
{
|
{
|
||||||
|
@ -285,12 +262,7 @@ VGAdev vgavesadev = {
|
||||||
"vesa",
|
"vesa",
|
||||||
vesaenable,
|
vesaenable,
|
||||||
vesadisable,
|
vesadisable,
|
||||||
nil,
|
0,
|
||||||
vesalinear,
|
vesalinear,
|
||||||
vesadrawinit,
|
vesadrawinit,
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
vesascaling,
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue