[Mesa-dev] [PATCH 01/10] i965: Use meta for pixel ops on gen6+

Pohjolainen, Topi topi.pohjolainen at gmail.com
Mon May 14 17:47:48 UTC 2018


On Fri, May 11, 2018 at 04:48:17PM -0700, Jason Ekstrand wrote:
> Using meta for anything is fairly aweful and definitely has more CPU
> overhead.  However, it also uses the 3D pipe and is therefore likely
> faster in terms of GPU time than the blitter.  Also, the blitter code
> has so many early returns that it's probably not buying us that much.
> We may as well just use meta all the time instead of working over-time
> to find the tiny case where we can use the blitter.  We keep gen4-5
> using the old blit paths to avoid perturbing old hardware too much.

After the rest of your series, using blitter for the few isolated cases
would be the only thing preventing us from removing BLT ring support
altogether. So I think moving over to meta is well justified - it
doesn't sound smart to maintain blitter support just for optimizing
(unknown?) corner cases. And if significant enough case happens to
emerge, we most likely can implement that using blorp.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> ---
>  src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 6 ++++--
>  src/mesa/drivers/dri/i965/intel_pixel_copy.c   | 5 ++++-
>  src/mesa/drivers/dri/i965/intel_pixel_draw.c   | 3 ++-
>  3 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> index 5bc341b..f9d4829 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
> @@ -348,11 +348,13 @@ intelBitmap(struct gl_context * ctx,
>  	    const struct gl_pixelstore_attrib *unpack,
>  	    const GLubyte * pixels)
>  {
> +   struct brw_context *brw = brw_context(ctx);
> +
>     if (!_mesa_check_conditional_render(ctx))
>        return;
>  
> -   if (do_blit_bitmap(ctx, x, y, width, height,
> -                          unpack, pixels))
> +   if (brw->screen->devinfo.gen < 6 &&
> +       do_blit_bitmap(ctx, x, y, width, height, unpack, pixels))
>        return;
>  
>     _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
> index 8029ffb..31838cc 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
> @@ -196,12 +196,15 @@ intelCopyPixels(struct gl_context * ctx,
>                  GLsizei width, GLsizei height,
>                  GLint destx, GLint desty, GLenum type)
>  {
> +   struct brw_context *brw = brw_context(ctx);
> +
>     DBG("%s\n", __func__);
>  
>     if (!_mesa_check_conditional_render(ctx))
>        return;
>  
> -   if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
> +   if (brw->screen->devinfo.gen < 6 &&
> +       do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
>        return;
>  
>     /* this will use swrast if needed */
> diff --git a/src/mesa/drivers/dri/i965/intel_pixel_draw.c b/src/mesa/drivers/dri/i965/intel_pixel_draw.c
> index 82dca4a..d5d1b99e69 100644
> --- a/src/mesa/drivers/dri/i965/intel_pixel_draw.c
> +++ b/src/mesa/drivers/dri/i965/intel_pixel_draw.c
> @@ -163,7 +163,8 @@ intelDrawPixels(struct gl_context * ctx,
>        return;
>     }
>  
> -   if (_mesa_is_bufferobj(unpack->BufferObj)) {
> +   if (brw->screen->devinfo.gen < 6 &&
> +       _mesa_is_bufferobj(unpack->BufferObj)) {
>        if (do_blit_drawpixels(ctx, x, y, width, height, format, type, unpack,
>  			     pixels)) {
>  	 return;
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list