freedreno: stop frob'ing pipe_resource::nr_samples
authorRob Clark <robdclark@gmail.com>
Tue, 29 Jan 2019 17:23:28 +0000 (12:23 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 29 Jan 2019 17:30:50 +0000 (12:30 -0500)
commitc3baa077bf6db9f9d46be62ed7cbbc3167e68c8f
tree46574f846c6339b611b6eda72c12757e61170423
parent1a6ddfe5ee1fc4b850f82f9cc3b0248101cae55a
freedreno: stop frob'ing pipe_resource::nr_samples

Previously we tried to normalize nr_samples to MAX2(1, nr_samples) to
avoid having to deal with 0 vs 1 everywhere.  But this causes problems
in mesa/st, for example st_finalize_texture() will think there is a
nr_samples mismatch and recreate the texture.  Somehow this manifests
as corrupt x11 font rendering on generations that do not support MSAA
(but apparently works fine on a5xx and a6xx which do support MSAA.)

Fixes: cf0c7258ee0 freedreno/a5xx: MSAA
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch_cache.c
src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/freedreno/freedreno_resource.h
src/gallium/drivers/freedreno/freedreno_texture.c