From 8404366d2f8efdf422ee835d322ffc741f357961 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 15 Oct 2025 10:26:52 +0200 Subject: [PATCH] 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: f04dbf0bc0b ("pan/kmod: query and cache available context priorities from KMD") CID: 1666511 Reviewed-by: Boris Brezillon Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: (cherry picked from commit 37a7a157e8b8aed9631a0687d7018641b0255db0) --- .pick_status.json | 2 +- src/panfrost/lib/kmod/panfrost_kmod.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ae072662d65..5ed4d468d60 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -164,7 +164,7 @@ "description": "pan/kmod: fix priority query logic", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f04dbf0bc0bf34818c7cdb1852154b396c81de99", "notes": null diff --git a/src/panfrost/lib/kmod/panfrost_kmod.c b/src/panfrost/lib/kmod/panfrost_kmod.c index 82587c90ca4..df69090f319 100644 --- a/src/panfrost/lib/kmod/panfrost_kmod.c +++ b/src/panfrost/lib/kmod/panfrost_kmod.c @@ -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; }