static int pipe_init_screen(struct pipe_manager *pm) { struct pipe_screen *screen = NULL; #ifdef ENABLE_PIPE_NOUVEAU if (strcmp(pm->driver, "nouveau") == 0) screen = nouveau_drm_screen_create(pm->fd); #endif #ifdef ENABLE_PIPE_R300 if (strcmp(pm->driver, "r300") == 0) { struct radeon_winsys *sws = radeon_drm_winsys_create(pm->fd); if (sws) { screen = r300_screen_create(sws); if (!screen) sws->destroy(sws); } } #endif #ifdef ENABLE_PIPE_R600 if (strcmp(pm->driver, "r600") == 0) { struct radeon *rw = r600_drm_winsys_create(pm->fd); if (rw) { screen = r600_screen_create(rw); if (!screen) FREE(rw); } } #endif #ifdef ENABLE_PIPE_VMWGFX if (strcmp(pm->driver, "vmwgfx") == 0) { struct svga_winsys_screen *sws = svga_drm_winsys_screen_create(pm->fd); if (sws) { screen = svga_screen_create(sws); if (!screen) sws->destroy(sws); } } #endif if (!screen) { LOGW("failed to create screen for %s", pm->driver); return -EINVAL; } pm->screen = debug_screen_wrap(screen); return 0; }
static struct pipe_screen *create_screen(int fd) { struct radeon *radeon; struct pipe_screen *screen; radeon = r600_drm_winsys_create(fd); if (!radeon) return NULL; screen = r600_screen_create(radeon); if (!screen) return NULL; screen = debug_screen_wrap(screen); return screen; }