[Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.
This improves GLX DRI3 Gpu offloading significantly on cpu bound benchmarks particularly. No performance impact for DRI2 Gpu offloading. Signed-off-by: Axel Davy --- src/gallium/drivers/radeonsi/si_blit.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 6bc89ab..0e327b5 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -712,6 +712,21 @@ static void si_blit(struct pipe_context *ctx, return; } + if (info->src.box.width == info->dst.box.width && + info->src.format == info->dst.format && + info->src.box.width >=0 && + info->src.resource->nr_samples == 0 && + info->dst.resource->nr_samples == 0 && + info->src.box.depth == 1 && + info->dst.box.depth == 1 && + info->mask == PIPE_MASK_RGBA) { + sctx->b.dma_copy(ctx, info->dst.resource, info->dst.level, +info->dst.box.x, info->dst.box.y, +info->dst.box.z, info->src.resource, +info->src.level, &(info->src.box)); + return; + } + assert(util_blitter_is_blit_supported(sctx->blitter, info)); /* The driver doesn't decompress resources automatically while -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.
On 28.05.2014 09:55, Axel Davy wrote: > This improves GLX DRI3 Gpu offloading significantly on cpu > bound benchmarks particularly. > No performance impact for DRI2 Gpu offloading. > > Signed-off-by: Axel Davy > --- > src/gallium/drivers/radeonsi/si_blit.c | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/src/gallium/drivers/radeonsi/si_blit.c > b/src/gallium/drivers/radeonsi/si_blit.c > index 6bc89ab..0e327b5 100644 > --- a/src/gallium/drivers/radeonsi/si_blit.c > +++ b/src/gallium/drivers/radeonsi/si_blit.c > @@ -712,6 +712,21 @@ static void si_blit(struct pipe_context *ctx, > return; > } > > + if (info->src.box.width == info->dst.box.width && You need to check info->src.box.height == info->dst.box.height as well. > + info->src.format == info->dst.format && > + info->src.box.width >=0 && Missing space between operator and operand. > + info->src.resource->nr_samples == 0 && > + info->dst.resource->nr_samples == 0 && > + info->src.box.depth == 1 && > + info->dst.box.depth == 1 && > + info->mask == PIPE_MASK_RGBA) { > + sctx->b.dma_copy(ctx, info->dst.resource, info->dst.level, > + info->dst.box.x, info->dst.box.y, > + info->dst.box.z, info->src.resource, > + info->src.level, &(info->src.box)); > + return; > + } Even with that fixed, this change breaks a number of scissor related piglit tests because it ignores info->scissor{_enable,}. You need to either fall back or factor in info->scissor if info->scissor_enable is on. Might be safer to fall back for info->render_condition_enable as well. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.
On 28/05/2014 04:40, Michel Dänzer wrote : On 28.05.2014 09:55, Axel Davy wrote: This improves GLX DRI3 Gpu offloading significantly on cpu bound benchmarks particularly. No performance impact for DRI2 Gpu offloading. Signed-off-by: Axel Davy --- src/gallium/drivers/radeonsi/si_blit.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 6bc89ab..0e327b5 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -712,6 +712,21 @@ static void si_blit(struct pipe_context *ctx, return; } + if (info->src.box.width == info->dst.box.width && You need to check info->src.box.height == info->dst.box.height as well. Oh I missed that. Thanks for pointing out + info->src.format == info->dst.format && + info->src.box.width >=0 && Missing space between operator and operand. + info->src.resource->nr_samples == 0 && + info->dst.resource->nr_samples == 0 && + info->src.box.depth == 1 && + info->dst.box.depth == 1 && + info->mask == PIPE_MASK_RGBA) { + sctx->b.dma_copy(ctx, info->dst.resource, info->dst.level, +info->dst.box.x, info->dst.box.y, +info->dst.box.z, info->src.resource, +info->src.level, &(info->src.box)); + return; + } Even with that fixed, this change breaks a number of scissor related piglit tests because it ignores info->scissor{_enable,}. You need to either fall back or factor in info->scissor if info->scissor_enable is on. Might be safer to fall back for info->render_condition_enable as well. Thanks, I'll take a look at it. Axel Davy ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.
On 28/05/2014 04:40, Michel Dänzer wrote : Might be safer to fall back for info->render_condition_enable as well. Do you know exactly what are the implications of this flag ? The commit message adding it and the comment near its definition don't help me to understand it. This flag is always set for glBlitFrameBuffer. Thanks, Axel Davy ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 11/11] Radeonsi: Use dma_copy when possible for si_blit.
On 29.05.2014 10:49, Axel Davy wrote: > On 28/05/2014 04:40, Michel Dänzer wrote : >> Might be safer to fall back for info->render_condition_enable as well. > Do you know exactly what are the implications of this flag ? > > The commit message adding it and the comment near its definition don't help > me to understand it. > This flag is always set for glBlitFrameBuffer. It's related to conditional rendering, enabled via r600_render_condition() => r600_emit_query_predication(). I think you need to check for (!info->render_condition_enable || !sctx->b.current_render_cond) for using the DMA engine. -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev