etnaviv/nn: Keep track of the sign bit when decrementing to zero

To avoid underflow.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28879>
This commit is contained in:
Tomeu Vizoso 2024-04-23 17:09:39 +02:00 committed by Marge Bot
parent 9bac40b796
commit a78e98f18e

View file

@ -1265,7 +1265,7 @@ calculate_zrl_bits(struct etna_ml_subgraph *subgraph, const struct etna_operatio
*/
best_compressed_size = UINT_MAX;
best_zrl_bits = 0;
for (unsigned zrl_bits = max_zrl_bits; zrl_bits >= 0; zrl_bits--) {
for (int zrl_bits = max_zrl_bits; zrl_bits >= 0; zrl_bits--) {
unsigned compressed_size = header_size;
for (unsigned core = 0; core < cores_used; core++) {