summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-06-17 14:17:10 +0800
committerChia-I Wu <[email protected]>2013-06-17 18:28:58 +0800
commit98bc4c62a621fa1f8c099c45767d22e5d2bc9741 (patch)
tree888e8619e233bb9ccadde1d5668fdccaa33967eb
parentebfd7a61c0a4ca9395ef7a522cc491208e3f045f (diff)
ilo: add pipe-based copy method to ilo_blitter
It enables accelerated resource_copy_region() when blt-based method fails.
-rw-r--r--src/gallium/drivers/ilo/ilo_blit.c9
-rw-r--r--src/gallium/drivers/ilo/ilo_blitter_pipe.c21
2 files changed, 25 insertions, 5 deletions
diff --git a/src/gallium/drivers/ilo/ilo_blit.c b/src/gallium/drivers/ilo/ilo_blit.c
index 0041cd10916..ff8e5869658 100644
--- a/src/gallium/drivers/ilo/ilo_blit.c
+++ b/src/gallium/drivers/ilo/ilo_blit.c
@@ -26,13 +26,9 @@
*/
#include "util/u_surface.h"
-#include "intel_reg.h"
#include "ilo_blitter.h"
#include "ilo_context.h"
-#include "ilo_cp.h"
-#include "ilo_resource.h"
-#include "ilo_screen.h"
#include "ilo_blit.h"
static void
@@ -51,6 +47,11 @@ ilo_resource_copy_region(struct pipe_context *pipe,
src, src_level, src_box))
return;
+ if (ilo_blitter_pipe_copy_resource(ilo->blitter,
+ dst, dst_level, dstx, dsty, dstz,
+ src, src_level, src_box))
+ return;
+
util_resource_copy_region(&ilo->base, dst, dst_level,
dstx, dsty, dstz, src, src_level, src_box);
}
diff --git a/src/gallium/drivers/ilo/ilo_blitter_pipe.c b/src/gallium/drivers/ilo/ilo_blitter_pipe.c
index cfec8b10e5f..e37231ac00b 100644
--- a/src/gallium/drivers/ilo/ilo_blitter_pipe.c
+++ b/src/gallium/drivers/ilo/ilo_blitter_pipe.c
@@ -139,7 +139,26 @@ ilo_blitter_pipe_copy_resource(struct ilo_blitter *blitter,
struct pipe_resource *src, unsigned src_level,
const struct pipe_box *src_box)
{
- return false;
+ const unsigned mask = PIPE_MASK_RGBAZS;
+ const bool copy_all_samples = true;
+
+ /* not until we allow rendertargets to be buffers */
+ if (dst->target == PIPE_BUFFER || src->target == PIPE_BUFFER)
+ return false;
+
+ if (!util_blitter_is_copy_supported(blitter->pipe_blitter, dst, src, mask))
+ return false;
+
+ ilo_blitter_pipe_begin(blitter, ILO_BLITTER_PIPE_COPY);
+
+ util_blitter_copy_texture(blitter->pipe_blitter,
+ dst, dst_level, dst_x, dst_y, dst_z,
+ src, src_level, src_box,
+ mask, copy_all_samples);
+
+ ilo_blitter_pipe_end(blitter);
+
+ return true;
}
bool