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 <phanquangminh217@gmail.com>
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 5145742fb6)
This commit is contained in:
Minh Phan 2022-11-29 19:35:13 +07:00 committed by Olivier Fourdan
parent cedf933c7c
commit 7d039914ff
2 changed files with 11 additions and 0 deletions

View file

@ -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;

View file

@ -1269,6 +1269,9 @@ ProcRRGetCrtcInfo(ClientPtr client)
}
}
if (pScrPriv->rrCrtcGet)
pScrPriv->rrCrtcGet(pScreen, crtc, &rep);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);