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;
}
Exemplo n.º 2
0
static struct pipe_screen *
create_screen(int fd)
{
   struct radeon_winsys *sws;
   struct pipe_screen *screen;

   sws = radeon_drm_winsys_create(fd);
   if (!sws)
      return NULL;

   screen = r300_screen_create(sws);
   if (!screen)
      return NULL;

   screen = debug_screen_wrap(screen);

   return screen;
}
Exemplo n.º 3
0
static struct pipe_screen *
pipe_r300_create_screen(int fd)
{
#if _EGL_PIPE_R300
   struct radeon_winsys *sws;
   struct pipe_screen *screen;

   sws = radeon_drm_winsys_create(fd);
   if (!sws)
      return NULL;

   screen = r300_screen_create(sws);
   if (!screen)
      return NULL;

   screen = debug_screen_wrap(screen);

   return screen;
#else
   return NULL;
#endif
}