#define _DRISW_API_H_
#include "pipe/p_compiler.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_format.h"
-
-#include "state_tracker/drm_api.h"
struct pipe_screen;
-struct pipe_winsys;
-struct pipe_buffer;
-struct pipe_context;
-struct pipe_texture;
-
struct dri_drawable;
/**
* This callback struct is intended for the winsys to call the loader.
*/
-
struct drisw_loader_funcs
{
void (*put_image) (struct dri_drawable *dri_drawable,
void *data, unsigned width, unsigned height);
};
-struct drisw_create_screen_arg
-{
- struct drm_create_screen_arg base;
-
- struct drisw_loader_funcs *lf;
-};
+/**
+ * Implemented by the drisw target.
+ */
+struct pipe_screen * drisw_create_screen(struct drisw_loader_funcs *lf);
#endif
enum drm_create_screen_mode {
DRM_CREATE_NORMAL = 0,
DRM_CREATE_DRI1,
- DRM_CREATE_DRISW,
DRM_CREATE_DRIVER = 1024,
DRM_CREATE_MAX
};
const __DRIconfig **configs;
struct dri_screen *screen;
struct pipe_screen *pscreen;
- struct drisw_create_screen_arg arg;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
sPriv->private = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
- arg.base.mode = DRM_CREATE_DRISW;
- arg.lf = &drisw_lf;
-
- pscreen = screen->api->create_screen(screen->api, screen->fd, &arg.base);
+ pscreen = drisw_create_screen(&drisw_lf);
/* dri_init_screen_helper checks pscreen for us */
configs = dri_init_screen_helper(screen, pscreen, 32);
return screen;
}
-static struct pipe_screen *
-swrast_drm_create_screen(struct drm_api *api,
- int drmFD,
- struct drm_create_screen_arg *arg)
+struct pipe_screen *
+drisw_create_screen(struct drisw_loader_funcs *lf)
{
struct sw_winsys *winsys = NULL;
struct pipe_screen *screen = NULL;
- struct drisw_create_screen_arg *drisw;
-
- (void) drmFD;
-
- if (arg != NULL) {
- switch(arg->mode) {
- case DRM_CREATE_DRISW:
- drisw = (struct drisw_create_screen_arg *)arg;
- break;
- default:
- return NULL;
- }
- }
- else {
- return NULL;
- }
- winsys = dri_create_sw_winsys(drisw->lf);
+ winsys = dri_create_sw_winsys(lf);
if (winsys == NULL)
return NULL;
return NULL;
}
-static void
-swrast_drm_api_destroy(struct drm_api *api)
-{
- return;
-}
-
-static struct drm_api swrast_drm_api =
-{
- .name = "swrast",
- .driver_name = "swrast",
- .create_screen = swrast_drm_create_screen,
- .destroy = swrast_drm_api_destroy,
-};
-
-struct drm_api *
-drm_api_create()
-{
- return &swrast_drm_api;
-}
-
/* vim: set sw=3 ts=8 sts=3 expandtab: */