From cf91accc93b9f172b2f7c970f39e69b268a5bb26 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 23 Jun 2010 23:03:28 +0200 Subject: nouveau: Move bootstrap code to targets Well sorta, at least I removed the drm_api dependancy and the target can layer anything it wants to now. --- src/gallium/targets/dri-nouveau/target.c | 17 +++++++++++++++-- src/gallium/targets/egl-nouveau/target.c | 17 +++++++++++++++-- src/gallium/targets/xorg-nouveau/nouveau_target.c | 17 +++++++++++++++-- 3 files changed, 45 insertions(+), 6 deletions(-) (limited to 'src/gallium/targets') diff --git a/src/gallium/targets/dri-nouveau/target.c b/src/gallium/targets/dri-nouveau/target.c index e16e86cd3d8..ca3ec53029a 100644 --- a/src/gallium/targets/dri-nouveau/target.c +++ b/src/gallium/targets/dri-nouveau/target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) diff --git a/src/gallium/targets/egl-nouveau/target.c b/src/gallium/targets/egl-nouveau/target.c index 49545c63e11..7d0b141e5a2 100644 --- a/src/gallium/targets/egl-nouveau/target.c +++ b/src/gallium/targets/egl-nouveau/target.c @@ -1,7 +1,20 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) /* A poor man's --whole-archive for EGL drivers */ void *_eglMain(void *); diff --git a/src/gallium/targets/xorg-nouveau/nouveau_target.c b/src/gallium/targets/xorg-nouveau/nouveau_target.c index e16e86cd3d8..ca3ec53029a 100644 --- a/src/gallium/targets/xorg-nouveau/nouveau_target.c +++ b/src/gallium/targets/xorg-nouveau/nouveau_target.c @@ -1,4 +1,17 @@ -#include "target-helpers/drm_api_compat.h" +#include "state_tracker/drm_driver.h" +#include "nouveau/drm/nouveau_drm_public.h" -DRM_API_COMPAT_STRUCT("nouveau", "nouveau") +static struct pipe_screen * +create_screen(int fd) +{ + struct pipe_screen *screen; + + screen = nouveau_drm_screen_create(fd); + if (!screen) + return NULL; + + return screen; +} + +DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen) -- cgit v1.2.3