pan/kmod: fix priority query logic
The PANFROST_JM_CTX_PRIORITY values aren't bitmasks, but enum values.
But the kernel interface uses the BIT()-macro on them, so we need to do
the same. We don't have the macro, but it's trivial to do this with a
bitshift instead.
Fixes: f04dbf0bc0 ("pan/kmod: query and cache available context priorities from KMD")
CID: 1666511
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37903>
This commit is contained in:
committed by
Marge Bot
parent
55ef52d009
commit
37a7a157e8
@@ -215,14 +215,14 @@ panfrost_dev_query_props(const struct pan_kmod_dev *dev,
|
||||
* priority as medium if the param doesn't exist. */
|
||||
uint64_t prios =
|
||||
panfrost_query_raw(fd, DRM_PANFROST_PARAM_ALLOWED_JM_CTX_PRIORITIES,
|
||||
false, PANFROST_JM_CTX_PRIORITY_MEDIUM);
|
||||
false, BITFIELD_BIT(PANFROST_JM_CTX_PRIORITY_MEDIUM));
|
||||
|
||||
if (prios & PANFROST_JM_CTX_PRIORITY_LOW)
|
||||
if (prios & BITFIELD_BIT(PANFROST_JM_CTX_PRIORITY_LOW))
|
||||
props->allowed_group_priorities_mask |= PAN_KMOD_GROUP_ALLOW_PRIORITY_LOW;
|
||||
if (prios & PANFROST_JM_CTX_PRIORITY_MEDIUM)
|
||||
if (prios & BITFIELD_BIT(PANFROST_JM_CTX_PRIORITY_MEDIUM))
|
||||
props->allowed_group_priorities_mask |=
|
||||
PAN_KMOD_GROUP_ALLOW_PRIORITY_MEDIUM;
|
||||
if (prios & PANFROST_JM_CTX_PRIORITY_HIGH)
|
||||
if (prios & BITFIELD_BIT(PANFROST_JM_CTX_PRIORITY_HIGH))
|
||||
props->allowed_group_priorities_mask |=
|
||||
PAN_KMOD_GROUP_ALLOW_PRIORITY_HIGH;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user