From 7d039914ff5baf1ebd5dca1ddcb8d3a74ba3587e Mon Sep 17 00:00:00 2001 From: Minh Phan Date: Tue, 29 Nov 2022 19:35:13 +0700 Subject: randr: introduce rrCrtcGetInfo DDX function This allows rrCrtcGetInfo to override the values in the XRRCrtcGetInfo reply. One use case is to allow Xwayland to return the current emulated mode for the specific client instead of the global mode. Signed-off-by: Minh Phan Acked-by: Olivier Fourdan (cherry picked from commit 5145742fb6e3d108b05db1521b51112e0dbfb95a) --- randr/randrstr.h | 8 ++++++++ randr/rrcrtc.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/randr/randrstr.h b/randr/randrstr.h index 173ecdf4e..545348835 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -218,6 +218,10 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen, Rotation rotation, int numOutputs, RROutputPtr * outputs); +typedef void (*RRCrtcGetProcPtr) (ScreenPtr pScreen, + RRCrtcPtr crtc, + xRRGetCrtcInfoReply *rep); + typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc); typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc); @@ -420,6 +424,10 @@ typedef struct _rrScrPriv { RRRequestLeaseProcPtr rrRequestLease; RRGetLeaseProcPtr rrGetLease; + +#if RANDR_12_INTERFACE + RRCrtcGetProcPtr rrCrtcGet; +#endif } rrScrPrivRec, *rrScrPrivPtr; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index e64f03131..5f85bdfa5 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1269,6 +1269,9 @@ ProcRRGetCrtcInfo(ClientPtr client) } } + if (pScrPriv->rrCrtcGet) + pScrPriv->rrCrtcGet(pScreen, crtc, &rep); + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); -- cgit v1.2.1