From 3ce90a8f864c906637097fc175485cca9dc3af97 Mon Sep 17 00:00:00 2001 From: Brett Gordon Date: Fri, 2 Oct 2015 01:13:54 -0400 Subject: [PATCH] coco3: add primordial graphics ioctl to devtty --- Kernel/platform-coco3/devtty.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Kernel/platform-coco3/devtty.c b/Kernel/platform-coco3/devtty.c index 0c21bbe3..b766c1bf 100644 --- a/Kernel/platform-coco3/devtty.c +++ b/Kernel/platform-coco3/devtty.c @@ -8,6 +8,7 @@ #include #include #include +#include #undef DEBUG /* UNdefine to delete debug code sequences */ @@ -433,6 +434,29 @@ unsigned char vt_map(unsigned char c) return c; } +static struct display display = { + 256, 192, + 256, 192, + 0xFF, 0xFF, /* For now */ + FMT_MONO_BW, + HW_UNACCEL, + GFX_ENABLE, + 0, + GFX_SETPIXEL, + 0 +}; + + +int gfx_ioctl(uint8_t minor, uarg_t arg, char *ptr) +{ + if (arg >> 8 != 0x03) + return vt_ioctl(minor, arg, ptr); + if (arg == GFXIOC_GETINFO) + return uput(&display, ptr, sizeof(display)); + udata.u_error = ENOTTY; + return -1; +} + /* Initial Setup stuff down here. */ -- 2.34.1