From 88539d355812f1dd0e24963b5a3789bb8cf744ea Mon Sep 17 00:00:00 2001 From: tigro Date: Wed, 20 Dec 2023 15:21:17 +0300 Subject: [PATCH] Apply lrandr patch --- SOURCES/lrandr-only-nvidia.diff | 88 +++++++++++++++++++++++++++++++++ SPECS/xorgxrdp.spec | 6 ++- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 SOURCES/lrandr-only-nvidia.diff diff --git a/SOURCES/lrandr-only-nvidia.diff b/SOURCES/lrandr-only-nvidia.diff new file mode 100644 index 0000000..0bbec42 --- /dev/null +++ b/SOURCES/lrandr-only-nvidia.diff @@ -0,0 +1,88 @@ +--- a/module/rdpClientCon.c 2022-10-03 19:57:25.328159263 +0200 ++++ b/module/rdpClientCon.c 2022-10-03 19:59:53.433316164 +0200 +@@ -55,9 +55,8 @@ + + #if defined(XORGXRDP_LRANDR) + #include "rdpLRandR.h" +-#else +-#include "rdpRandR.h" + #endif ++#include "rdpRandR.h" + + #define LOG_LEVEL 1 + #define LLOGLN(_level, _args) \ +@@ -849,19 +848,24 @@ + if ((dev->width != width) || (dev->height != height)) + { + #if defined(XORGXRDP_LRANDR) +- /* even though we are not using the built in randr, we still need +- * to call this so driver can setup */ +- ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); +- LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok)); +- ok = rdpLRRScreenSizeSet(dev, width, height, mmwidth, mmheight); +- LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: LRRScreenSizeSet ok=[%d]", ok)); +-#else +- dev->allow_screen_resize = 1; +- ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); +- dev->allow_screen_resize = 0; +- LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok)); +- RRTellChanged(dev->pScreen); ++ if (dev->nvidia) ++ { ++ /* even though we are not using the built in randr, we still need ++ * to call this so driver can setup */ ++ ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); ++ LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok)); ++ ok = rdpLRRScreenSizeSet(dev, width, height, mmwidth, mmheight); ++ LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: LRRScreenSizeSet ok=[%d]", ok)); ++ } ++ else ++ { + #endif ++ dev->allow_screen_resize = 1; ++ ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight); ++ dev->allow_screen_resize = 0; ++ LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok)); ++ RRTellChanged(dev->pScreen); ++ } + } + + return 0; +@@ -1297,11 +1301,14 @@ + dev->minfo[index].bottom)); + } + #if defined(XORGXRDP_LRANDR) +- rdpLRRSetRdpOutputs(dev); +-#else +- rdpRRSetRdpOutputs(dev); +- RRTellChanged(dev->pScreen); ++ if (dev->nvidia) ++ rdpLRRSetRdpOutputs(dev); ++ else + #endif ++ { ++ rdpRRSetRdpOutputs(dev); ++ RRTellChanged(dev->pScreen); ++ } + } + else + { +@@ -1310,11 +1317,14 @@ + dev->doMultimon = 0; + dev->monitorCount = 0; + #if defined(XORGXRDP_LRANDR) +- rdpLRRSetRdpOutputs(dev); +-#else +- rdpRRSetRdpOutputs(dev); +- RRTellChanged(dev->pScreen); ++ if (dev->nvidia) ++ rdpLRRSetRdpOutputs(dev); ++ else + #endif ++ { ++ rdpRRSetRdpOutputs(dev); ++ RRTellChanged(dev->pScreen); ++ } + } + + /* rdpLoadLayout */ diff --git a/SPECS/xorgxrdp.spec b/SPECS/xorgxrdp.spec index 0e2e1ba..ffde1bb 100644 --- a/SPECS/xorgxrdp.spec +++ b/SPECS/xorgxrdp.spec @@ -5,7 +5,7 @@ Name: xorgxrdp-egfx Version: 0.9.80 -Release: 1.20230830git%{shortcommit}%{?dist} +Release: 2.20230830git%{shortcommit}%{?dist} Summary: Implementation of xrdp backend as Xorg modules License: MIT @@ -13,6 +13,7 @@ URL: https://github.com/neutrinolabs/xorgxrdp Source0: https://github.com/neutrinolabs/xorgxrdp/archive/%{commit}/%{real_name}-%{commit}.tar.gz # https://github.com/neutrinolabs/xrdp/issues/2875#issuecomment-1852489427 Patch1: 0001-Fix-green-screen.patch +Patch2: lrandr-only-nvidia.diff BuildRequires: make BuildRequires: nasm @@ -139,6 +140,9 @@ CFLAGS="$RPM_OPT_FLAGS -I/usr/include/libdrm" \ %endif %changelog +* Wed Dec 20 2023 Arkady L. Shane - 0.9.80-2.20230830gitf5103aa4 +- Apply lrandr patch + * Tue Dec 19 2023 Arkady L. Shane - 0.9.80-1.20230830gitf5103aa4 - Fix green screen https://github.com/neutrinolabs/xrdp/issues/2875#issuecomment-1852489427