diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index c503ad6a6..722122b66 100644 04--- a/hw/kdrive/ephyr/ephyr.c 07+++ b/hw/kdrive/ephyr/ephyr.c 06@@ -298,7 +298,7 @@ ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf) 15  * pBuf->pDamage regions 15  */ 15  shadowUpdateRotatePacked(pScreen, pBuf); 04- hostx_paint_rect(screen, 0, 0, 0, 0, screen->width, screen->height); 07+ hostx_paint_rect(screen, 0, 0, 0, 0, screen->width*SCALE, screen->height*SCALE); 15 } 15  15 static void 06@@ -918,8 +918,8 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev) 15  int x = 0, y = 0; 15  15  EPHYR_LOG("enqueuing mouse motion:%d\n", screen->pScreen->myNum); 04- x = motion->event_x; 04- y = motion->event_y; 07+ x = motion->event_x / SCALE; 07+ y = motion->event_y / SCALE; 15  EPHYR_LOG("initial (x,y):(%d,%d)\n", x, y); 15  15  /* convert coords into desktop-wide coordinates. diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index a5b2e344e..07868a38f 100644 04--- a/hw/kdrive/ephyr/hostx.c 07+++ b/hw/kdrive/ephyr/hostx.c 06@@ -618,8 +618,8 @@ hostx_init(void) 15  scrpriv->win, 15  scrpriv->win_pre_existing, 15  0,0, 04- scrpriv->win_width, 04- scrpriv->win_height, 07+ scrpriv->win_width * SCALE, 07+ scrpriv->win_height * SCALE, 15  0, 15  XCB_WINDOW_CLASS_COPY_FROM_PARENT, 15  HostX.visual->visual_id, 06@@ -904,15 +904,15 @@ hostx_screen_init(KdScreenInfo *screen, 15  15  if (!ephyr_glamor && HostX.have_shm) { 15  scrpriv->ximg = xcb_image_create_native(HostX.conn, 04- width, 04- buffer_height, 07+ width * SCALE, 07+ buffer_height * SCALE, 15  XCB_IMAGE_FORMAT_Z_PIXMAP, 15  HostX.depth, 15  NULL, 15  ~0, 15  NULL); 15  04- scrpriv->shmsize = scrpriv->ximg->stride * buffer_height; 07+ scrpriv->shmsize = scrpriv->ximg->stride * buffer_height * SCALE; 15  if (!hostx_create_shm_segment(&scrpriv->shminfo, 15  scrpriv->shmsize)) { 15  EPHYR_DBG 06@@ -931,8 +931,8 @@ hostx_screen_init(KdScreenInfo *screen, 15  EPHYR_DBG("Creating image %dx%d for screen scrpriv=%p\n", 15  width, buffer_height, scrpriv); 15  scrpriv->ximg = xcb_image_create_native(HostX.conn, 04- width, 04- buffer_height, 07+ width * SCALE, 07+ buffer_height * SCALE, 15  XCB_IMAGE_FORMAT_Z_PIXMAP, 15  HostX.depth, 15  NULL, 06@@ -945,21 +945,21 @@ hostx_screen_init(KdScreenInfo *screen, 15  scrpriv->ximg->byte_order = IMAGE_BYTE_ORDER; 15  15  scrpriv->ximg->data = 04- xallocarray(scrpriv->ximg->stride, buffer_height); 07+ xallocarray(scrpriv->ximg->stride, buffer_height * SCALE); 15  } 15  15  if (!HostX.size_set_from_configure) 15  { 15  uint32_t mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; 04- uint32_t values[2] = {width, height}; 07+ uint32_t values[2] = {width * SCALE, height * SCALE}; 15  xcb_configure_window(HostX.conn, scrpriv->win, mask, values); 15  } 15  15  if (scrpriv->win_pre_existing == None && !EphyrWantResize) { 15  /* Ask the WM to keep our size static */ 15  xcb_size_hints_t size_hints = {0}; 04- size_hints.max_width = size_hints.min_width = width; 04- size_hints.max_height = size_hints.min_height = height; 07+ size_hints.max_width = size_hints.min_width = width * SCALE; 07+ size_hints.max_height = size_hints.min_height = height * SCALE; 15  size_hints.flags = (XCB_ICCCM_SIZE_HINT_P_MIN_SIZE | 15  XCB_ICCCM_SIZE_HINT_P_MAX_SIZE); 15  xcb_icccm_set_wm_normal_hints(HostX.conn, scrpriv->win, 06@@ -991,6 +991,7 @@ hostx_screen_init(KdScreenInfo *screen, 15  scrpriv->win_x = x; 15  scrpriv->win_y = y; 15  07+ if (SCALE != 1) assert(scrpriv->ximg->bpp == 32); 15 #ifdef GLAMOR 15  if (ephyr_glamor) { 15  *bytes_per_line = 0; 06@@ -999,7 +1000,7 @@ hostx_screen_init(KdScreenInfo *screen, 15  return NULL; 15  } else 15 #endif 04- if (host_depth_matches_server(scrpriv)) { 07+ if (SCALE == 1 && host_depth_matches_server(scrpriv)) { 15  *bytes_per_line = scrpriv->ximg->stride; 15  *bits_per_pixel = scrpriv->ximg->bpp; 15  06@@ -1007,11 +1008,12 @@ hostx_screen_init(KdScreenInfo *screen, 15  return scrpriv->ximg->data; 15  } 15  else { 04- int bytes_per_pixel = scrpriv->server_depth >> 3; 07+ int server_depth = scrpriv->server_depth == 24 ? 32 : scrpriv->server_depth; 07+ int bytes_per_pixel = server_depth >> 3; 15  int stride = (width * bytes_per_pixel + 0x3) & ~0x3; 15  15  *bytes_per_line = stride; 04- *bits_per_pixel = scrpriv->server_depth; 07+ *bits_per_pixel = server_depth; 15  15  EPHYR_DBG("server bpp %i", bytes_per_pixel); 15  scrpriv->fb_data = xallocarray (stride, buffer_height); 06@@ -1091,34 +1093,52 @@ hostx_paint_rect(KdScreenInfo *screen, 15  15  host_pixel = (r << 16) | (g << 8) | (b); 15  04- xcb_image_put_pixel(scrpriv->ximg, x, y, host_pixel); 07+ for (int yp = 0; yp < SCALE; ++yp) 07+ for (int xp = 0; xp < SCALE; ++xp) 07+ xcb_image_put_pixel(scrpriv->ximg, x*SCALE+xp, y*SCALE+yp, host_pixel); 15  break; 15  } 15  case 8: 15  { 15  unsigned char pixel = 15  *(unsigned char *) (scrpriv->fb_data + idx); 04- xcb_image_put_pixel(scrpriv->ximg, x, y, 04- scrpriv->cmap[pixel]); 07+ host_pixel = scrpriv->cmap[pixel]; 07+ 07+ for (int yp = 0; yp < SCALE; ++yp) 07+ for (int xp = 0; xp < SCALE; ++xp) 07+ xcb_image_put_pixel(scrpriv->ximg, x*SCALE+xp, y*SCALE+yp, host_pixel); 15  break; 15  } 15  default: 15  break; 15  } 15  } 07+ } else if (SCALE != 1) { 07+ uint32_t* dst = (uint32_t*) scrpriv->ximg->data; 07+ uint32_t* src = (uint32_t*) scrpriv->fb_data; 07+ size_t src_stride = scrpriv->win_width; 07+ size_t dst_stride = scrpriv->ximg->stride/4; 07+ for (int y = sy; y < sy + height; ++y) 07+ for (int x = sx; x < sx + width; ++x) { 07+ uint32_t val = src[y * src_stride + x]; 07+ for (int yp = 0; yp < SCALE; ++yp) 07+ for (int xp = 0; xp < SCALE; ++xp) 07+ dst[(y*SCALE+yp) * dst_stride + (x*SCALE+xp)] = val; 07+ } 15  } 15  15  if (HostX.have_shm) { 15  xcb_image_shm_put(HostX.conn, scrpriv->win, 15  HostX.gc, scrpriv->ximg, 15  scrpriv->shminfo, 04- sx, sy, dx, dy, width, height, FALSE); 07+ sx*SCALE, sy*SCALE, dx*SCALE, dy*SCALE, 07+ width*SCALE, height*SCALE, FALSE); 15  } 15  else { 04- xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy, 04- width, height, 0, 0, 0); 07+ xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx*SCALE, sy*SCALE, 07+ width*SCALE, height*SCALE, 0, 0, 0); 15  xcb_image_t *img = xcb_image_native(HostX.conn, subimg, 1); 04- xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx, dy, 0); 07+ xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx*SCALE, dy*SCALE, 0); 15  if (subimg != img) 15  xcb_image_destroy(img); 15  xcb_image_destroy(subimg); 06@@ -1133,7 +1153,10 @@ hostx_paint_debug_rect(KdScreenInfo *screen, 15 { 15  EphyrScrPriv *scrpriv = screen->driver; 15  struct timespec tspec; 04- xcb_rectangle_t rect = { .x = x, .y = y, .width = width, .height = height }; 07+ xcb_rectangle_t rect = { 07+ .x = x * SCALE, .y = y * SCALE, 07+ .width = width * SCALE, .height = height * SCALE 07+ }; 15  xcb_void_cookie_t cookie; 15  xcb_generic_error_t *e; 15  06@@ -1471,7 +1494,7 @@ hostx_create_window(int a_screen_number, 15  win, 15  hostx_get_window (a_screen_number), 15  a_geometry->x, a_geometry->y, 04- a_geometry->width, a_geometry->height, 0, 07+ a_geometry->width * SCALE, a_geometry->height * SCALE, 0, 15  XCB_WINDOW_CLASS_COPY_FROM_PARENT, 15  a_visual_id, winmask, attrs); 15  06@@ -1514,8 +1537,8 @@ hostx_set_window_geometry(int a_win, EphyrBox * a_geo) 15  15  values[0] = a_geo->x; 15  values[1] = a_geo->y; 04- values[2] = a_geo->width; 04- values[3] = a_geo->height; 07+ values[2] = a_geo->width * SCALE; 07+ values[3] = a_geo->height * SCALE; 15  xcb_configure_window(HostX.conn, a_win, mask, values); 15  15  EPHYR_LOG("leave\n"); diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index 4b2678e58..cfce75d30 100644 04--- a/hw/kdrive/ephyr/hostx.h 07+++ b/hw/kdrive/ephyr/hostx.h 06@@ -32,6 +32,8 @@ 15 #include 15 #include "ephyr.h" 15  07+#define SCALE 2 07+ 15 #define EPHYR_WANT_DEBUG 0 15  15 #if (EPHYR_WANT_DEBUG)