NetBSD/sys/arch/arm/iomd/vidc20config.c.old-stuff

208 lines
4.1 KiB
Plaintext

/************************************************************
* OLD STUFF *
************************************************************/
/* XXX commented out XXX */
#if 0
int
vidcrender_attach(vc, parent, self, aux)
struct vconsole *vc;
struct device *parent;
struct device *self;
void *aux;
{
vidc_cursor_init ( vc );
vidcrender_flash_go ( vc );
return 0;
}
int
vidcrender_flash_go(void)
{
static int irqclaimed = 0;
static int lock=0;
if (lock==1)
return -1;
lock=0;
if (!irqclaimed) {
cursor_ih.ih_func = vidcrender_cursorintr;
cursor_ih.ih_arg = vc; /* argument ... needed? */
cursor_ih.ih_level = IPL_TTY;
cursor_ih.ih_name = "vsync";
irq_claim ( IRQ_FLYBACK, &cursor_ih );
irqclaimed = 1;
}
cursor_init = 0;
return 0;
}
#endif /* XXX commented out XXX */
/* XXX commented out ... dunno if nessisary XXX */
#if 0
#ifdef NICE_UPDATE
static int need_update = 0;
void
vidcrender_updatecursor(arg)
void *arg;
{
struct vconsole *vc = vconsole_current;
vidcvideo_write(VIDC_HCSR, R_DATA->frontporch-17+ (vc->xcur)*R_DATA->font->pixel_width );
vidcvideo_write(VIDC_VCSR, R_DATA->topporch-2+ (vc->ycur+1)*R_DATA->font->pixel_height-2 + 3
- R_DATA->font->pixel_height);
vidcvideo_write(VIDC_VCER, R_DATA->topporch-2+ (vc->ycur+3)*R_DATA->font->pixel_height+2 + 3 );
return;
}
int
vidcrender_cursorupdate(vc)
struct vconsole *vc;
{
timeout ( vidcrender_updatecursor, NULL, 20 );
return 0;
}
#else
static int
vidcrender_cursorupdate(vc)
struct vconsole *vc;
{
vidcvideo_write(VIDC_HCSR, R_DATA->frontporch-17+ (vc->xcur)*R_DATA->font->pixel_width );
vidcvideo_write(VIDC_VCSR, R_DATA->topporch-2+ (vc->ycur+1)*R_DATA->font->pixel_height-2 + 3
- R_DATA->font->pixel_height);
vidcvideo_write(VIDC_VCER, R_DATA->topporch-2+ (vc->ycur+3)*R_DATA->font->pixel_height+2 + 3 );
return (0);
}
#endif
#endif /* XXX comment out XXX */
/* XXX comment out XXX */
#if 0
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
/*#include <sys/malloc.h>*/
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/map.h>
#include <sys/proc.h>
/*#include <sys/user.h>*/
#include <sys/syslog.h>
/*#include <sys/resourcevar.h>*/
#include <machine/cpu.h>
#include <machine/param.h>
/*#include <machine/katelib.h>*/
/*#include <machine/cpu.h>*/
/*#include <machine/bootconfig.h>*/
/*#include <machine/iomd.h>*/
/*#include <machine/irqhandler.h>*/
/*#include <machine/pmap.h>*/
#include <machine/vidc.h>
#include <machine/vconsole.h>
/* extern struct cfdriver vidcconsole_cd; */
int
vidcvideoopen(dev, flags, fmt, p)
dev_t dev;
int flags;
int fmt;
struct proc *p;
{
struct vidcconsole_softc *sc;
struct vconsole vconsole_new;
int unit = minor(dev);
int s;
if (unit >= vidcconsole_cd.cd_ndevs)
return ENXIO;
sc = vidcconsole_cd.cd_devs[unit];
if (!sc)
return ENXIO;
s = spltty();
/* if (sc->sc_opened) {
(void)splx(s);
return(EBUSY);
}*/
++sc->sc_opened;
(void)splx(s);
if (sc->sc_opened == 1) {
vconsole_new = *vconsole_default;
vconsole_new.render_engine = &vidcrender;
vconsole_spawn_re (
makedev ( physcon_major, 64 + minor(dev) ),
&vconsole_new );
} else {
log(LOG_WARNING, "Multiple open of/dev/vidcconsole0 by proc %d\n", p->p_pid);
}
return 0;
}
int
vidcconsoleclose(dev, flags, fmt, p)
dev_t dev;
int flags;
int fmt;
struct proc *p;
{
struct vidcconsole_softc *sc;
int unit = minor(dev);
int s;
if ( unit >= vidcconsole_cd.cd_ndevs )
return ENXIO;
sc = vidcconsole_cd.cd_devs[unit];
if (!sc)
return ENXIO;
s = spltty();
--sc->sc_opened;
(void)splx(s);
return 0;
}
extern int physconioctl __P((dev_t, int, caddr_t, int, struct proc *));
int
vidcconsoleioctl(dev, cmd, data, flag, p)
dev_t dev;
int cmd;
caddr_t data;
int flag;
struct proc *p;
{
dev = makedev(physcon_major, 64 + minor(dev));
return(physconioctl(dev, cmd, data, flag, p));
}
extern paddr_t physconmmap __P((dev_t, off_t, int));
paddr_t
vidcconsolemmap(dev, offset, prot)
dev_t dev;
off_t offset;
int prot;
{
dev = makedev(physcon_major, 64 + minor(dev));
return(physconmmap(dev, offset, prot));
}
#endif /* XXX comment out XXX */