From c2b1f489d7998c83af73c7cb25bbb2bc53f26094 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 20 Jun 2016 11:10:06 +0200 Subject: Backport RANDR proto version 1.5 to nx-X11's Xserver. Backported to X.org's /xorg/xserver Git hash level: a6b6e8ba026acedef6336b17adf06aebddd5f22f. --- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 114 +++++++++++++++++++++++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 7 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 2 +- 3 files changed, 116 insertions(+), 7 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index dfa511448..494027927 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -35,6 +35,32 @@ static int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, static int nxagentRandRInitSizes(ScreenPtr pScreen); +#if RANDR_14_INTERFACE +static Bool +nxagentRandRReplaceScanoutPixmap(DrawablePtr pDrawable, + PixmapPtr pPixmap, + Bool enable); +#endif + +#if RANDR_13_INTERFACE +static Bool +nxagentRandROutputGetProperty(ScreenPtr pScreen, + RROutputPtr output, + Atom property); +static Bool +nxagentRandRGetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border); +static Bool +nxagentRandRSetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border); +#endif + #if RANDR_12_INTERFACE static Bool nxagentRandRCrtcSet (ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode, int x, int y, @@ -104,6 +130,29 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) pRandRScrPriv -> rrGetInfo = nxagentRandRGetInfo; + #if RANDR_15_INTERFACE + /* nothing to be assigned here, so far */ + #endif + + #if RANDR_14_INTERFACE + /* no pixmap sharing in nx-X11 */ + pScreen->ReplaceScanoutPixmap = nxagentRandRReplaceScanoutPixmap; + pRandRScrPriv -> rrCrtcSetScanoutPixmap = NULL; + + /* only fake provider support in nx-X11, so far */ + pRandRScrPriv -> provider = RRProviderCreate(pScreen, "default", 7); + pRandRScrPriv -> rrProviderSetOutputSource = NULL; + pRandRScrPriv -> rrProviderSetOffloadSink; + pRandRScrPriv -> rrProviderGetProperty; + pRandRScrPriv -> rrProviderSetProperty; + #endif + + #if RANDR_13_INTERFACE + pRandRScrPriv -> rrOutputGetProperty = nxagentRandROutputGetProperty; + pRandRScrPriv -> rrGetPanning = nxagentRandRGetPanning; + pRandRScrPriv -> rrSetPanning = nxagentRandRSetPanning; + #endif + #if RANDR_12_INTERFACE pRandRScrPriv -> rrScreenSetSize = nxagentRandRScreenSetSize; pRandRScrPriv -> rrCrtcSet = nxagentRandRCrtcSet; @@ -114,13 +163,70 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) #endif } -void -RRResetProc (ExtensionEntry *extEntry) +#if RANDR_14_INTERFACE +static Bool +nxagentRandRReplaceScanoutPixmap(DrawablePtr pDrawable, + PixmapPtr pPixmap, + Bool enable) +{ + /* FALSE means: not supported */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRReplaceScanoutPixmap: NX's RANDR does not support scan-out pixmaps.\n"); +#endif + return FALSE; +} +#endif + +#if RANDR_13_INTERFACE +static Bool +nxagentRandROutputGetProperty(ScreenPtr pScreen, + RROutputPtr output, + Atom property) { - fprintf(stderr, "RANDR going down - NX version\n"); + /* FALSE means: no property required to be modified on the fly here */ + return FALSE; } +static Bool +nxagentRandRGetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border) +{ + /* FALSE means: no, panning is not supported at the moment... + * Panning requires several modes to be available for + * the NX output(s). + * + * FIXME: Add more modes per output than the current window size. + * At least when in fullscreen mode. + */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRGetPanning: RANDR Panning is currently not supported.\n"); +#endif + return FALSE; +} +static Bool +nxagentRandRSetPanning(ScreenPtr pScrn, + RRCrtcPtr crtc, + BoxPtr totalArea, + BoxPtr trackingArea, + INT16 *border) +{ + /* FALSE means: no, panning is not supported at the moment... + * Panning requires several modes to be available for + * the NX output(s). + * + * FIXME: Add more modes per output than the current window size. + * At least when in fullscreen mode. + */ +#ifdef DEBUG + fprintf(stderr, "nxagentRandRSetPanning: RANDR Panning is currently not supported.\n"); +#endif + return FALSE; +} +#endif #if RANDR_12_INTERFACE /* @@ -137,7 +243,7 @@ nxagentRandRCrtcSet (ScreenPtr pScreen, int numOutputs, RROutputPtr *outputs) { - return RRCrtcNotify(crtc, mode, x, y, rotation, numOutputs, outputs); + return RRCrtcNotify(crtc, mode, x, y, rotation, NULL, numOutputs, outputs); } #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index e9cef5ae3..121a1c774 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -209,8 +209,11 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(NX_DEFINES) \ -DNXAGENT_ARTSD \ -DNXAGENT_RANDR_MODE_PREFIX \ -UNX_DEBUG_INPUT \ - -DRANDR_10_INTERFACE \ - -DRANDR_12_INTERFACE \ + -DRANDR_10_INTERFACE=1 \ + -DRANDR_12_INTERFACE=1 \ + -DRANDR_13_INTERFACE=1 \ + -DRANDR_14_INTERFACE=1 \ + -DRANDR_15_INTERFACE=1 \ -DPANORAMIX \ -UDEBUG_TREE diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a4b39a4fe..40b1e5222 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -3793,7 +3793,7 @@ int nxagentAdjustRandRXinerama(ScreenPtr pScreen) * do this here it will be done implicitely later and add mode(s) to * our crtc(s)! */ - rrgetinfo = RRGetInfo(pScreen); + rrgetinfo = RRGetInfo(pScreen, FALSE); fprintf(stderr, "nxagentAdjustRandRXinerama: RRGetInfo returned [%d]\n", rrgetinfo); } -- cgit v1.2.3