[Mesa-dev] [PATCH 0/9] Etnaviv direct YUV support

Lucas Stach l.stach at pengutronix.de
Mon Jul 9 16:02:31 UTC 2018


Driver support for YUV textures is mostly limited to OES_external, which
is suboptimal for etnaviv, as this incurs an additional copy blit on each
texture bind, due to the way the OES_external extension is defined and
the Vivante GPUs inability to sample from linear resources. Also emulating
planar YUV formats with R8 samplers isn't a good option on etnaviv, as the
most common GPUs are not able to tile 8bit formats in hardware and thus
would need a CPU fallback for this case.

There is a better option available, though: the Vivante 2D GPUs can blit
from interleaved or planar YUV buffers to a RGB buffer. New versions of
the 2D core can even do the required texture tiling at the same time. This
series implements the driver support for using the 2D GPU to do the texture
import. This allows us to generate regular GL_TEXTUREs from a set of YUV
dma-bufs by blitting into a internal RGBx buffer.

This series is on top of my st/dri changes, reworking the format
handling [1].

GStreamer glupload support has been developed based on this driver support
and is currently under review [2]. Kodi also seems happy about NV12 support
and I think there was some prototype code, based on a pre-release of this
series, which only worked on the i.MX6QP. With this series NV12 should work
on all supported Vivante GPUs.

Regards,
Lucas

[1] https://marc.info/?l=mesa3d-dev&m=152655423402505&w=2
[2] https://bugzilla.gnome.org/show_bug.cgi?id=783521

Lucas Stach (9):
  etnaviv: improve PIPE_BIND_LINEAR handling
  etnaviv: reject imports of tiler incompatible linear buffers
  etnaviv: clear out next pointer when allocating resource
  etnaviv: remember data offset into BO
  etnaviv: create optional 2d pipe in screen
  etnaviv: add 2D GPU YUV->RGB blitter
  etnaviv: export etna_submit_rs_state
  etnaviv: use filter blit for 2D YUV import on old GC320
  etnaviv: handle YUV textures with the 2D GPU

 src/gallium/drivers/etnaviv/Makefile.sources  |    2 +
 src/gallium/drivers/etnaviv/etnaviv_2d.c      |  326 ++++
 src/gallium/drivers/etnaviv/etnaviv_2d.h      |   37 +
 .../drivers/etnaviv/etnaviv_clear_blit.c      |    2 +-
 src/gallium/drivers/etnaviv/etnaviv_context.c |    6 +
 src/gallium/drivers/etnaviv/etnaviv_context.h |    1 +
 src/gallium/drivers/etnaviv/etnaviv_format.c  |    5 +-
 .../drivers/etnaviv/etnaviv_resource.c        |   25 +-
 .../drivers/etnaviv/etnaviv_resource.h        |    1 +
 src/gallium/drivers/etnaviv/etnaviv_rs.c      |    7 +-
 src/gallium/drivers/etnaviv/etnaviv_rs.h      |    4 +
 src/gallium/drivers/etnaviv/etnaviv_screen.c  |   73 +-
 src/gallium/drivers/etnaviv/etnaviv_screen.h  |    6 +
 src/gallium/drivers/etnaviv/etnaviv_texture.c |    7 +
 src/gallium/drivers/etnaviv/hw/state_2d.xml.h | 1499 +++++++++++++++++
 15 files changed, 1996 insertions(+), 5 deletions(-)
 create mode 100644 src/gallium/drivers/etnaviv/etnaviv_2d.c
 create mode 100644 src/gallium/drivers/etnaviv/etnaviv_2d.h
 create mode 100644 src/gallium/drivers/etnaviv/hw/state_2d.xml.h

-- 
2.18.0



More information about the mesa-dev mailing list