i915g: Check for the scanout-layout conditions before setting level info.
authorEmma Anholt <emma@anholt.net>
Tue, 5 Oct 2021 19:33:15 +0000 (12:33 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 Oct 2021 22:36:36 +0000 (22:36 +0000)
commit60f464bbce963704290a793c2b9637f7ed3aded3
tree8764800bdaf42b09020954a3217c8ce32606cb09
parentf0325ca3da7217064a50d297bd362dcee832e904
i915g: Check for the scanout-layout conditions before setting level info.

Fixes leaks (release) or assertion failures (debug) on allocating small
scanout resources, when falling through to the non-scanout-specific layout
code, which became more common as of ad50b47a14e9 ("gbm: assume
USE_SCANOUT in create_with_modifiers").

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13202>
src/gallium/drivers/i915/i915_resource_texture.c