diff options
Diffstat (limited to 'xorg-server/hw/kdrive/ephyr/hostx.c')
-rwxr-xr-x | xorg-server/hw/kdrive/ephyr/hostx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xorg-server/hw/kdrive/ephyr/hostx.c b/xorg-server/hw/kdrive/ephyr/hostx.c index 7a3338f11..0baf35929 100755 --- a/xorg-server/hw/kdrive/ephyr/hostx.c +++ b/xorg-server/hw/kdrive/ephyr/hostx.c @@ -84,8 +84,6 @@ struct EphyrHostXVars { KdScreenInfo **screens; long damage_debug_msec; - - unsigned long cmap[256]; }; /* memset ( missing> ) instead of below */ @@ -761,9 +759,12 @@ hostx_calculate_color_shift(unsigned long mask) } void -hostx_set_cmap_entry(unsigned char idx, +hostx_set_cmap_entry(ScreenPtr pScreen, unsigned char idx, unsigned char r, unsigned char g, unsigned char b) { + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + EphyrScrPriv *scrpriv = screen->driver; /* need to calculate the shifts for RGB because server could be BGR. */ /* XXX Not sure if this is correct for 8 on 16, but this works for 8 on 24.*/ static int rshift, bshift, gshift = 0; @@ -775,7 +776,7 @@ hostx_set_cmap_entry(unsigned char idx, gshift = hostx_calculate_color_shift(HostX.visual->green_mask); bshift = hostx_calculate_color_shift(HostX.visual->blue_mask); } - HostX.cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | + scrpriv->cmap[idx] = ((r << rshift) & HostX.visual->red_mask) | ((g << gshift) & HostX.visual->green_mask) | ((b << bshift) & HostX.visual->blue_mask); } @@ -1035,7 +1036,7 @@ hostx_paint_rect(KdScreenInfo *screen, unsigned char pixel = *(unsigned char *) (scrpriv->fb_data + idx); xcb_image_put_pixel(scrpriv->ximg, x, y, - HostX.cmap[pixel]); + scrpriv->cmap[pixel]); break; } default: |