summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2011-05-31 18:59:37 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2011-05-31 18:59:37 -0400
commit14549e2deed5a097d9ab3483b966efe112b9db71 (patch)
treef76a916a00cfe5a457b9ad0e2df07da3c56c9383
parent085f23b2bdd4221a76028141d076a8c1dfd901bc (diff)
Update depth checking logic to reflect the fact that we only accept 32bpp.
-rw-r--r--src/xenfb_server.c59
1 files changed, 7 insertions, 52 deletions
diff --git a/src/xenfb_server.c b/src/xenfb_server.c
index 69c3d9e..f79ff8c 100644
--- a/src/xenfb_server.c
+++ b/src/xenfb_server.c
@@ -365,7 +365,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
fb_len, fb_len_lim);
fb_len = fb_len_lim;
}
- if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
+ if (depth != 32) {
xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
depth);
return -1;
@@ -404,51 +404,6 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
return 0;
}
-/* A convenient function for munging pixels between different depths */
-#define BLT(SRC_T,DST_T,RSB,GSB,BSB,RDB,GDB,BDB) \
- for (line = y ; line < (y+h) ; line++) { \
- SRC_T *src = (SRC_T *)(xenfb->pixels \
- + xenfb->offset \
- + (line * xenfb->row_stride) \
- + (x * xenfb->depth / 8)); \
- DST_T *dst = (DST_T *)(data \
- + (line * linesize) \
- + (x * bpp / 8)); \
- int col; \
- const int RSS = 32 - (RSB + GSB + BSB); \
- const int GSS = 32 - (GSB + BSB); \
- const int BSS = 32 - (BSB); \
- const uint32_t RSM = (~0U) << (32 - RSB); \
- const uint32_t GSM = (~0U) << (32 - GSB); \
- const uint32_t BSM = (~0U) << (32 - BSB); \
- const int RDS = 32 - (RDB + GDB + BDB); \
- const int GDS = 32 - (GDB + BDB); \
- const int BDS = 32 - (BDB); \
- const uint32_t RDM = (~0U) << (32 - RDB); \
- const uint32_t GDM = (~0U) << (32 - GDB); \
- const uint32_t BDM = (~0U) << (32 - BDB); \
- for (col = x ; col < (x+w) ; col++) { \
- uint32_t spix = *src; \
- *dst = (((spix << RSS) & RSM & RDM) >> RDS) | \
- (((spix << GSS) & GSM & GDM) >> GDS) | \
- (((spix << BSS) & BSM & BDM) >> BDS); \
- src = (SRC_T *) ((unsigned long) src + xenfb->depth / 8); \
- dst = (DST_T *) ((unsigned long) dst + bpp / 8); \
- } \
- }
-
-
-/*
- * This copies data from the guest framebuffer region, into QEMU's
- * displaysurface. qemu uses 16 or 32 bpp. In case the pv framebuffer
- * uses something else we must convert and copy, otherwise we can
- * supply the buffer directly and no thing here.
- */
-static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h)
-{
- xen_linpicker_fb_update(xenfb, x, y, w, h);
-}
-
#ifdef XENFB_TYPE_REFRESH_PERIOD
static int xenfb_queue_full(struct XenFB *xenfb)
{
@@ -541,15 +496,15 @@ static void xenfb_update(void *opaque)
/* run queued updates */
if (xenfb->up_fullscreen) {
xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
- xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
+ xen_linpicker_fb_update(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
for (i = 0; i < xenfb->up_count; i++)
- xenfb_guest_copy(xenfb,
- xenfb->up_rects[i].x,
- xenfb->up_rects[i].y,
- xenfb->up_rects[i].w,
- xenfb->up_rects[i].h);
+ xen_linpicker_fb_update(xenfb,
+ xenfb->up_rects[i].x,
+ xenfb->up_rects[i].y,
+ xenfb->up_rects[i].w,
+ xenfb->up_rects[i].h);
} else {
xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
}