summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyr.c
diff options
context:
space:
mode:
authorMatthew Allum <mallum@polystyrene.(none)>2006-07-08 21:10:58 +0100
committerMatthew Allum <mallum@polystyrene.(none)>2006-07-08 21:10:58 +0100
commite8056218944e873135c93039d1e9646d51364467 (patch)
tree5b60e0e7bb9f9f6ab30ebb483a01b21c11e3655c /hw/kdrive/ephyr/ephyr.c
parent5416f90e9c939027005fc01fa3ce3df56919ae0d (diff)
Add support to Xephyr for simulating 8bit grayscale.
Diffstat (limited to 'hw/kdrive/ephyr/ephyr.c')
-rw-r--r--hw/kdrive/ephyr/ephyr.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index a9ea0eb0c..fbb16a465 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -40,6 +40,8 @@ extern DeviceIntPtr pKdKeyboard;
static int mouseState = 0;
+Bool EphyrWantGrayScale = 0;
+
Bool
ephyrInitialize (KdCardInfo *card, EphyrPriv *priv)
{
@@ -80,7 +82,10 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
screen->width = width;
screen->height = height;
}
-
+
+ if (EphyrWantGrayScale)
+ screen->fb[0].depth = 8;
+
if (screen->fb[0].depth && screen->fb[0].depth != hostx_get_depth())
{
if (screen->fb[0].depth < hostx_get_depth()
@@ -98,12 +103,15 @@ ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv)
if (screen->fb[0].depth <= 8)
{
- screen->fb[0].visuals = ((1 << StaticGray) |
- (1 << GrayScale) |
- (1 << StaticColor) |
- (1 << PseudoColor) |
- (1 << TrueColor) |
- (1 << DirectColor));
+ if (EphyrWantGrayScale)
+ screen->fb[0].visuals = ((1 << StaticGray) | (1 << GrayScale));
+ else
+ screen->fb[0].visuals = ((1 << StaticGray) |
+ (1 << GrayScale) |
+ (1 << StaticColor) |
+ (1 << PseudoColor) |
+ (1 << TrueColor) |
+ (1 << DirectColor));
screen->fb[0].redMask = 0x00;
screen->fb[0].greenMask = 0x00;