Add an ioctl interface for setting video mode
This commit is contained in:
parent
0a7b779340
commit
dca9c2b9d3
@ -5,6 +5,7 @@
|
||||
#define IO_VID_DEPTH 0x5003
|
||||
#define IO_VID_ADDR 0x5004
|
||||
#define IO_VID_SIGNAL 0x5005
|
||||
#define IO_VID_SET 0x5006
|
||||
|
||||
#ifdef _KERNEL_
|
||||
extern void lfb_set_resolution(uint16_t x, uint16_t y);
|
||||
|
@ -36,6 +36,8 @@ static uint16_t bochs_current_scroll(void);
|
||||
|
||||
static pid_t display_change_recipient = 0;
|
||||
|
||||
void lfb_set_resolution(uint16_t x, uint16_t y);
|
||||
|
||||
/*
|
||||
* Address of the linear frame buffer.
|
||||
* This can move, so it's a pointer instead of
|
||||
@ -43,6 +45,11 @@ static pid_t display_change_recipient = 0;
|
||||
*/
|
||||
uint8_t * lfb_vid_memory = (uint8_t *)0xE0000000;
|
||||
|
||||
struct vid_size {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
};
|
||||
|
||||
static int ioctl_vid(fs_node_t * node, int request, void * argp) {
|
||||
/* TODO: Make this actually support multiple video devices */
|
||||
|
||||
@ -67,6 +74,10 @@ static int ioctl_vid(fs_node_t * node, int request, void * argp) {
|
||||
/* ioctl to register for a signal (vid device change? idk) on display change */
|
||||
display_change_recipient = getpid();
|
||||
return 0;
|
||||
case IO_VID_SET:
|
||||
validate(argp);
|
||||
lfb_set_resolution(((struct vid_size *)argp)->width, ((struct vid_size *)argp)->height);
|
||||
return 0;
|
||||
default:
|
||||
return -1; /* TODO EINV... something or other */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user