From 5145742fb6e3d108b05db1521b51112e0dbfb95a Mon Sep 17 00:00:00 2001 From: Minh Phan Date: Tue, 29 Nov 2022 19:35:13 +0700 Subject: [PATCH] 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 --- hw/xfree86/common/xf86Module.h | 2 +- randr/randrstr.h | 8 ++++++++ randr/rrcrtc.c | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index d5e858fc8..c77eefd7e 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -74,7 +74,7 @@ * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(26, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(26, 6) #define ABI_XINPUT_VERSION SET_ABI_VERSION(24, 4) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) 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 cf149768f..0044fecce 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1261,6 +1261,9 @@ ProcRRGetCrtcInfo(ClientPtr client) } } + if (pScrPriv->rrCrtcGet) + pScrPriv->rrCrtcGet(pScreen, crtc, &rep); + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length);