[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <228161f4-6f97-43ac-a09a-79edeeebea7b@arm.com>
Date: Fri, 19 Jul 2024 15:15:04 +0100
From: Steven Price <steven.price@....com>
To: Adrián Larumbe <adrian.larumbe@...labora.com>,
Boris Brezillon <boris.brezillon@...labora.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>, Daniel Vetter <daniel@...ll.ch>
Cc: kernel@...labora.com, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/4] drm/panthor: add sysfs knob for enabling job
profiling
On 16/07/2024 21:11, Adrián Larumbe wrote:
> This commit introduces a DRM device sysfs attribute that lets UM control
> the job accounting status in the device. The knob variable had been brought
> in as part of a previous commit, but now we're able to fix it manually.
>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@...labora.com>
Reviewed-by: Steven Price <steven.price@....com>
Although we should probably copy/paste
Documentation/ABI/testing/sysfs-driver-panfrost-profiling - or at least
mention somewhere that the same knob is available for panthor.
Steve
> ---
> drivers/gpu/drm/panthor/panthor_drv.c | 36 +++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index 6a0c1a06a709..a2876310856f 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -1448,6 +1448,41 @@ static void panthor_remove(struct platform_device *pdev)
> panthor_device_unplug(ptdev);
> }
>
> +static ssize_t profiling_show(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct panthor_device *ptdev = dev_get_drvdata(dev);
> +
> + return sysfs_emit(buf, "%d\n", ptdev->profile_mode);
> +}
> +
> +static ssize_t profiling_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t len)
> +{
> + struct panthor_device *ptdev = dev_get_drvdata(dev);
> + bool value;
> + int err;
> +
> + err = kstrtobool(buf, &value);
> + if (err)
> + return err;
> +
> + ptdev->profile_mode = value;
> +
> + return len;
> +}
> +
> +static DEVICE_ATTR_RW(profiling);
> +
> +static struct attribute *panthor_attrs[] = {
> + &dev_attr_profiling.attr,
> + NULL,
> +};
> +
> +ATTRIBUTE_GROUPS(panthor);
> +
> static const struct of_device_id dt_match[] = {
> { .compatible = "rockchip,rk3588-mali" },
> { .compatible = "arm,mali-valhall-csf" },
> @@ -1467,6 +1502,7 @@ static struct platform_driver panthor_driver = {
> .name = "panthor",
> .pm = pm_ptr(&panthor_pm_ops),
> .of_match_table = dt_match,
> + .dev_groups = panthor_groups,
> },
> };
>
Powered by blists - more mailing lists