kmsro: assert that scanout refcount is larger than 0
authorMichael Tretter <m.tretter@pengutronix.de>
Tue, 20 Jun 2023 13:14:52 +0000 (15:14 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Jul 2023 12:10:18 +0000 (12:10 +0000)
commitee62f4629a4da6a4e0e1ea011941d7cccb7b41a9
tree3d80ef75ef73f9f6088f960234790b907dc147d4
parent279d08a18a3ad52c0636674ba0aed65368cfe01d
kmsro: assert that scanout refcount is larger than 0

The dumb buffer backing the renderonly_scanout is only destroyed if the
refcount reaches zero. If a driver does not correctly initialize the
refcount, the refcount may be negative and the buffer will never be
freed.

Add an assert to ensure that drivers correctly initialize the refcount.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23743>
src/gallium/auxiliary/renderonly/renderonly.c