nouveau/mme: Fix is_int18 for negative numbers

util_mask_sign_extend returns a uint64_t which we need to cast to
uint32_t in order to get the right comparison.  Otherwise, we risk
having ~0 in the top 32 bits and the comparison failing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:06 -06:00 committed by Marge Bot
parent 67008dfe78
commit 75deae5988

View file

@ -200,7 +200,7 @@ mme_fermi_reg(uint32_t reg)
static bool
is_int18(uint32_t i)
{
return i == util_mask_sign_extend(i, 18);
return i == (uint32_t)util_mask_sign_extend(i, 18);
}
static inline void