static RRCrtcPtr vncRandRCrtcCreate(ScreenPtr pScreen) { RRCrtcPtr crtc; RROutputPtr output; char name[100]; /* First we create the CRTC... */ crtc = RRCrtcCreate(pScreen, NULL); /* We don't actually support gamma, but xrandr complains when it is missing */ RRCrtcGammaSetSize (crtc, 256); /* Then we create a dummy output for it... */ sprintf(name, "VNC-%d", vncRandRIndex); vncRandRIndex++; output = RROutputCreate(pScreen, name, strlen(name), NULL); RROutputSetCrtcs(output, &crtc, 1); RROutputSetConnection(output, RR_Disconnected); /* Make sure the CRTC has this output set */ vncRandRCrtcSet(pScreen, crtc, NULL, 0, 0, RR_Rotate_0, 1, &output); /* Populate a list of default modes */ vncRandRSetModes(output, -1, -1); return crtc; }
static Bool xf86RandR12CreateObjects12 (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; int o; if (!RRInit ()) return FALSE; /* * Configure crtcs */ for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; crtc->randr_crtc = RRCrtcCreate (pScreen, crtc); RRCrtcGammaSetSize (crtc->randr_crtc, 256); } /* * Configure outputs */ for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; output->randr_output = RROutputCreate (pScreen, output->name, strlen (output->name), output); if (output->funcs->create_resources != NULL) output->funcs->create_resources(output); RRPostPendingProperties (output->randr_output); } return TRUE; }