gallium: Add format modifier plane count query
authorJames Jones <jajones@nvidia.com>
Mon, 3 Feb 2020 21:17:01 +0000 (13:17 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Nov 2020 10:51:37 +0000 (10:51 +0000)
commit68d70fb96996c41a71ed81b7f6ccbec0fb95145b
tree11f2bfb9cc484096540faade831d5acdb5d9e0bf
parent6ee10ab3de8664011a6c75e2357faba1ec95c094
gallium: Add format modifier plane count query

Rather than hard-code a list of all the format
modifiers supported by any gallium driver and the
number of aux planes they require in the dri state
tracker, add a screen proc that queries the number
of planes required for a given modifier+format
pair.

Since the only format modifiers that require
auxiliary planes currently are the iris driver's
I915_FORMAT_MOD_Y_TILED_CCS,
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS, and
I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS, the absence
of the screen proc implies zero aux planes for all
of the screen's supported modifiers.  Hence, when
a driver does not expose the proc, derive the
number of planes directly from the format.

Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>
docs/gallium/screen.rst
src/gallium/auxiliary/driver_rbug/rbug_screen.c
src/gallium/drivers/iris/iris_resource.c
src/gallium/drivers/tegra/tegra_screen.c
src/gallium/frontends/dri/dri2.c
src/gallium/include/pipe/p_screen.h