XORG_FALLBACK("not GXcopy");
if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
- priv->tex->target,
+ priv->tex->target, 0,
PIPE_BIND_RENDER_TARGET, 0)) {
XORG_FALLBACK("format %s", util_format_name(priv->tex->format));
}
XORG_FALLBACK("alu not GXcopy");
if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
- priv->tex->target,
+ priv->tex->target, 0,
PIPE_BIND_RENDER_TARGET, 0))
XORG_FALLBACK("pDst format %s", util_format_name(priv->tex->format));
if (!exa->scrn->is_format_supported(exa->scrn, src_priv->tex->format,
- src_priv->tex->target,
+ src_priv->tex->target, 0,
PIPE_BIND_SAMPLER_VIEW, 0))
XORG_FALLBACK("pSrc format %s", util_format_name(src_priv->tex->format));
exa->copy.src = src_priv;
exa->copy.dst = priv;
- /* For same-surface copies, the pipe->surface_copy path is clearly
- * superior, providing it is implemented. In other cases it's not
- * clear what the better path would be, and eventually we'd
- * probably want to gather timings and choose dynamically.
+ /* XXX this used to use resource_copy_region for same-surface copies,
+ * but they were redefined to not allow overlaps (some of the util code
+ * always assumed this anyway).
+ * Drivers should implement accelerated resource_copy_region or it will
+ * be slow - disable for now.
*/
- if (exa->pipe->surface_copy &&
- exa->copy.src == exa->copy.dst) {
-
+ if (0 && exa->copy.src != exa->copy.dst) {
exa->copy.use_surface_copy = TRUE;
-
- exa->copy.src_surface =
- exa->scrn->get_tex_surface( exa->scrn,
- exa->copy.src->tex,
- 0, 0, 0,
- PIPE_BIND_BLIT_SOURCE);
-
- exa->copy.dst_surface =
- exa->scrn->get_tex_surface( exa->scrn,
- exa->copy.dst->tex,
- 0, 0, 0,
- PIPE_BIND_BLIT_DESTINATION );
}
else {
exa->copy.use_surface_copy = FALSE;
exa->scrn->get_tex_surface(exa->scrn,
exa->copy.dst->tex,
0, 0, 0,
- PIPE_BIND_BLIT_DESTINATION);
+ PIPE_BIND_RENDER_TARGET);
renderer_copy_prepare(exa->renderer,
(void) priv;
if (exa->copy.use_surface_copy) {
- /* XXX: consider exposing >1 box in surface_copy interface.
- */
- exa->pipe->surface_copy( exa->pipe,
- exa->copy.dst_surface,
- dstX, dstY,
- exa->copy.src_surface,
- srcX, srcY,
- width, height );
+ struct pipe_subresource subdst, subsrc;
+ subdst.face = 0;
+ subdst.level = 0;
+ subsrc.face = 0;
+ subsrc.level = 0;
+ exa->pipe->resource_copy_region( exa->pipe,
+ exa->copy.dst->tex,
+ subdst,
+ dstX, dstY, 0,
+ exa->copy.src->tex,
+ subsrc,
+ srcX, srcY, 0,
+ width, height );
}
else {
renderer_copy_pixmap(exa->renderer,
exa->copy.src = NULL;
exa->copy.dst = NULL;
- pipe_surface_reference(&exa->copy.src_surface, NULL);
pipe_surface_reference(&exa->copy.dst_surface, NULL);
pipe_resource_reference(&exa->copy.src_texture, NULL);
}
XORG_FALLBACK("pDst %s", !priv ? "!priv" : "!priv->tex");
if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
- priv->tex->target,
+ priv->tex->target, 0,
PIPE_BIND_RENDER_TARGET, 0))
XORG_FALLBACK("pDst format: %s", util_format_name(priv->tex->format));
XORG_FALLBACK("pSrc %s", !priv ? "!priv" : "!priv->tex");
if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
- priv->tex->target,
+ priv->tex->target, 0,
PIPE_BIND_SAMPLER_VIEW, 0))
XORG_FALLBACK("pSrc format: %s", util_format_name(priv->tex->format));
XORG_FALLBACK("pMask %s", !priv ? "!priv" : "!priv->tex");
if (!exa->scrn->is_format_supported(exa->scrn, priv->tex->format,
- priv->tex->target,
+ priv->tex->target, 0,
PIPE_BIND_SAMPLER_VIEW, 0))
XORG_FALLBACK("pMask format: %s", util_format_name(priv->tex->format));
texture = exa->scrn->resource_create(exa->scrn, &template);
if (priv->tex) {
- struct pipe_surface *dst_surf;
+ struct pipe_subresource subdst, subsrc;
struct pipe_surface *src_surf;
- dst_surf = exa->scrn->get_tex_surface(
- exa->scrn, texture, 0, 0, 0, PIPE_BIND_BLIT_DESTINATION);
- src_surf = xorg_gpu_surface(exa->pipe->screen, priv);
- if (exa->pipe->surface_copy) {
- exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
- 0, 0, min(width, texture->width0),
- min(height, texture->height0));
- } else {
- util_surface_copy(exa->pipe, FALSE, dst_surf, 0, 0, src_surf,
- 0, 0, min(width, texture->width0),
- min(height, texture->height0));
- }
- exa->scrn->tex_surface_destroy(dst_surf);
- exa->scrn->tex_surface_destroy(src_surf);
+ subdst.face = 0;
+ subdst.level = 0;
+ subsrc.face = 0;
+ subsrc.level = 0;
+ exa->pipe->resource_copy_region(exa->pipe, texture,
+ subdst, 0, 0, 0,
+ priv->tex,
+ subsrc, 0, 0, 0,
+ min(width, texture->width0),
+ min(height, texture->height0));
}
pipe_resource_reference(&priv->tex, texture);
struct pipe_surface *
xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv)
{
-
- /* seems to get called both for blits and render target usage */
return scrn->get_tex_surface(scrn, priv->tex, 0, 0, 0,
- PIPE_BIND_BLIT_SOURCE |
- PIPE_BIND_BLIT_DESTINATION |
PIPE_BIND_RENDER_TARGET);
}
struct xorg_shader shader;
assert(screen->is_format_supported(screen, dst_surface->format,
- PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_2D, 0,
PIPE_BIND_RENDER_TARGET,
0));
(void) screen;
/* the coming in texture should already have that invariance */
debug_assert(screen->is_format_supported(screen, src->format,
- PIPE_TEXTURE_2D,
+ PIPE_TEXTURE_2D, 0,
PIPE_BIND_SAMPLER_VIEW, 0));
format = src->format;
{
/* copy source framebuffer surface into texture */
- struct pipe_surface *ps_read = screen->get_tex_surface(
- screen, src, 0, 0, 0, PIPE_BIND_BLIT_SOURCE);
- struct pipe_surface *ps_tex = screen->get_tex_surface(
- screen, pt, 0, 0, 0, PIPE_BIND_BLIT_DESTINATION );
- if (pipe->surface_copy) {
- pipe->surface_copy(pipe,
- ps_tex, /* dest */
- 0, 0, /* destx/y */
- ps_read,
- 0, 0, src->width0, src->height0);
- } else {
- util_surface_copy(pipe, FALSE,
- ps_tex, /* dest */
- 0, 0, /* destx/y */
- ps_read,
- 0, 0, src->width0, src->height0);
- }
- pipe_surface_reference(&ps_read, NULL);
- pipe_surface_reference(&ps_tex, NULL);
+ struct pipe_subresource subsrc, subdst;
+ subsrc.face = 0;
+ subsrc.level = 0;
+ subdst.face = 0;
+ subdst.level = 0;
+ pipe->resource_copy_region(pipe,
+ pt, /* dest */
+ subdst,
+ 0, 0, 0, /* destx/y/z */
+ src,
+ subsrc,
+ 0, 0, 0,
+ src->width0, src->height0);
}
return pt;