Commit 1e513480 authored by Boris Brezillon's avatar Boris Brezillon Committed by Rob Herring

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: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190618081648.17297-4-boris.brezillon@collabora.com
parent 92f0ad0b
...@@ -110,6 +110,11 @@ static inline int panfrost_model_cmp(struct panfrost_device *pfdev, s32 id) ...@@ -110,6 +110,11 @@ static inline int panfrost_model_cmp(struct panfrost_device *pfdev, s32 id)
return match_id - 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) static inline bool panfrost_model_eq(struct panfrost_device *pfdev, s32 id)
{ {
return !panfrost_model_cmp(pfdev, id); return !panfrost_model_cmp(pfdev, id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment