Пример #1
0
/*
 * Convert a RandR mode to a DisplayMode
 */
static void
xf86RandRModeConvert (ScrnInfoPtr	scrn,
		      RRModePtr		randr_mode,
		      DisplayModePtr	mode)
{
    mode->prev = NULL;
    mode->next = NULL;
    mode->name = NULL;
    mode->status = MODE_OK;
    mode->type = 0;

    mode->Clock = randr_mode->mode.dotClock / 1000;
    
    mode->HDisplay = randr_mode->mode.width;
    mode->HSyncStart = randr_mode->mode.hSyncStart;
    mode->HSyncEnd = randr_mode->mode.hSyncEnd;
    mode->HTotal = randr_mode->mode.hTotal;
    mode->HSkew = randr_mode->mode.hSkew;
    
    mode->VDisplay = randr_mode->mode.height;
    mode->VSyncStart = randr_mode->mode.vSyncStart;
    mode->VSyncEnd = randr_mode->mode.vSyncEnd;
    mode->VTotal = randr_mode->mode.vTotal;
    mode->VScan = 0;

    mode->Flags = randr_mode->mode.modeFlags & FLAG_BITS;

    xf86SetModeCrtc (mode, scrn->adjustFlags);
}
Пример #2
0
static void
drmmode_ConvertFromKMode(ScrnInfoPtr scrn,
			 drmModeModeInfoPtr kmode,
			 DisplayModePtr	mode)
{
	memset(mode, 0, sizeof(DisplayModeRec));
	mode->status = MODE_OK;

	mode->Clock = kmode->clock;

	mode->HDisplay = kmode->hdisplay;
	mode->HSyncStart = kmode->hsync_start;
	mode->HSyncEnd = kmode->hsync_end;
	mode->HTotal = kmode->htotal;
	mode->HSkew = kmode->hskew;

	mode->VDisplay = kmode->vdisplay;
	mode->VSyncStart = kmode->vsync_start;
	mode->VSyncEnd = kmode->vsync_end;
	mode->VTotal = kmode->vtotal;
	mode->VScan = kmode->vscan;

	mode->Flags = kmode->flags; //& FLAG_BITS;
	mode->name = strdup(kmode->name);

	if (kmode->type & DRM_MODE_TYPE_DRIVER)
		mode->type = M_T_DRIVER;
	if (kmode->type & DRM_MODE_TYPE_PREFERRED)
		mode->type |= M_T_PREFERRED;
	xf86SetModeCrtc (mode, scrn->adjustFlags);
}
Пример #3
0
static Bool
i830_dvo_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
		    DisplayModePtr adjusted_mode)
{
    ScrnInfoPtr		    scrn = output->scrn;
    intel_screen_private    *intel = intel_get_screen_private(scrn);
    I830OutputPrivatePtr    intel_output = output->driver_private;

    /* If we have timings from the BIOS for the panel, put them in
     * to the adjusted mode.  The CRTC will be set up for this mode,
     * with the panel scaling set up to source from the H/VDisplay
     * of the original mode.
     */
    if (intel->lvds_fixed_mode != NULL) {
	adjusted_mode->HDisplay = intel->lvds_fixed_mode->HDisplay;
	adjusted_mode->HSyncStart = intel->lvds_fixed_mode->HSyncStart;
	adjusted_mode->HSyncEnd = intel->lvds_fixed_mode->HSyncEnd;
	adjusted_mode->HTotal = intel->lvds_fixed_mode->HTotal;
	adjusted_mode->VDisplay = intel->lvds_fixed_mode->VDisplay;
	adjusted_mode->VSyncStart = intel->lvds_fixed_mode->VSyncStart;
	adjusted_mode->VSyncEnd = intel->lvds_fixed_mode->VSyncEnd;
	adjusted_mode->VTotal = intel->lvds_fixed_mode->VTotal;
	adjusted_mode->Clock = intel->lvds_fixed_mode->Clock;
	xf86SetModeCrtc(adjusted_mode, INTERLACE_HALVE_V);
    }

    if (intel_output->i2c_drv->vid_rec->mode_fixup)
	return intel_output->i2c_drv->vid_rec->mode_fixup (intel_output->i2c_drv->dev_priv,
							   mode, adjusted_mode);
    return TRUE;
}
Пример #4
0
static DisplayModePtr
screen_create_mode (ScrnInfoPtr pScrn, int width, int height, int type)
{
    DisplayModePtr mode;

    mode = xnfcalloc (1, sizeof (DisplayModeRec));

    mode->status = MODE_OK;
    mode->type = type;
    mode->HDisplay   = width;
    mode->HSyncStart = (width * 105 / 100 + 7) & ~7;
    mode->HSyncEnd   = (width * 115 / 100 + 7) & ~7;
    mode->HTotal     = (width * 130 / 100 + 7) & ~7;
    mode->VDisplay   = height;
    mode->VSyncStart = height + 1;
    mode->VSyncEnd   = height + 4;
    mode->VTotal     = height * 1035 / 1000;
    mode->Clock = mode->HTotal * mode->VTotal * 60 / 1000;
    mode->Flags = V_NHSYNC | V_PVSYNC;

    xf86SetModeDefaultName (mode);
    xf86SetModeCrtc (mode, pScrn->adjustFlags); /* needed? xf86-video-modesetting does this */

    return mode;
}