/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/video_fb.h>
GRUB_MOD_LICENSE ("GPLv3+");
static struct
{
int mapped;
} framebuffer;
enum
{
};
enum
{
};
#define CIRRUS_HIDDEN_DAC_8BPP 0
| CIRRUS_HIDDEN_DAC_ENABLE_ALL | 0)
| CIRRUS_HIDDEN_DAC_ENABLE_ALL | 1)
| CIRRUS_HIDDEN_DAC_ENABLE_ALL | 5)
static void
{
}
static grub_uint8_t
read_hidden_dac (void)
{
return grub_inb (GRUB_VGA_IO_PIXEL_MASK);
}
struct saved_state
{
/* We need to preserve VGA font and VGA text. */
grub_uint8_t r[256];
grub_uint8_t g[256];
grub_uint8_t b[256];
};
static int state_saved = 0;
static void
{
unsigned i;
for (i = 0; i < 256; i++)
}
static void
{
unsigned i;
for (i = 0; i < 256; i++)
}
static grub_err_t
grub_video_cirrus_video_init (void)
{
/* Reset frame buffer. */
return grub_video_fb_init ();
}
static grub_err_t
grub_video_cirrus_video_fini (void)
{
if (framebuffer.mapped)
if (state_saved)
{
state_saved = 0;
}
return grub_video_fb_fini ();
}
static grub_err_t
{
return GRUB_ERR_NONE;
}
static grub_err_t
struct grub_video_palette_data *palette_data)
{
{
unsigned i;
if (start >= 0x100)
return GRUB_ERR_NONE;
for (i = 0; i < count; i++)
palette_data[i].b);
}
/* Then set color to emulated palette. */
}
static grub_err_t
{
int depth;
int found = 0;
auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__ ((unused)));
{
return 0;
found = 1;
return 1;
}
/* Decode depth from mode_type. If it is zero, then autodetect. */
{
width = 800;
height = 600;
}
return grub_error (GRUB_ERR_IO,
"screen width must be a multiple of %d",
if (width > CIRRUS_MAX_WIDTH)
return grub_error (GRUB_ERR_IO,
"screen width must be at most %d", CIRRUS_MAX_WIDTH);
if (height > CIRRUS_MAX_HEIGHT)
return grub_error (GRUB_ERR_IO,
"screen height must be at most %d", CIRRUS_MAX_HEIGHT);
if (depth == 0
depth = 24;
if (depth == 0)
depth = 8;
" supported by cirrus video");
if (pitch > CIRRUS_MAX_PITCH)
return grub_error (GRUB_ERR_IO,
"screen width must be at most %d at bitdepth %d",
if (!found)
{
/* FIXME: change framebuffer base */
}
/* We can safely discard volatile attribute. */
if (!state_saved)
{
state_saved = 1;
}
{
.line_compare = 0x3ff,
};
switch (depth)
{
/* FIXME: support 8-bit grayscale and 8-bit RGB. */
case 32:
break;
case 24:
break;
case 16:
break;
case 15:
break;
case 8:
break;
}
}
/* Fill mode info details. */
switch (depth)
{
case 8:
break;
case 16:
break;
case 15:
break;
case 32:
case 24:
break;
}
else
framebuffer.ptr, 0, 0);
/* Copy default palette to initialize emulated palette. */
return err;
}
{
.name = "Cirrus CLGD 5446 PCI Video Driver",
.next = 0
};
{
}
{
}