drm/radeon: remove softpipe references
authorKeith Whitwell <keithw@vmware.com>
Mon, 8 Feb 2010 16:35:32 +0000 (16:35 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 8 Feb 2010 17:17:58 +0000 (17:17 +0000)
src/gallium/winsys/drm/radeon/core/radeon_buffer.c
src/gallium/winsys/drm/radeon/core/radeon_drm.c

index f484503e0e68424831549aedd906c53ef66853f6..3b1c3860a4c4cec187cf3d9b13940c62e4934752 100644 (file)
@@ -33,7 +33,6 @@
 #include "radeon_buffer.h"
 
 #include "radeon_bo_gem.h"
-#include "softpipe/sp_texture.h"
 #include "r300_context.h"
 #include "util/u_format.h"
 #include "util/u_math.h"
@@ -252,55 +251,6 @@ static int radeon_fence_finish(struct pipe_winsys *ws,
     return 0;
 }
 
-static void radeon_display_surface(struct pipe_winsys *pws,
-                                   struct pipe_surface *psurf,
-                                   struct radeon_vl_context *rvl_ctx)
-{
-    struct r300_texture *r300tex = (struct r300_texture *)(psurf->texture);
-    XImage *ximage;
-    void *data;
-
-    ximage = XCreateImage(rvl_ctx->display,
-                          XDefaultVisual(rvl_ctx->display, rvl_ctx->screen),
-                          XDefaultDepth(rvl_ctx->display, rvl_ctx->screen),
-                          ZPixmap, 0,   /* format, offset */
-                          NULL,         /* data */
-                          0, 0,         /* size */
-                          32,           /* bitmap_pad */
-                          0);           /* bytes_per_line */
-
-    assert(ximage->format);
-    assert(ximage->bitmap_unit);
-
-    data = pws->buffer_map(pws, r300tex->buffer, 0);
-
-    /* update XImage's fields */
-    ximage->data = data;
-    ximage->width = psurf->width;
-    ximage->height = psurf->height;
-    ximage->bytes_per_line = psurf->width * (ximage->bits_per_pixel >> 3);
-
-    XPutImage(rvl_ctx->display, rvl_ctx->drawable,
-              XDefaultGC(rvl_ctx->display, rvl_ctx->screen),
-              ximage, 0, 0, 0, 0, psurf->width, psurf->height);
-
-    XSync(rvl_ctx->display, 0);
-
-    ximage->data = NULL;
-    XDestroyImage(ximage);
-
-    pws->buffer_unmap(pws, r300tex->buffer);
-}
-
-static void radeon_flush_frontbuffer(struct pipe_winsys *pipe_winsys,
-                                     struct pipe_surface *pipe_surface,
-                                     void *context_private)
-{
-    struct radeon_vl_context *rvl_ctx;
-    rvl_ctx = (struct radeon_vl_context *) context_private;
-    radeon_display_surface(pipe_winsys, pipe_surface, rvl_ctx);
-}
-
 struct radeon_winsys* radeon_pipe_winsys(int fd)
 {
     struct radeon_winsys* radeon_ws;
@@ -319,7 +269,7 @@ struct radeon_winsys* radeon_pipe_winsys(int fd)
     radeon_ws->priv->fd = fd;
     radeon_ws->priv->bom = radeon_bo_manager_gem_ctor(fd);
 
-    radeon_ws->base.flush_frontbuffer = radeon_flush_frontbuffer;
+    radeon_ws->base.flush_frontbuffer = NULL; /* overriden by co-state tracker */
 
     radeon_ws->base.buffer_create = radeon_buffer_create;
     radeon_ws->base.user_buffer_create = radeon_buffer_user_create;
index d1cb6493668deab153e810be315a76b69093ac15..257bdca223dd03d4f6830ef4940689ccc2f9c11b 100644 (file)
@@ -29,8 +29,6 @@
  *      Joakim Sindholt <opensource@zhasha.com>
  */
 
-#include "softpipe/sp_winsys.h"
-
 #include "radeon_drm.h"
 
 /* Helper function to do the ioctls needed for setup and init. */
@@ -128,10 +126,10 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api,
     struct radeon_winsys* rwinsys = radeon_pipe_winsys(drmFB);
     do_ioctls(drmFB, rwinsys);
 
-    if (!is_r3xx(rwinsys->pci_id) ||
-        debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) {
-        return softpipe_create_screen((struct pipe_winsys*)rwinsys);
-    } else {
+    /* The state tracker can organize a softpipe fallback if no hw
+     * driver is found.
+     */
+    if (is_r3xx(rwinsys->pci_id)) {
         radeon_setup_winsys(drmFB, rwinsys);
         return r300_create_screen(rwinsys);
     }