Home | History | Annotate | Download | only in qemu

Lines Matching refs:ds

285     x = MIN(x, s->ds->width);
286 y = MIN(y, s->ds->height);
287 w = MIN(x + w, s->ds->width) - x;
288 h = MIN(h, s->ds->height);
295 static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
297 VncDisplay *vd = ds->opaque;
351 DisplayState *ds = vs->ds;
355 if (!vs->guest.ds)
356 vs->guest.ds = qemu_mallocz(sizeof(*vs->guest.ds));
357 if (ds_get_bytes_per_pixel(ds) != vs->guest.ds->pf.bytes_per_pixel)
358 console_color_init(ds);
360 size_changed = ds_get_width(ds) != vs->guest.ds->width ||
361 ds_get_height(ds) != vs->guest.ds->height;
362 *(vs->guest.ds) = *(ds->surface);
368 vnc_framebuffer_update(vs, 0, 0, ds_get_width(ds), ds_get_height(ds),
376 if (!vs->server.ds)
377 vs->server.ds = qemu_mallocz(sizeof(*vs->server.ds));
378 if (vs->server.ds->data)
379 qemu_free(vs->server.ds->data);
380 *(vs->server.ds) = *(ds->surface);
381 vs->server.ds->data = qemu_mallocz(vs->server.ds->linesize *
382 vs->server.ds->height);
386 static void vnc_dpy_resize(DisplayState *ds)
388 VncDisplay *vd = ds->opaque;
407 r = ((((v & vs->server.ds->pf.rmask) >> vs->server.ds->pf.rshift) << vs->clientds.pf.rbits) >>
408 vs->server.ds->pf.rbits);
409 g = ((((v & vs->server.ds->pf.gmask) >> vs->server.ds->pf.gshift) << vs->clientds.pf.gbits) >>
410 vs->server.ds->pf.gbits);
411 b = ((((v & vs->server.ds->pf.bmask) >> vs->server.ds->pf.bshift) << vs->clientds.pf.bbits) >>
412 vs->server.ds->pf.bbits);
450 if (vs->server.ds->pf.bytes_per_pixel == 4) {
458 } else if (vs->server.ds->pf.bytes_per_pixel == 2) {
466 } else if (vs->server.ds->pf.bytes_per_pixel == 1) {
484 row = vs->server.ds->data + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds);
486 vs->write_pixels(vs, row, w * ds_get_bytes_per_pixel(vs->ds));
487 row += ds_get_linesize(vs->ds);
533 last_fg = (uint8_t *) qemu_malloc(vs->server.ds->pf.bytes_per_pixel);
534 last_bg = (uint8_t *) qemu_malloc(vs->server.ds->pf.bytes_per_pixel);
672 static void vnc_dpy_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
674 VncDisplay *vd = ds->opaque;
699 for (h = 1; h < (s->ds->height - y); h++) {
736 vnc_set_bits(width_mask, (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS);
737 cmp_bytes = 16 * ds_get_bytes_per_pixel(vs->ds);
738 guest_row = vs->guest.ds->data;
739 server_row = vs->server.ds->data;
740 for (y = 0; y < vs->guest.ds->height; y++) {
749 for (x = 0; x < vs->guest.ds->width;
761 guest_row += ds_get_linesize(vs->ds);
762 server_row += ds_get_linesize(vs->ds);
782 for (y = 0; y < vs->server.ds->height; y++) {
785 for (x = 0; x < vs->server.ds->width / 16; x++) {
924 qemu_free(vs->server.ds->data);
925 qemu_free(vs->server.ds);
926 qemu_free(vs->guest.ds);
1249 ds_get_width(vs->ds), ds_get_height(vs->ds),
1273 kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1),
1274 y * 0x7FFF / (ds_get_height(vs->ds) - 1),
1490 if (x_position > ds_get_width(vs->ds))
1491 x_position = ds_get_width(vs->ds);
1492 if (y_position > ds_get_height(vs->ds))
1493 y_position = ds_get_height(vs->ds);
1494 if (x_position + w >= ds_get_width(vs->ds))
1495 w = ds_get_width(vs->ds) - x_position;
1496 if (y_position + h >= ds_get_height(vs->ds))
1497 h = ds_get_height(vs->ds) - y_position;
1505 (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS);
1507 (ds_get_width(vs->ds) / 16), VNC_DIRTY_WORDS);
1517 vnc_framebuffer_update(vs, 0, 0, ds_get_width(vs->ds), ds_get_height(vs->ds),
1527 vnc_framebuffer_update(vs, 0, 0, ds_get_width(vs->ds), ds_get_height(vs->ds),
1594 (vs->ds->surface->flags & QEMU_BIG_ENDIAN_FLAG) &&
1595 !memcmp(&(vs->clientds.pf), &(vs->ds->surface->pf), sizeof(PixelFormat))) {
1597 switch (vs->ds->surface->pf.bits_per_pixel) {
1610 switch (vs->ds->surface->pf.bits_per_pixel) {
1635 vs->clientds = *(vs->guest.ds);
1662 vnc_write_u8(vs, vs->ds->surface->pf.bits_per_pixel); /* bits-per-pixel */
1663 vnc_write_u8(vs, vs->ds->surface->pf.depth); /* depth */
1671 vnc_write_u16(vs, vs->ds->surface->pf.rmax); /* red-max */
1672 vnc_write_u16(vs, vs->ds->surface->pf.gmax); /* green-max */
1673 vnc_write_u16(vs, vs->ds->surface->pf.bmax); /* blue-max */
1674 vnc_write_u8(vs, vs->ds->surface->pf.rshift); /* red-shift */
1675 vnc_write_u8(vs, vs->ds->surface->pf.gshift); /* green-shift */
1676 ds->surface->pf.bshift); /* blue-shift */
1677 if (vs->ds->surface->pf.bits_per_pixel == 32)
1679 else if (vs->ds->surface->pf.bits_per_pixel == 16)
1681 else if (vs->ds->surface->pf.bits_per_pixel == 8)
1683 vs->clientds = *(vs->ds->surface);
1690 static void vnc_dpy_setdata(DisplayState *ds)
1702 vnc_framebuffer_update(vs, 0, 0, ds_get_width(vs->ds),
1703 ds_get_height(vs->ds), VNC_ENCODING_WMVi);
1852 vnc_write_u16(vs, ds_get_width(vs->ds));
1853 vnc_write_u16(vs, ds_get_height(vs->ds));
2075 vs->ds = vd->ds;
2111 void vnc_display_init(DisplayState *ds)
2117 ds->opaque = vs;
2123 vs->ds = ds;
2137 register_displaychangelistener(ds, dcl);
2141 void vnc_display_close(DisplayState *ds)
2143 VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
2163 int vnc_display_password(DisplayState *ds, const char *password)
2165 VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
2179 char *vnc_display_local_addr(DisplayState *ds)
2181 VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
2186 int vnc_display_open(DisplayState *ds, const char *display)
2188 VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
2204 vnc_display_close(ds);