#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"
--- /dev/null
+
+#ifndef R600_PUBLIC_H
+#define R600_PUBLIC_H
+
+struct radeon;
+
+struct pipe_screen* r600_screen_create(struct radeon *rw);
+
+#endif
#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)
FREE(rscreen);
}
-struct pipe_screen *radeon_create_screen(struct radeon *rw)
+struct pipe_screen *r600_screen_create(struct radeon *rw)
{
struct r600_screen* rscreen;
#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"
struct radeon;
-struct pipe_screen *radeon_create_screen(struct radeon *rw);
-
enum radeon_family {
CHIP_UNKNOWN,
CHIP_R100,
-#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)
* Joakim Sindholt <opensource@zhasha.com>
*/
#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,
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
-}
--- /dev/null
+
+#ifndef R600_DRM_PUBLIC_H
+#define R600_DRM_PUBLIC_H
+
+struct radeon;
+
+struct radeon *r600_drm_winsys_create(int drmFD);
+
+#endif