@@ -616,9 +616,10 @@ struct vmsvga_cursor_definition_s {
uint32_t width;
uint32_t height;
int id;
- uint32_t bpp;
int hot_x;
int hot_y;
+ uint32_t and_mask_bpp; // Value must be 1 or equal to BITS_PER_PIXEL
+ uint32_t xor_mask_bpp; // Value must be 1 or equal to BITS_PER_PIXEL
uint32_t and_mask[1024];
uint32_t xor_mask[4096];
};
@@ -636,7 +637,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
qc = cursor_alloc(c->width, c->height);
qc->hot_x = c->hot_x;
qc->hot_y = c->hot_y;
- switch (c->bpp) {
+ switch (c->xor_mask_bpp) {
case 1:
cursor_set_mono(qc, 0xffffff, 0x000000, (void *)c->xor_mask,
1, (void *)c->and_mask);
@@ -659,7 +660,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
break;
default:
fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n",
- __func__, c->bpp);
+ __func__, c->xor_mask_bpp);
cursor_put(qc);
qc = cursor_builtin_left_ptr();
}
@@ -794,15 +795,18 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
cursor.hot_y = vmsvga_fifo_read(s);
cursor.width = x = vmsvga_fifo_read(s);
cursor.height = y = vmsvga_fifo_read(s);
- vmsvga_fifo_read(s);
- cursor.bpp = vmsvga_fifo_read(s);
+ cursor.and_mask_bpp = vmsvga_fifo_read(s);
+ cursor.xor_mask_bpp = vmsvga_fifo_read(s);
- args = SVGA_BITMAP_SIZE(x, y) + SVGA_PIXMAP_SIZE(x, y, cursor.bpp);
+ args = SVGA_PIXMAP_SIZE(x, y, cursor.and_mask_bpp) +
+ SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask_bpp);
if (cursor.width > 256
|| cursor.height > 256
- || cursor.bpp > 32
- || SVGA_BITMAP_SIZE(x, y) > ARRAY_SIZE(cursor.and_mask)
- || SVGA_PIXMAP_SIZE(x, y, cursor.bpp)
+ || cursor.and_mask_bpp > 32
+ || cursor.xor_mask_bpp > 32
+ || SVGA_PIXMAP_SIZE(x, y, cursor.and_mask_bpp)
+ > ARRAY_SIZE(cursor.and_mask)
+ || SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask_bpp)
> ARRAY_SIZE(cursor.xor_mask)) {
goto badcmd;
}
@@ -812,10 +816,10 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
goto rewind;
}
- for (args = 0; args < SVGA_BITMAP_SIZE(x, y); args++) {
+ for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.and_mask_bpp); args++) {
cursor.and_mask[args] = vmsvga_fifo_read_raw(s);
}
- for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.bpp); args++) {
+ for (args = 0; args < SVGA_PIXMAP_SIZE(x, y, cursor.xor_mask_bpp); args++) {
cursor.xor_mask[args] = vmsvga_fifo_read_raw(s);
}
#ifdef HW_MOUSE_ACCEL