[PATCH 0/6] Add support for NV12

Lucas Stach l.stach at pengutronix.de
Fri Apr 26 08:02:20 UTC 2019


Am Freitag, den 26.04.2019, 09:41 +0200 schrieb Christian Gmeiner:
> Hi Lucas
> 
> > 
> > Am Mittwoch, den 24.04.2019, 08:36 +0200 schrieb Christian Gmeiner:
> > > This patch series goes a complete different route then the one from
> > > Lucas Stach. I am using the integrated YUV tiler instead of using
> > > the 2D core for format conversion. I am reusing some patches from
> > > Lucas and this series sits on-top of Lucas "st/dri: YUV" patches.
> > 
> > We specifically opted to use the 2D GPU to do a format conversion, as
> > this yields a RGB internal representation, which means the texture has
> > the same properties as a normal GL texture (e.g. glReadPixels works).
> > This way we can expose YUV format imports as non-external textures.
> > 
> 
> Do you know out of head if rs can handle yuv? If that would be the case
> the conversion from yuv -> rgb could also be done this way and you have
> the same interal RGB representation. But I have the feeling
> YUY2_RENDER_TARGET (aka. RS_FORMAT_YUY2) needs to be supported.

I think the RS can do some of the YUY2 conversions, but it certainly
can not do any of the planar formats.

> Is glReadPixels(..) and friends really an use-case for YUV textures? To be
> honest I am not that deep in that topic.

The point isn't that we need glReadPixels for anything, but that the
fact that it works properly allows us to expose the the import as a
regular non-external glTexture without having to lie or cheat. Non-
external textures have some benefits in the lifetime handling that make
the upper parts of the stack more performant.

> Maybe you can 1-2 sentences about the reasoning for using the 2D core
> somewhere in an commit message?
> 
> > This provides a number of benefits in texture lifetime handling in the
> > upper layers of the stack, which are used to drive those video use-
> > cases, like GStreamer. I don't really care what the blob does, but I do
> > care about having the highest performing solution, which is to have the
> > 2D GPU work in parallel with the 3D GPU and allow efficient texture
> > imports with GStreamer.
> > 
> 
> As the branch point is coming I am okay with this. But I have the feeling
> that we need to touch this area in near future for our lovely imx8 based gpus.

My guess is that the BLT engine can actually do a similar CSC like we
do on the 2D now. As the BLT engine can be driven asynchronously, we
should have almost the same behavior as with the 2D GPU based solution.

> Btw. do you have some numbers regarding the speed-up you get by using the
> 2D core in parallel?

I don't have any numbers for the speedup, but we have some use-cases
where even the fast-path on the new GC320 on i.MX6QP, which can use a
regular bitblit that does 2 pixels/clock and has a relatively high
clock frequency, we reach a GPU load of 25% for the texture import.
Moving this load away from the 3D GPU seems worthwhile.

Regards,
Lucas

> > I would really appreciate a review of my patch series.
> > 
> > Regards,
> > Lucas
> > 
> > > Christian Gmeiner (3):
> > >   etnaviv: direct YUYV/UYVY support
> > >   etnaviv: update headers from rnndb
> > >   etnaviv: add multi-planar YUV support
> > > 
> > > Lucas Stach (3):
> > >   etnaviv: clear out next pointer when allocating resource
> > >   etnaviv: remember data offset into BO
> > >   etnaviv: improve PIPE_BIND_LINEAR handling
> > > 
> > >  .../drivers/etnaviv/etnaviv_clear_blit.c      |   2 +-
> > >  src/gallium/drivers/etnaviv/etnaviv_format.c  |   5 +-
> > >  .../drivers/etnaviv/etnaviv_resource.c        |  24 +++-
> > >  src/gallium/drivers/etnaviv/etnaviv_rs.c      |   5 +
> > >  src/gallium/drivers/etnaviv/etnaviv_screen.c  |   4 +
> > >  src/gallium/drivers/etnaviv/etnaviv_texture.c |   8 ++
> > >  src/gallium/drivers/etnaviv/etnaviv_yuv.c     | 123
> > > ++++++++++++++++++
> > >  src/gallium/drivers/etnaviv/etnaviv_yuv.h     |  44 +++++++
> > >  src/gallium/drivers/etnaviv/hw/common.xml.h   |   2 +-
> > >  .../drivers/etnaviv/hw/common_3d.xml.h        |   2 +-
> > >  src/gallium/drivers/etnaviv/hw/state.xml.h    |   4 +-
> > >  src/gallium/drivers/etnaviv/hw/state_3d.xml.h |  35 +++--
> > >  .../drivers/etnaviv/hw/state_blt.xml.h        |   4 +-
> > >  .../drivers/etnaviv/hw/texdesc_3d.xml.h       |   2 +-
> > >  src/gallium/drivers/etnaviv/meson.build       |   2 +
> > >  15 files changed, 240 insertions(+), 26 deletions(-)
> > >  create mode 100644 src/gallium/drivers/etnaviv/etnaviv_yuv.c
> > >  create mode 100644 src/gallium/drivers/etnaviv/etnaviv_yuv.h
> > > 
> 
> 
> 


More information about the etnaviv mailing list