[Mesa-dev] [PATCH v3 00/10] i965: Use the render pipeline for PBO uploads and

Jason Ekstrand jason at jlekstrand.net
Tue Jan 13 10:28:15 PST 2015

This series adds support for doing texture up/downloads using the render
pipeline instead of the blitter.  There are a number of good reasons for
doing so.

 1) The blitter is commonly thought to be slower than the render pipeline
    in terms of its access to memory.

 2) The blitter is on a different ringbuffer so using it incurs incurs a
    ring-switching penalty.

 3) The blitter is incapable of doing format conversion while we get it
    almost for free with the render pipeline.

This last point is probably the most important one.  In some
micro-benchmarks I did, the render pipeline is somewhere between 5 and 40x
as fast as the CPU for doing format conversion operations.  It's even
faster than CPU-tiling memcpy path when the texture is reasonably large
(1024 square is big enough) and already in a PBO.  Since the meta paths are
strictly better than the blitter paths, the old blitter paths are removed.

As a side-effect of these patches, the meta PBO path is tried before the
tiled_memcpy path when the source is already a PBO.  Previously, we weren't
doing this and anything that hit the tiled_memcpy path on an in-use texture
would cause a pipeline stall.

Jason Ekstrand (10):
  mesa/dd: Add a function for creating a texture from a buffer object
  i965/mipmap_tree: Add a depth parameter to create_for_bo
  i965: Apply the miptree offset to surface state for renderbuffers
  i965: Implement SetTextureStorageForBufferObject
  formats: Use a hash table for _mesa_format_from_array_format
  meta: Add a BlitFramebuffers-based implementation of TexSubImage
  meta: Add an implementation of GetTexSubImage for PBOs
  i965/pixel_read: Use meta_pbo_GetTexSubImage for PBO ReadPixels
  i965/tex_image: Use meta for instead of the blitter PBO TexImage and
  i965/tex_subimage: use meta instead of the blitter for PBO TexSubImage

 src/mesa/Makefile.sources                         |   1 +
 src/mesa/drivers/common/meta.h                    |  17 ++
 src/mesa/drivers/common/meta_tex_subimage.c       | 355 ++++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |   3 +-
 src/mesa/drivers/dri/i965/gen6_surface_state.c    |   3 +-
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c |   3 +-
 src/mesa/drivers/dri/i965/gen8_surface_state.c    |   3 +-
 src/mesa/drivers/dri/i965/intel_fbo.c             |   1 +
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c     |   9 +-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h     |   1 +
 src/mesa/drivers/dri/i965/intel_pixel_draw.c      |   2 +-
 src/mesa/drivers/dri/i965/intel_pixel_read.c      | 130 +-------
 src/mesa/drivers/dri/i965/intel_tex.c             |  57 ++++
 src/mesa/drivers/dri/i965/intel_tex_image.c       | 205 ++-----------
 src/mesa/drivers/dri/i965/intel_tex_subimage.c    | 115 +------
 src/mesa/main/dd.h                                |  15 +
 src/mesa/main/formats.c                           |  67 +++-
 17 files changed, 561 insertions(+), 426 deletions(-)
 create mode 100644 src/mesa/drivers/common/meta_tex_subimage.c


More information about the mesa-dev mailing list