summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-04-14 23:03:51 +0100
committerJakob Bornecrantz <[email protected]>2010-04-16 10:18:05 +0100
commit53c57191c5f24d3620e2e4ce95dd12b5c6e9109b (patch)
tree358239c993fbeb6429e2a0f4de91a5d0528caf0c /src
parent39c81dada01585a6030f03d215842a1a2ae87d86 (diff)
st/drisw: Stop pretending to be drm_api
Reviewed-by: George Sapountzis <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/state_tracker/drisw_api.h20
-rw-r--r--src/gallium/include/state_tracker/drm_api.h1
-rw-r--r--src/gallium/state_trackers/dri/sw/drisw.c6
-rw-r--r--src/gallium/targets/dri-swrast/swrast_drm_api.c44
4 files changed, 8 insertions, 63 deletions
diff --git a/src/gallium/include/state_tracker/drisw_api.h b/src/gallium/include/state_tracker/drisw_api.h
index c6adebb4ec5..944a649257e 100644
--- a/src/gallium/include/state_tracker/drisw_api.h
+++ b/src/gallium/include/state_tracker/drisw_api.h
@@ -2,34 +2,22 @@
#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
diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h
index 50c8c1cf191..3d8fdd86fc7 100644
--- a/src/gallium/include/state_tracker/drm_api.h
+++ b/src/gallium/include/state_tracker/drm_api.h
@@ -13,7 +13,6 @@ struct pipe_resource;
enum drm_create_screen_mode {
DRM_CREATE_NORMAL = 0,
DRM_CREATE_DRI1,
- DRM_CREATE_DRISW,
DRM_CREATE_DRIVER = 1024,
DRM_CREATE_MAX
};
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 7f7d737f558..9edddf01b57 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -262,7 +262,6 @@ drisw_init_screen(__DRIscreen * sPriv)
const __DRIconfig **configs;
struct dri_screen *screen;
struct pipe_screen *pscreen;
- struct drisw_create_screen_arg arg;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
@@ -275,10 +274,7 @@ drisw_init_screen(__DRIscreen * sPriv)
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);
diff --git a/src/gallium/targets/dri-swrast/swrast_drm_api.c b/src/gallium/targets/dri-swrast/swrast_drm_api.c
index 63b935bb07b..e8d6d8069cc 100644
--- a/src/gallium/targets/dri-swrast/swrast_drm_api.c
+++ b/src/gallium/targets/dri-swrast/swrast_drm_api.c
@@ -83,31 +83,13 @@ swrast_create_screen(struct sw_winsys *winsys)
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;
@@ -124,24 +106,4 @@ fail:
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: */