int
nouveau_present_init(ScreenPtr screen)
{
	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
	NVPtr pNv = NVPTR(scrn);
	struct nouveau_present *present;
	uint64_t value;
	int ret;

	present = pNv->present = calloc(1, sizeof(*present));
	if (!present)
		return -ENOMEM;

	present->info.version = PRESENT_SCREEN_INFO_VERSION;
	present->info.get_crtc = nouveau_present_crtc;
	present->info.get_ust_msc = nouveau_present_ust_msc;
	present->info.queue_vblank = nouveau_present_vblank_queue;
	present->info.abort_vblank = nouveau_present_vblank_abort;
	present->info.flush = nouveau_present_flush;

	if (pNv->has_pageflip) {
#ifdef DRM_CAP_ASYNC_PAGE_FLIP
		ret = drmGetCap(pNv->dev->fd, DRM_CAP_ASYNC_PAGE_FLIP, &value);
		if (ret == 0 && value == 1)
			present->info.capabilities |= PresentCapabilityAsync;
#endif
		present->info.check_flip = nouveau_present_flip_check;
		present->info.flip = nouveau_present_flip_next;
		present->info.unflip = nouveau_present_flip_stop;
	}

	return present_screen_init(screen, &present->info);
}
Ejemplo n.º 2
0
Bool
intel_present_screen_init(ScreenPtr screen)
{
	if (intel_present_has_async_flip(screen))
		intel_present_screen_info.capabilities |= PresentCapabilityAsync;

	return present_screen_init(screen, &intel_present_screen_info);
}
Ejemplo n.º 3
0
bool sna_present_open(struct sna *sna, ScreenPtr screen)
{
	if (sna->mode.num_real_crtc == 0)
		return false;

	sna_present_update(sna);

	return present_screen_init(screen, &present_info);
}
Ejemplo n.º 4
0
Bool
ms_present_screen_init(ScreenPtr screen)
{
    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
    modesettingPtr ms = modesettingPTR(scrn);
    uint64_t value;
    int ret;

    ret = drmGetCap(ms->fd, DRM_CAP_ASYNC_PAGE_FLIP, &value);
    if (ret == 0 && value == 1)
        ms_present_screen_info.capabilities |= PresentCapabilityAsync;

    return present_screen_init(screen, &ms_present_screen_info);
}