From 1852b9d1938a62d800c5f8cafdf3643f644f7609 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 28 Jan 2024 14:02:07 -0800 Subject: [PATCH] fix for non GFX multimon --- module/rdpCapture.c | 2 +- module/rdpClientCon.c | 31 +++++++++++++++++-------------- module/rdpEgl.c | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/module/rdpCapture.c b/module/rdpCapture.c index 41c3604..f107720 100644 --- a/module/rdpCapture.c +++ b/module/rdpCapture.c @@ -873,7 +873,7 @@ rdpCapture2(rdpClientCon *clientCon, RegionPtr in_reg, BoxPtr *out_rects, src = id->pixels; dst = id->shmem_pixels; src_stride = id->lineBytes; - dst_stride = id->shmem_lineBytes; + dst_stride = ((id->width + 63) & ~63) * 4; src = src + src_stride * id->top + id->left * 4; diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c index 013af48..ec75acb 100644 --- a/module/rdpClientCon.c +++ b/module/rdpClientCon.c @@ -2695,7 +2695,7 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, { /* non gfx */ size = 2 + 2 + 2 + num_rects_d * 8 + 2 + num_rects_c * 8; - size += 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2 + 2 + 2; + size += 4 + 4 + 4 + 4 + 2 + 2 + 2 + 2; rdpClientConPreCheck(dev, clientCon, size); s = clientCon->out_s; @@ -2711,12 +2711,20 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, out_uint32_le(s, clientCon->rect_id); out_uint32_le(s, id->shmem_bytes); out_uint32_le(s, id->shmem_offset); - out_uint16_le(s, id->left); - out_uint16_le(s, id->top); - out_uint16_le(s, id->width); - out_uint16_le(s, id->height); - out_uint16_le(s, clientCon->cap_width); - out_uint16_le(s, clientCon->cap_height); + if (capture_code == 2) /* rfx */ + { + out_uint16_le(s, id->left); + out_uint16_le(s, id->top); + out_uint16_le(s, id->width); + out_uint16_le(s, id->height); + } + else + { + out_uint16_le(s, 0); + out_uint16_le(s, 0); + out_uint16_le(s, clientCon->cap_width); + out_uint16_le(s, clientCon->cap_height); + } rdpClientConSendPending(clientCon->dev, clientCon); g_sck_send_fd_set(clientCon->sck, "int", 4, &(id->shmem_fd), 1); } @@ -2726,7 +2734,7 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, wiretosurface2_bytes = 8 + 13 + 2 + num_rects_d * 8 + 2 + num_rects_c * 8 + - 12; + 8; end_frame_bytes = 8 + 4; size = 2 + 2; /* header */ @@ -2774,8 +2782,6 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, out_uint16_le(s, id->top); out_uint16_le(s, id->width); out_uint16_le(s, id->height); - out_uint16_le(s, clientCon->cap_width); - out_uint16_le(s, clientCon->cap_height); /* XR_RDPGFX_CMDID_ENDFRAME */ out_uint16_le(s, 0x000C); @@ -2800,7 +2806,7 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, wiretosurface1_bytes = 8 + 9 + 2 + num_rects_d * 8 + 2 + num_rects_c * 8 + - 12; + 8; end_frame_bytes = 8 + 4; size = 2 + 2; /* header */ @@ -2847,8 +2853,6 @@ rdpClientConSendPaintRectShmFd(rdpPtr dev, rdpClientCon *clientCon, out_uint16_le(s, id->top); out_uint16_le(s, id->width); out_uint16_le(s, id->height); - out_uint16_le(s, clientCon->cap_width); - out_uint16_le(s, clientCon->cap_height); /* XR_RDPGFX_CMDID_ENDFRAME */ out_uint16_le(s, 0x000C); @@ -3080,7 +3084,6 @@ rdpScheduleDeferredUpdate(rdpClientCon *clientCon) { return; } - curTime = (uint32_t) GetTimeInMillis(); /* use two separate delays in order to limit the update rate and wait a bit for more changes before sending an update. Always waiting the longer diff --git a/module/rdpEgl.c b/module/rdpEgl.c index b503429..b84f65b 100644 --- a/module/rdpEgl.c +++ b/module/rdpEgl.c @@ -565,7 +565,7 @@ rdpEglOut(rdpClientCon *clientCon, struct rdp_egl *egl, RegionPtr in_reg, LLOGLN(0, ("rdpEglOut: glCheckFramebufferStatus error")); } dst = id->shmem_pixels; - dst_stride = id->shmem_lineBytes; + dst_stride = ((id->width + 63) & ~63) * 4; /* check crc list size */ crc_stride = (id->width + 63) / 64; num_crcs = crc_stride * ((id->height + 63) / 64);