diff options
author | Pierre Ossman <ossman@cendio.se> | 2021-07-12 17:15:25 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2021-07-13 14:26:04 +0200 |
commit | c11f8f9930a9ec0fc4a9f3ff7748eef4414591db (patch) | |
tree | b02a4c98832cd13f7cc649504ac2830a35ec3c11 | |
parent | d5cddf4b0437c4faac7f9c52a4f40c598d445a0e (diff) | |
download | tigervnc-c11f8f9930a9ec0fc4a9f3ff7748eef4414591db.tar.gz tigervnc-c11f8f9930a9ec0fc4a9f3ff7748eef4414591db.zip |
Do all RandR init in vncRandRInit()
Keep everything in one place to make it easier to read.
This also removes the call to RRInit() as that is done implicitly
anyway.
-rw-r--r-- | unix/xserver/hw/vnc/xvnc.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c index e8f71edd..1f95207d 100644 --- a/unix/xserver/hw/vnc/xvnc.c +++ b/unix/xserver/hw/vnc/xvnc.c @@ -1065,13 +1065,23 @@ vncRandRSetPreferredMode(void *out, void *m) static Bool vncRandRInit(ScreenPtr pScreen) { + rrScrPrivPtr pScrPriv; RRCrtcPtr crtc; RRModePtr mode; Bool ret; - if (!RRInit()) + if (!RRScreenInit(pScreen)) return FALSE; + pScrPriv = rrGetScrPriv(pScreen); + + pScrPriv->rrGetInfo = vncRandRGetInfo; + pScrPriv->rrSetConfig = NULL; + pScrPriv->rrScreenSetSize = vncRandRScreenSetSize; + pScrPriv->rrCrtcSet = vncRandRCrtcSet; + pScrPriv->rrOutputValidateMode = vncRandROutputValidateMode; + pScrPriv->rrModeDestroy = vncRandRModeDestroy; + /* These are completely arbitrary */ RRScreenSetSizeRange(pScreen, 32, 32, 32768, 32768); @@ -1124,8 +1134,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) int ret; void *pbits; - rrScrPrivPtr rp; - /* 96 is the default used by most other systems */ dpi = 96; if (monitorResolution) @@ -1179,6 +1187,10 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; + ret = vncRandRInit(pScreen); + if (!ret) + return FALSE; + /* * Circumvent the backing store that was just initialised. This amounts * to a truely bizarre way of initialising SaveDoomedAreas and friends. @@ -1241,23 +1253,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) pvfb->closeScreen = pScreen->CloseScreen; pScreen->CloseScreen = vfbCloseScreen; - ret = RRScreenInit(pScreen); - if (!ret) - return FALSE; - - rp = rrGetScrPriv(pScreen); - - rp->rrGetInfo = vncRandRGetInfo; - rp->rrSetConfig = NULL; - rp->rrScreenSetSize = vncRandRScreenSetSize; - rp->rrCrtcSet = vncRandRCrtcSet; - rp->rrOutputValidateMode = vncRandROutputValidateMode; - rp->rrModeDestroy = vncRandRModeDestroy; - - ret = vncRandRInit(pScreen); - if (!ret) - return FALSE; - return TRUE; } /* end vfbScreenInit */ |