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>
This commit is contained in:
Minh Phan 2022-11-29 19:35:13 +07:00 committed by msizanoen1
parent 3cb3024fea
commit 5145742fb6
3 changed files with 12 additions and 1 deletions

View File

@ -74,7 +74,7 @@
* mask is 0xFFFF0000. * mask is 0xFFFF0000.
*/ */
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) #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_XINPUT_VERSION SET_ABI_VERSION(24, 4)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(10, 0)

View File

@ -218,6 +218,10 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
Rotation rotation, Rotation rotation,
int numOutputs, RROutputPtr * outputs); int numOutputs, RROutputPtr * outputs);
typedef void (*RRCrtcGetProcPtr) (ScreenPtr pScreen,
RRCrtcPtr crtc,
xRRGetCrtcInfoReply *rep);
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc); typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc); typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
@ -420,6 +424,10 @@ typedef struct _rrScrPriv {
RRRequestLeaseProcPtr rrRequestLease; RRRequestLeaseProcPtr rrRequestLease;
RRGetLeaseProcPtr rrGetLease; RRGetLeaseProcPtr rrGetLease;
#if RANDR_12_INTERFACE
RRCrtcGetProcPtr rrCrtcGet;
#endif
} rrScrPrivRec, *rrScrPrivPtr; } rrScrPrivRec, *rrScrPrivPtr;
extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;

View File

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