Exemple #1
0
static Bool vncRandRInit(ScreenPtr pScreen)
{
    RRCrtcPtr crtc;
    RRModePtr mode;
    Bool ret;

    if (!RRInit())
        return FALSE;

    /* These are completely arbitrary */
    RRScreenSetSizeRange(pScreen, 32, 32, 32768, 32768);

    /*
     * Start with a single CRTC with a single output. More will be
     * allocated as needed...
     */
    crtc = vncRandRCrtcCreate(pScreen);

    /* Make sure the current screen size is the active mode */
    mode = vncRandRCreatePreferredMode(crtc->outputs[0],
                                       pScreen->width, pScreen->height);
    if (mode == NULL)
        return FALSE;

    ret = vncRandRCrtcSet(pScreen, crtc, mode, 0, 0, RR_Rotate_0,
                          crtc->numOutputs, crtc->outputs);
    if (!ret)
        return FALSE;

    return TRUE;
}
Exemple #2
0
static Bool
xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
{
    int			c;
    ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);

    for (c = 0; c < config->num_crtc; c++)
	xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
    
    
    RRScreenSetSizeRange (pScreen, config->minWidth, config->minHeight,
			  config->maxWidth, config->maxHeight);
    return TRUE;
}
Exemple #3
0
static Bool
winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations)
{
  winDebug ("winRandRGetInfo ()\n");

  /* Don't support rotations */
  *pRotations = RR_Rotate_0;

  /*
    The screen doesn't have to be limited to the actual
    monitor size (we can have scrollbars :-), so what is
    the upper limit?
  */
  RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096);

  return TRUE;
}
Exemple #4
0
static Bool
xf86RandR12CreateScreenResources12 (ScreenPtr pScreen)
{
    int			c;
    ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
    xf86CrtcConfigPtr   config = XF86_CRTC_CONFIG_PTR(pScrn);

#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
    if (xf86RandR12Key == NULL)
	return TRUE;
#endif

    for (c = 0; c < config->num_crtc; c++)
        xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
    
    RRScreenSetSizeRange (pScreen, config->minWidth, config->minHeight,
			  config->maxWidth, config->maxHeight);
    return TRUE;
}
Exemple #5
0
static void
RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
{
    rrScrPriv(pScreen);
    RROutputPtr	output;
    RRCrtcPtr	crtc;
    RRModePtr	mode, newMode = NULL;
    int		i;
    CARD16	minWidth = MAXSHORT, minHeight = MAXSHORT;
    CARD16	maxWidth = 0, maxHeight = 0;
    CARD16	width, height;
    
    /*
     * First time through, create a crtc and output and hook
     * them together
     */
    if (pScrPriv->numOutputs == 0 &&
	pScrPriv->numCrtcs == 0)
    {
	crtc = RRCrtcCreate (pScreen, NULL);
	if (!crtc)
	    return;
	output = RROutputCreate (pScreen, "default", 7, NULL);
	if (!output)
	    return;
	RROutputSetCrtcs (output, &crtc, 1);
	RROutputSetConnection (output, RR_Connected);
#ifdef RENDER
	RROutputSetSubpixelOrder (output, PictureGetSubpixelOrder (pScreen));
#endif
    }

    output = pScrPriv->outputs[0];
    if (!output)
	return;
    crtc = pScrPriv->crtcs[0];
    if (!crtc)
	return;

    /* check rotations */
    if (rotations != crtc->rotations)
    {
        crtc->rotations = rotations;
	crtc->changed = TRUE;
	pScrPriv->changed = TRUE;
    }
	
    /* regenerate mode list */
    for (i = 0; i < pScrPriv->nSizes; i++)
    {
	RRScreenSizePtr	size = &pScrPriv->pSizes[i];
	int		r;

	if (size->nRates)
	{
	    for (r = 0; r < size->nRates; r++)
	    {
		mode = RROldModeAdd (output, size, size->pRates[r].rate);
		if (i == pScrPriv->size && 
		    size->pRates[r].rate == pScrPriv->rate)
		{
		    newMode = mode;
		}
	    }
	    xfree (size->pRates);
	}
	else
	{
	    mode = RROldModeAdd (output, size, 0);
	    if (i == pScrPriv->size)
		newMode = mode;
	}
    }
    if (pScrPriv->nSizes)
	xfree (pScrPriv->pSizes);
    pScrPriv->pSizes = NULL;
    pScrPriv->nSizes = 0;
	    
    /* find size bounds */
    for (i = 0; i < output->numModes + output->numUserModes; i++) 
    {
	mode = (i < output->numModes ? 
			    output->modes[i] : 
			    output->userModes[i-output->numModes]);
        width = mode->mode.width;
        height = mode->mode.height;
	
	if (width < minWidth) minWidth = width;
	if (width > maxWidth) maxWidth = width;
	if (height < minHeight) minHeight = height;
	if (height > maxHeight) maxHeight = height;
    }

    RRScreenSetSizeRange (pScreen, minWidth, minHeight, maxWidth, maxHeight);

    /* notice current mode */
    if (newMode)
	RRCrtcNotify (crtc, newMode, 0, 0, pScrPriv->rotation,
		      1, &output);
}