[Mesa-dev] [PATCH 0/5] gbm: Add a modifier_plane_count query

Jason Ekstrand jason at jlekstrand.net
Wed Aug 16 19:30:54 UTC 2017


We ran into a little problem with trying to use modifiers with X11.
Specifically, if you do front-buffer rendering with CCS and have any
tearing, then the end results are not at all what you want.  Instead of the
race between render and scanout resulting in a nice clean horizontal or
vertical line like you would get with X or Y-tiling, you get a wide bar of
garbage.  The theory is that his is because the scanout may read old main
surface and new CCS contents or vice versa.  There may also be some issues
with how CCS data gets flushed out of the render cache.

After some discussion on IRC, the solution was proposed by Daniel Vetter of
just not doing front-buffer rendering to multi-planar images.  The chances
of getting anything close to nice results when racing scanout on a multi-
planar image are slim anyway and this nicely rules out the CCS case.  In
order to do this, however, the X server needs to know how many planes a
given modifier will consume.  It could just have a retry loop and keep
deleting modifiers from the list until it GBM creates a single-plane
surface.  This little series adds a GBM query to ask how many planes are in
a given format+modifier combination.

This has been compile-tested only.  I'm hoping Daniel will rework his X11
patches and test it out for me.

Cc: Daniel Stone <daniels at collabora.com>

Jason Ekstrand (5):
  dri/image: Add a format modifier attributes query
  gbm: Add a gbm_device_get_format_modifier_plane_count function
  i965/screen: Make a parameter const
  intel/screen: Report the correct number of image planes
  i965/screen: Implement queryDmaBufFormatModifierAttirbs

 include/GL/internal/dri_interface.h      | 27 +++++++++++++++++++++++++-
 src/gbm/backends/dri/gbm_dri.c           | 26 +++++++++++++++++++++++++
 src/gbm/main/gbm.c                       | 14 ++++++++++++++
 src/gbm/main/gbm.h                       |  5 +++++
 src/gbm/main/gbmint.h                    |  3 +++
 src/mesa/drivers/dri/i965/intel_screen.c | 33 +++++++++++++++++++++++++++++---
 6 files changed, 104 insertions(+), 4 deletions(-)

-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list