Exemplo n.º 1
0
vfbCloseScreen(ScreenPtr pScreen)
#endif
{
#if XORG < 113
    vfbScreenInfoPtr pvfb = &vfbScreens[index];
#else
    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
#endif
    int i;
 
    pScreen->CloseScreen = pvfb->closeScreen;

    /*
     * XXX probably lots of stuff to clean.  For now,
     * clear installed colormaps so that server reset works correctly.
     */
#if XORG < 113
    for (i = 0; i < MAXSCREENS; i++)
	InstalledMaps[i] = NULL;

    return pScreen->CloseScreen(index, pScreen);
#else
    for (i = 0; i < screenInfo.numScreens; i++)
	SetInstalledColormap(screenInfo.screens[i], NULL);

    /*
     * fb overwrites miCloseScreen, so do this here
     */
    if (pScreen->devPrivate)
        (*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate);
    pScreen->devPrivate = NULL;

    return pScreen->CloseScreen(pScreen);
#endif
}
Exemplo n.º 2
0
static Bool
glamor_egl_close_screen(ScreenPtr screen)
{
    ScrnInfoPtr scrn;
    struct glamor_egl_screen_private *glamor_egl;
    PixmapPtr screen_pixmap;
    EGLImageKHR back_image;

    scrn = xf86ScreenToScrn(screen);
    glamor_egl = glamor_egl_get_screen_private(scrn);
    screen_pixmap = screen->GetScreenPixmap(screen);

    eglDestroyImageKHR(glamor_egl->display,glamor_egl->front_image);
    dixSetPrivate(&screen_pixmap->devPrivates, glamor_egl_pixmap_private_key,
                  NULL);
    glamor_egl->front_image = NULL;
    if (glamor_egl->back_pixmap && *glamor_egl->back_pixmap) {
        back_image = dixLookupPrivate(&(*glamor_egl->back_pixmap)->devPrivates,
                                      glamor_egl_pixmap_private_key);
        if (back_image != NULL && back_image != EGL_NO_IMAGE_KHR) {
            eglDestroyImageKHR(glamor_egl->display, back_image);
            dixSetPrivate(&(*glamor_egl->back_pixmap)->devPrivates,
                          glamor_egl_pixmap_private_key, NULL);
        }
    }

    screen->CloseScreen = glamor_egl->saved_close_screen;

    return screen->CloseScreen(screen);
}
Exemplo n.º 3
0
static Bool vgaswitch_close_screen(ScreenPtr pScreen)
{
	system("/sbin/vga_switch -g start");
	pScreen->CloseScreen = vgaswitch_fake_dev.savedCloseScreen;
	Bool r = pScreen->CloseScreen(pScreen);
	vgaswitch_fake_dev.savedCloseScreen = pScreen->CloseScreen;
	pScreen->CloseScreen = vgaswitch_close_screen;
	system("/bin/sh -c 'sleep 15; /sbin/vga_switch -g stop;' &");
	return r;
}
Exemplo n.º 4
0
static Bool
RootlessCloseScreen(int i, ScreenPtr pScreen)
{
    RootlessScreenRec *s;

    s = SCREENREC(pScreen);

    // fixme unwrap everything that was wrapped?
    pScreen->CloseScreen = s->CloseScreen;

    xfree(s);
    return pScreen->CloseScreen(i, pScreen);
}
Exemplo n.º 5
0
Bool
glamor_close_screen(ScreenPtr screen)
{
    glamor_screen_private *glamor_priv;
    PixmapPtr screen_pixmap;
    int flags;

#ifdef RENDER
    PictureScreenPtr ps = GetPictureScreenIfSet(screen);
#endif
    glamor_priv = glamor_get_screen_private(screen);
    flags = glamor_priv->flags;
    glamor_sync_close(screen);
    glamor_glyphs_fini(screen);
    screen->CloseScreen = glamor_priv->saved_procs.close_screen;
    screen->CreateScreenResources =
        glamor_priv->saved_procs.create_screen_resources;
    if (flags & GLAMOR_USE_SCREEN) {

        screen->CreateGC = glamor_priv->saved_procs.create_gc;
        screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
        screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
        screen->GetSpans = glamor_priv->saved_procs.get_spans;
        screen->ChangeWindowAttributes =
            glamor_priv->saved_procs.change_window_attributes;
        screen->CopyWindow = glamor_priv->saved_procs.copy_window;
        screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
    }
#ifdef RENDER
    if (ps && (flags & GLAMOR_USE_PICTURE_SCREEN)) {

        ps->Composite = glamor_priv->saved_procs.composite;
        ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
        ps->Triangles = glamor_priv->saved_procs.triangles;
        ps->CreatePicture = glamor_priv->saved_procs.create_picture;
    }
    ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
    ps->Glyphs = glamor_priv->saved_procs.glyphs;
    ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph;
    screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
#endif
    screen_pixmap = screen->GetScreenPixmap(screen);
    glamor_set_pixmap_private(screen_pixmap, NULL);
    if (glamor_priv->back_pixmap && *glamor_priv->back_pixmap)
        glamor_set_pixmap_private(*glamor_priv->back_pixmap, NULL);

    glamor_release_screen_priv(screen);

    return screen->CloseScreen(screen);
}
static Bool
exaXorgCloseScreen (int i, ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
    ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr)
	dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey);

    pScreen->CloseScreen = pScreenPriv->SavedCloseScreen;

    pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess;

    xfree (pScreenPriv->options);
    xfree (pScreenPriv);

    return pScreen->CloseScreen (i, pScreen);
}
Exemplo n.º 7
0
static Bool
exaXorgCloseScreen(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
    ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr)
        dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey);

    pScreen->CloseScreen = pScreenPriv->SavedCloseScreen;

    pScrn->EnableDisableFBAccess = pScreenPriv->SavedEnableDisableFBAccess;

    free(pScreenPriv->options);
    free(pScreenPriv);

    return pScreen->CloseScreen(pScreen);
}
Exemplo n.º 8
0
static Bool
shadowCloseScreen(int i, ScreenPtr pScreen)
{
    shadowBuf(pScreen);

    unwrap(pBuf, pScreen, GetImage);
    unwrap(pBuf, pScreen, CloseScreen);
    shadowRemove(pScreen, pBuf->pPixmap);
    DamageDestroy(pBuf->pDamage);
#ifdef BACKWARDS_COMPATIBILITY
    REGION_UNINIT(pScreen, &pBuf->damage); /* bc */
#endif
    if (pBuf->pPixmap)
	pScreen->DestroyPixmap(pBuf->pPixmap);
    xfree(pBuf);
    return pScreen->CloseScreen(i, pScreen);
}
Exemplo n.º 9
0
static Bool
shadowCloseScreen(ScreenPtr pScreen)
{
    shadowBuf(pScreen);

    unwrap(pBuf, pScreen, GetImage);
    unwrap(pBuf, pScreen, CloseScreen);
    shadowRemove(pScreen, pBuf->pPixmap);
    DamageDestroy(pBuf->pDamage);
#ifdef BACKWARDS_COMPATIBILITY
    RegionUninit(&pBuf->damage);        /* bc */
#endif
    if (pBuf->pPixmap)
        pScreen->DestroyPixmap(pBuf->pPixmap);
    free(pBuf);
    return pScreen->CloseScreen(pScreen);
}
Exemplo n.º 10
0
static Bool
VidModeClose(ScreenPtr pScreen)
{
    VidModePtr pVidMode = VMPTR(pScreen);

    /* This shouldn't happen */
    if (!pVidMode)
        return FALSE;

    pScreen->CloseScreen = pVidMode->CloseScreen;

    if (--VidModeCount == 0) {
        free(dixLookupPrivate(&pScreen->devPrivates, VidModeKey));
        dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL);
        VidModeKey = NULL;
    }
    return pScreen->CloseScreen(pScreen);
}
Exemplo n.º 11
0
static Bool
RootlessCloseScreen(int i, ScreenPtr pScreen)
{
    RootlessScreenRec *s;

    s = SCREENREC(pScreen);

    // fixme unwrap everything that was wrapped?
    pScreen->CloseScreen = s->CloseScreen;

    if (s->pixmap_data != NULL) {
        free(s->pixmap_data);
        s->pixmap_data = NULL;
        s->pixmap_data_size = 0;
    }

    free(s);
    return pScreen->CloseScreen(i, pScreen);
}
Exemplo n.º 12
0
static Bool
VidModeClose(int i, ScreenPtr pScreen)
{
    VidModePtr pVidMode = VMPTR(pScreen);

    DEBUG_P("VidModeClose");

    /* This shouldn't happen */
    if (!pVidMode)
	return FALSE;

    pScreen->CloseScreen = pVidMode->CloseScreen;

    if (--VidModeCount == 0) {
	if (pScreen->devPrivates[VidModeIndex].ptr)
	  xfree(pScreen->devPrivates[VidModeIndex].ptr);
	pScreen->devPrivates[VidModeIndex].ptr = NULL;
	VidModeIndex = -1;
    }
    return pScreen->CloseScreen(i, pScreen);
}
Exemplo n.º 13
0
Bool
glamor_close_screen(ScreenPtr screen)
{
    glamor_screen_private *glamor_priv;
    PixmapPtr screen_pixmap;
    PictureScreenPtr ps = GetPictureScreenIfSet(screen);

    glamor_priv = glamor_get_screen_private(screen);
    glamor_sync_close(screen);
    glamor_composite_glyphs_fini(screen);
    screen->CloseScreen = glamor_priv->saved_procs.close_screen;
    screen->CreateScreenResources =
        glamor_priv->saved_procs.create_screen_resources;

    screen->CreateGC = glamor_priv->saved_procs.create_gc;
    screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
    screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
    screen->GetSpans = glamor_priv->saved_procs.get_spans;
    screen->ChangeWindowAttributes =
        glamor_priv->saved_procs.change_window_attributes;
    screen->CopyWindow = glamor_priv->saved_procs.copy_window;
    screen->BitmapToRegion = glamor_priv->saved_procs.bitmap_to_region;
    screen->BlockHandler = glamor_priv->saved_procs.block_handler;

    ps->Composite = glamor_priv->saved_procs.composite;
    ps->Trapezoids = glamor_priv->saved_procs.trapezoids;
    ps->Triangles = glamor_priv->saved_procs.triangles;
    ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
    ps->Glyphs = glamor_priv->saved_procs.glyphs;

    screen_pixmap = screen->GetScreenPixmap(screen);
    glamor_pixmap_destroy_fbo(screen_pixmap);

    glamor_release_screen_priv(screen);

    return screen->CloseScreen(screen);
}