#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"
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;
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;
* 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. */
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);
}