st/drisw: Stop pretending to be drm_api
authorJakob Bornecrantz <wallbraker@gmail.com>
Wed, 14 Apr 2010 22:03:51 +0000 (23:03 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Fri, 16 Apr 2010 09:18:05 +0000 (10:18 +0100)
Reviewed-by: George Sapountzis <gsapountzis@gmail.com>
src/gallium/include/state_tracker/drisw_api.h
src/gallium/include/state_tracker/drm_api.h
src/gallium/state_trackers/dri/sw/drisw.c
src/gallium/targets/dri-swrast/swrast_drm_api.c

index c6adebb4ec5dd0628988228c96c25b51b4c3e0af..944a649257e08e8f31f1567f17f79b0a46264906 100644 (file)
@@ -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
index 50c8c1cf191a7d738024f1e6a1e802acfd4e47fc..3d8fdd86fc7552ab3fba1aa27bbf6d8c35f22d7f 100644 (file)
@@ -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
 };
index 7f7d737f5583d2592744b075f9122101d7599386..9edddf01b57f8bf7b9c09ff632e97c88156448ea 100644 (file)
@@ -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);
index 63b935bb07b52d327f2a4c16940d04cb9d8c7a0c..e8d6d8069cc6a29980352367574507f3860857a2 100644 (file)
@@ -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: */