[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a753688e-8ab2-4db6-8462-11b52a642081@arm.com>
Date: Mon, 20 Oct 2025 10:06:43 +0100
From: Steven Price <steven.price@....com>
To: Karunika Choo <karunika.choo@....com>, dri-devel@...ts.freedesktop.org
Cc: nd@....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>, Simona Vetter <simona@...ll.ch>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 03/10] drm/panthor: Introduce framework for
architecture-specific features
On 14/10/2025 10:43, Karunika Choo wrote:
> Add a framework to support architecture-specific features. This allows
> other parts of the driver to adjust their behaviour based on the feature
> bits enabled for a given architecture.
>
> Signed-off-by: Karunika Choo <karunika.choo@....com>
Reviewed-by: Steven Price <steven.price@....com>
> ---
> drivers/gpu/drm/panthor/panthor_hw.c | 5 +++++
> drivers/gpu/drm/panthor/panthor_hw.h | 18 ++++++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
> index b6e7401327c3..34536526384d 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.c
> +++ b/drivers/gpu/drm/panthor/panthor_hw.c
> @@ -186,3 +186,8 @@ int panthor_hw_init(struct panthor_device *ptdev)
>
> return 0;
> }
> +
> +bool panthor_hw_has_feature(struct panthor_device *ptdev, enum panthor_hw_feature feature)
> +{
> + return test_bit(feature, ptdev->hw->features);
> +}
> diff --git a/drivers/gpu/drm/panthor/panthor_hw.h b/drivers/gpu/drm/panthor/panthor_hw.h
> index 39752de3e7ad..7a191e76aeec 100644
> --- a/drivers/gpu/drm/panthor/panthor_hw.h
> +++ b/drivers/gpu/drm/panthor/panthor_hw.h
> @@ -4,14 +4,32 @@
> #ifndef __PANTHOR_HW_H__
> #define __PANTHOR_HW_H__
>
> +#include <linux/types.h>
> +
> struct panthor_device;
>
> +/**
> + * enum panthor_hw_feature - Bit position of each HW feature
> + *
> + * Used to define GPU specific features based on the GPU architecture ID.
> + * New feature flags will be added with support for newer GPU architectures.
> + */
> +enum panthor_hw_feature {
> + /** @PANTHOR_HW_FEATURES_END: Must be last. */
> + PANTHOR_HW_FEATURES_END
> +};
> +
> +
> /**
> * struct panthor_hw - GPU specific register mapping and functions
> */
> struct panthor_hw {
> + /** @features: Bitmap containing panthor_hw_feature */
> + DECLARE_BITMAP(features, PANTHOR_HW_FEATURES_END);
> };
>
> int panthor_hw_init(struct panthor_device *ptdev);
>
> +bool panthor_hw_has_feature(struct panthor_device *ptdev, enum panthor_hw_feature feature);
> +
> #endif /* __PANTHOR_HW_H__ */
Powered by blists - more mailing lists