summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panfrost/panfrost_device.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2019-06-18 10:16:47 +0200
committerRob Herring <robh@kernel.org>2019-06-18 09:23:36 -0600
commit1e51348013a255a12048b3e12c660f4352f49f1c (patch)
treee141ce87382971188c9bbf359c2801d6feec5403 /drivers/gpu/drm/panfrost/panfrost_device.h
parent92f0ad0b1dc63cc27362cd8e466976a7ccde2da3 (diff)
drm/panfrost: Add an helper to check the GPU generation
All models with an ID >= 0x1000 are Bifrost GPUs for now (might change with new gens). Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190618081648.17297-4-boris.brezillon@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost/panfrost_device.h')
-rw-r--r--drivers/gpu/drm/panfrost/panfrost_device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h
index 031168f83bd2..e86581c4af7b 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.h
+++ b/drivers/gpu/drm/panfrost/panfrost_device.h
@@ -110,6 +110,11 @@ static inline int panfrost_model_cmp(struct panfrost_device *pfdev, s32 id)
return match_id - id;
}
+static inline bool panfrost_model_is_bifrost(struct panfrost_device *pfdev)
+{
+ return panfrost_model_cmp(pfdev, 0x1000) >= 0;
+}
+
static inline bool panfrost_model_eq(struct panfrost_device *pfdev, s32 id)
{
return !panfrost_model_cmp(pfdev, id);