[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251026092717.3aae3679@fedora>
Date: Sun, 26 Oct 2025 09:27:17 +0100
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Karunika Choo <karunika.choo@....com>
Cc: dri-devel@...ts.freedesktop.org, nd@....com, Steven Price
<steven.price@....com>, Liviu Dudau <liviu.dudau@....com>, Maarten
Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/8] drm/panthor: Support GLB_REQ.STATE field for
Mali-G1 GPUs
On Fri, 24 Oct 2025 21:21:15 +0100
Karunika Choo <karunika.choo@....com> wrote:
> +static bool panthor_fw_has_glb_state(struct panthor_device *ptdev)
> +{
> + struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
> +
> + return glb_iface->control->version >= CSF_IFACE_VERSION(4, 1, 0);
> +}
It's okay for now, but if we start having more of these, we probably
want to automate the generation of those has_<featurex>() helpers with
something like:
#define FW_FEATURE(feat_name, major, minor) \
static bool panthor_fw_has_ ## feat_name(struct panthor_device *ptdev) \
{ \
struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev); \
\
return glb_iface->control->version >= CSF_IFACE_VERSION(major, minor, 0); \
}
Same goes for the HW features BTW.
> +
> /**
> * panthor_fw_conv_timeout() - Convert a timeout into a cycle-count
> * @ptdev: Device.
> @@ -995,6 +1003,9 @@ static void panthor_fw_init_global_iface(struct panthor_device *ptdev)
> GLB_IDLE_EN |
> GLB_IDLE;
>
> + if (glb_iface->control->version >= CSF_IFACE_VERSION(4, 1, 0))
if (panthor_fw_has_glb_state(ptdev))
> + glb_iface->input->ack_irq_mask |= GLB_STATE_MASK;
> +
> panthor_fw_update_reqs(glb_iface, req, GLB_IDLE_EN, GLB_IDLE_EN);
> panthor_fw_toggle_reqs(glb_iface, req, ack,
> GLB_CFG_ALLOC_EN |
> @@ -1068,6 +1079,54 @@ static void panthor_fw_stop(struct panthor_device *ptdev)
> drm_err(&ptdev->base, "Failed to stop MCU");
> }
Powered by blists - more mailing lists