Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
7834 uts: vgatext should use gfx_private
Reviewed by: Yuri Pankov <yuripv@gmx.com> Reviewed by: John Howard <Echosoft.LLC@gmail.com> Reviewed by: Alexander Eremin <a.eremin@nexenta.com> Approved by: Joshua M. Clulow <josh@sysmgr.org>
- Loading branch information
Showing
12 changed files
with
370 additions
and
1,345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* This file and its contents are supplied under the terms of the | ||
* Common Development and Distribution License ("CDDL"), version 1.0. | ||
* You may only use this file in accordance with the terms of version | ||
* 1.0 of the CDDL. | ||
* | ||
* A full copy of the text of the CDDL should have accompanied this | ||
* source. A copy of the CDDL is also available via the Internet at | ||
* http://www.illumos.org/license/CDDL. | ||
*/ | ||
|
||
/* | ||
* Copyright 2016 Toomas Soome <tsoome@me.com> | ||
*/ | ||
|
||
/* | ||
* Generic framebuffer interface. Implementing common interfaces | ||
* for bitmapped frame buffer and vgatext. | ||
*/ | ||
#include <sys/types.h> | ||
#include <sys/ddi.h> | ||
#include <sys/sunddi.h> | ||
#include <sys/visual_io.h> | ||
#include <sys/vgareg.h> | ||
#include <sys/vgasubr.h> | ||
|
||
#include <sys/gfx_private.h> | ||
#include "gfxp_fb.h" | ||
|
||
/* need to keep vgatext symbols for compatibility */ | ||
#pragma weak gfxp_vgatext_softc_alloc = gfxp_fb_softc_alloc | ||
#pragma weak gfxp_vgatext_softc_free = gfxp_fb_softc_free | ||
#pragma weak gfxp_vgatext_attach = gfxp_fb_attach | ||
#pragma weak gfxp_vgatext_detach = gfxp_fb_detach | ||
#pragma weak gfxp_vgatext_open = gfxp_fb_open | ||
#pragma weak gfxp_vgatext_close = gfxp_fb_close | ||
#pragma weak gfxp_vgatext_ioctl = gfxp_fb_ioctl | ||
#pragma weak gfxp_vgatext_devmap = gfxp_fb_devmap | ||
|
||
gfxp_fb_softc_ptr_t | ||
gfxp_fb_softc_alloc(void) | ||
{ | ||
return (kmem_zalloc(sizeof (struct gfxp_fb_softc), KM_SLEEP)); | ||
} | ||
|
||
void | ||
gfxp_fb_softc_free(gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
kmem_free(ptr, sizeof (struct gfxp_fb_softc)); | ||
} | ||
|
||
int | ||
gfxp_fb_attach(dev_info_t *devi, ddi_attach_cmd_t cmd, gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
return (gfxp_vga_attach(devi, cmd, ptr)); | ||
} | ||
|
||
int | ||
gfxp_fb_detach(dev_info_t *devi, ddi_detach_cmd_t cmd, gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
return (gfxp_vga_detach(devi, cmd, ptr)); | ||
} | ||
|
||
/*ARGSUSED*/ | ||
int | ||
gfxp_fb_open(dev_t *devp, int flag, int otyp, cred_t *cred, | ||
gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
struct gfxp_fb_softc *softc = (struct gfxp_fb_softc *)ptr; | ||
|
||
if (softc == NULL || otyp == OTYP_BLK) | ||
return (ENXIO); | ||
|
||
return (0); | ||
} | ||
|
||
/*ARGSUSED*/ | ||
int | ||
gfxp_fb_close(dev_t devp, int flag, int otyp, cred_t *cred, | ||
gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
return (0); | ||
} | ||
|
||
int | ||
gfxp_fb_ioctl(dev_t dev, int cmd, intptr_t data, int mode, | ||
cred_t *cred, int *rval, gfxp_fb_softc_ptr_t ptr) | ||
{ | ||
return (gfxp_vga_ioctl(dev, cmd, data, mode, cred, rval, ptr)); | ||
} | ||
|
||
int | ||
gfxp_fb_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, | ||
size_t len, size_t *maplen, uint_t model, void *ptr) | ||
{ | ||
return (gfxp_vga_devmap(dev, dhp, off, len, maplen, model, ptr)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* This file and its contents are supplied under the terms of the | ||
* Common Development and Distribution License ("CDDL"), version 1.0. | ||
* You may only use this file in accordance with the terms of version | ||
* 1.0 of the CDDL. | ||
* | ||
* A full copy of the text of the CDDL should have accompanied this | ||
* source. A copy of the CDDL is also available via the Internet at | ||
* http://www.illumos.org/license/CDDL. | ||
*/ | ||
|
||
/* | ||
* Copyright 2016 Toomas Soome <tsoome@me.com> | ||
*/ | ||
|
||
#ifndef _GFXP_FB_H | ||
#define _GFXP_FB_H | ||
|
||
/* | ||
* gfxp_fb interfaces. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define TEXT_ROWS 25 | ||
#define TEXT_COLS 80 | ||
|
||
struct gfxp_fb_softc { | ||
struct vgaregmap regs; | ||
struct vgaregmap fb; | ||
off_t fb_size; | ||
int fb_regno; | ||
dev_info_t *devi; | ||
int mode; /* KD_TEXT or KD_GRAPHICS */ | ||
caddr_t text_base; /* hardware text base */ | ||
char shadow[TEXT_ROWS*TEXT_COLS*2]; | ||
caddr_t current_base; /* hardware or shadow */ | ||
struct { | ||
boolean_t visible; | ||
int row; | ||
int col; | ||
} cursor; | ||
struct vis_polledio polledio; | ||
struct { | ||
unsigned char red; | ||
unsigned char green; | ||
unsigned char blue; | ||
} colormap[VGA8_CMAP_ENTRIES]; | ||
unsigned char attrib_palette[VGA_ATR_NUM_PLT]; | ||
unsigned int flags; | ||
kmutex_t lock; | ||
}; | ||
|
||
/* function definitions */ | ||
int gfxp_vga_attach(dev_info_t *, ddi_attach_cmd_t, gfxp_fb_softc_ptr_t); | ||
int gfxp_vga_detach(dev_info_t *, ddi_detach_cmd_t, gfxp_fb_softc_ptr_t); | ||
int gfxp_vga_ioctl(dev_t, int, intptr_t, int, cred_t *, int *, | ||
gfxp_fb_softc_ptr_t); | ||
int gfxp_vga_devmap(dev_t, devmap_cookie_t, offset_t, size_t, size_t *, | ||
uint_t, void *); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _GFXP_FB_H */ |
Oops, something went wrong.