summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-06-24 02:10:18 +0200
committerJakob Bornecrantz <[email protected]>2010-06-24 02:15:50 +0200
commit92fde20de33d9ffb4ddce9b03eebbfbffe9d93bc (patch)
treedc5f7a068049a2c81e28a227734e15e3f25eacaa
parentcf91accc93b9f172b2f7c970f39e69b268a5bb26 (diff)
r600g: Move bootstrap code to target
-rw-r--r--src/gallium/drivers/r600/r600_buffer.c2
-rw-r--r--src/gallium/drivers/r600/r600_public.h9
-rw-r--r--src/gallium/drivers/r600/r600_screen.c3
-rw-r--r--src/gallium/drivers/r600/r600_texture.c2
-rw-r--r--src/gallium/drivers/r600/radeon.h2
-rw-r--r--src/gallium/targets/dri-r600/target.c23
-rw-r--r--src/gallium/winsys/r600/drm/r600_drm.c34
-rw-r--r--src/gallium/winsys/r600/drm/r600_drm_public.h9
8 files changed, 48 insertions, 36 deletions
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index 272f4dd6730..bc6e336ba7b 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -29,7 +29,7 @@
#include <util/u_math.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
-#include "state_tracker/drm_api.h"
+#include "state_tracker/drm_driver.h"
#include "r600_screen.h"
#include "r600_context.h"
diff --git a/src/gallium/drivers/r600/r600_public.h b/src/gallium/drivers/r600/r600_public.h
new file mode 100644
index 00000000000..1d89c9f9f61
--- /dev/null
+++ b/src/gallium/drivers/r600/r600_public.h
@@ -0,0 +1,9 @@
+
+#ifndef R600_PUBLIC_H
+#define R600_PUBLIC_H
+
+struct radeon;
+
+struct pipe_screen* r600_screen_create(struct radeon *rw);
+
+#endif
diff --git a/src/gallium/drivers/r600/r600_screen.c b/src/gallium/drivers/r600/r600_screen.c
index 1d83383fd95..20758b049c5 100644
--- a/src/gallium/drivers/r600/r600_screen.c
+++ b/src/gallium/drivers/r600/r600_screen.c
@@ -31,6 +31,7 @@
#include "r600_screen.h"
#include "r600_texture.h"
#include "r600_context.h"
+#include "r600_public.h"
#include <stdio.h>
static const char* r600_get_vendor(struct pipe_screen* pscreen)
@@ -240,7 +241,7 @@ static void r600_destroy_screen(struct pipe_screen* pscreen)
FREE(rscreen);
}
-struct pipe_screen *radeon_create_screen(struct radeon *rw)
+struct pipe_screen *r600_screen_create(struct radeon *rw)
{
struct r600_screen* rscreen;
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 7d94bbe510f..903cfad80a8 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -29,7 +29,7 @@
#include <util/u_math.h>
#include <util/u_inlines.h>
#include <util/u_memory.h>
-#include "state_tracker/drm_api.h"
+#include "state_tracker/drm_driver.h"
#include "r600_screen.h"
#include "r600_texture.h"
diff --git a/src/gallium/drivers/r600/radeon.h b/src/gallium/drivers/r600/radeon.h
index ec94b112d69..2a82aadd8ce 100644
--- a/src/gallium/drivers/r600/radeon.h
+++ b/src/gallium/drivers/r600/radeon.h
@@ -28,8 +28,6 @@ typedef uint8_t u8;
struct radeon;
-struct pipe_screen *radeon_create_screen(struct radeon *rw);
-
enum radeon_family {
CHIP_UNKNOWN,
CHIP_R100,
diff --git a/src/gallium/targets/dri-r600/target.c b/src/gallium/targets/dri-r600/target.c
index 3f09a7c5a92..40ad8a09ca8 100644
--- a/src/gallium/targets/dri-r600/target.c
+++ b/src/gallium/targets/dri-r600/target.c
@@ -1,4 +1,23 @@
-#include "target-helpers/drm_api_compat.h"
+#include "state_tracker/drm_driver.h"
+#include "r600/drm/r600_drm_public.h"
+#include "r600/r600_public.h"
-DRM_API_COMPAT_STRUCT("r600", "radeon")
+static struct pipe_screen *
+create_screen(int fd)
+{
+ struct radeon *rw;
+ struct pipe_screen *screen;
+
+ rw = r600_drm_winsys_create(fd);
+ if (!rw)
+ return NULL;
+
+ screen = r600_screen_create(rw);
+ if (!screen)
+ return NULL;
+
+ return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)
diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c
index b772ff0dd9f..469f1446d05 100644
--- a/src/gallium/winsys/r600/drm/r600_drm.c
+++ b/src/gallium/winsys/r600/drm/r600_drm.c
@@ -26,21 +26,18 @@
* Joakim Sindholt <[email protected]>
*/
#include <sys/ioctl.h>
-#include "trace/tr_drm.h"
#include "util/u_inlines.h"
#include "util/u_debug.h"
-#include "state_tracker/drm_api.h"
#include "radeon_priv.h"
#include "r600_screen.h"
#include "r600_texture.h"
+#include "r600_public.h"
+#include "r600_drm_public.h"
+#include "state_tracker/drm_driver.h"
-static struct pipe_screen *r600_drm_create_screen(struct drm_api* api, int drmfd)
+struct radeon *r600_drm_winsys_create(int drmfd)
{
- struct radeon *rw = radeon_new(drmfd, 0);
-
- if (rw == NULL)
- return NULL;
- return radeon_create_screen(rw);
+ return radeon_new(drmfd, 0);
}
boolean r600_buffer_get_handle(struct radeon *rw,
@@ -63,24 +60,3 @@ boolean r600_buffer_get_handle(struct radeon *rw,
whandle->handle = rbuffer->flink;
return TRUE;
}
-
-static void r600_drm_api_destroy(struct drm_api *api)
-{
- return;
-}
-
-struct drm_api drm_api_hooks = {
- .name = "r600",
- .driver_name = "r600",
- .create_screen = r600_drm_create_screen,
- .destroy = r600_drm_api_destroy,
-};
-
-struct drm_api* drm_api_create()
-{
-#ifdef DEBUG
- return trace_drm_create(&drm_api_hooks);
-#else
- return &drm_api_hooks;
-#endif
-}
diff --git a/src/gallium/winsys/r600/drm/r600_drm_public.h b/src/gallium/winsys/r600/drm/r600_drm_public.h
new file mode 100644
index 00000000000..84f2dce437a
--- /dev/null
+++ b/src/gallium/winsys/r600/drm/r600_drm_public.h
@@ -0,0 +1,9 @@
+
+#ifndef R600_DRM_PUBLIC_H
+#define R600_DRM_PUBLIC_H
+
+struct radeon;
+
+struct radeon *r600_drm_winsys_create(int drmFD);
+
+#endif