From 7e1f86d42b54fb7f6492875e47a718eaeca3069b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 16 Dec 2014 01:59:03 -0800 Subject: randr: Add Monitor support (v1.1) Store the user-defined monitors in the RandR screen private. Generate a list of monitors from both the user-defined ones and from any outputs not mentioned in one of the user-defined monitors. This list covers both the outputs in the main screen as well as any slaves. v1.1: airlied: fix up primary skipping bug, fix wrong height initialiser add get_active flag from updated protocol. Reviewed-by: Dave Airlie Signed-off-by: Keith Packard --- randr/randrstr.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'randr/randrstr.h') diff --git a/randr/randrstr.h b/randr/randrstr.h index 13e6a8596..438a52aeb 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -80,6 +80,7 @@ typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr; typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; typedef struct _rrOutput RROutputRec, *RROutputPtr; typedef struct _rrProvider RRProviderRec, *RRProviderPtr; +typedef struct _rrMonitor RRMonitorRec, *RRMonitorPtr; struct _rrMode { int refcnt; @@ -169,6 +170,22 @@ struct _rrProvider { struct _rrProvider *output_source; }; +typedef struct _rrMonitorGeometry { + BoxRec box; + CARD32 mmWidth; + CARD32 mmHeight; +} RRMonitorGeometryRec, *RRMonitorGeometryPtr; + +struct _rrMonitor { + Atom name; + ScreenPtr pScreen; + int numOutputs; + RROutput *outputs; + Bool primary; + Bool automatic; + RRMonitorGeometryRec geometry; +}; + #if RANDR_12_INTERFACE typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, CARD16 width, @@ -338,6 +355,9 @@ typedef struct _rrScrPriv { RRProviderDestroyProcPtr rrProviderDestroy; + int numMonitors; + RRMonitorPtr *monitors; + } rrScrPrivRec, *rrScrPrivPtr; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; @@ -981,6 +1001,30 @@ extern _X_EXPORT void RRXineramaExtensionInit(void); #endif +void +RRMonitorInit(ScreenPtr screen); + +Bool +RRMonitorMakeList(ScreenPtr screen, Bool get_active, RRMonitorPtr *monitors_ret, int *nmon_ret); + +int +RRMonitorCountList(ScreenPtr screen); + +void +RRMonitorFreeList(RRMonitorPtr monitors, int nmon); + +void +RRMonitorClose(ScreenPtr screen); + +int +ProcRRGetMonitors(ClientPtr client); + +int +ProcRRSetMonitor(ClientPtr client); + +int +ProcRRDeleteMonitor(ClientPtr client); + #endif /* _RANDRSTR_H_ */ /* -- cgit v1.2.3