/*
* Copyright (c) 2006, Miodrag Vallat.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* dumb graphics routines for frame buffer on HP362 and HP382 based on tvrx.c
*/
/*
* Initialize hardware and display routines.
*/
static int
gendiofb_reset(struct diofb *fb, int scode, struct diofbreg *fbr)
{
int rc;
struct rasops_info *ri = &fb->ri;
if ((rc = diofb_fbinquire(fb, scode, fbr)) != 0)
return (rc);
/*
* We rely on the PROM to initialize the frame buffer in the mode
* we expect it: cleared, overlay plane enabled and accessible
* at the beginning of the video memory.
*
* This is NOT the mode we would end up by simply resetting the
* board.
*/
/*
* Ask for an unholy big display, rasops will trim this to more
* reasonable values.
*/
rasops_init(ri, 160, 160);
ri->ri_flg |= RI_FORCEMONO; /* no colormap */