Commit 7c78fdba authored by Maíra Canal's avatar Maíra Canal

drm/v3d: Add V3D tech revision to the device information

The V3D tech revision can be a useful information when configuring
jobs. Therefore, expose it in the `struct v3d_dev` with the V3D tech
version.
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240714145243.1223131-1-mcanal@igalia.com
parent c537fb4e
...@@ -265,7 +265,7 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) ...@@ -265,7 +265,7 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
struct v3d_dev *v3d; struct v3d_dev *v3d;
int ret; int ret;
u32 mmu_debug; u32 mmu_debug;
u32 ident1; u32 ident1, ident3;
u64 mask; u64 mask;
v3d = devm_drm_dev_alloc(dev, &v3d_drm_driver, struct v3d_dev, drm); v3d = devm_drm_dev_alloc(dev, &v3d_drm_driver, struct v3d_dev, drm);
...@@ -298,6 +298,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) ...@@ -298,6 +298,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
v3d->cores = V3D_GET_FIELD(ident1, V3D_HUB_IDENT1_NCORES); v3d->cores = V3D_GET_FIELD(ident1, V3D_HUB_IDENT1_NCORES);
WARN_ON(v3d->cores > 1); /* multicore not yet implemented */ WARN_ON(v3d->cores > 1); /* multicore not yet implemented */
ident3 = V3D_READ(V3D_HUB_IDENT3);
v3d->rev = V3D_GET_FIELD(ident3, V3D_HUB_IDENT3_IPREV);
if (v3d->ver >= 71) if (v3d->ver >= 71)
v3d->max_counters = V3D_V71_NUM_PERFCOUNTERS; v3d->max_counters = V3D_V71_NUM_PERFCOUNTERS;
else if (v3d->ver >= 42) else if (v3d->ver >= 42)
......
...@@ -98,10 +98,12 @@ struct v3d_perfmon { ...@@ -98,10 +98,12 @@ struct v3d_perfmon {
struct v3d_dev { struct v3d_dev {
struct drm_device drm; struct drm_device drm;
/* Short representation (e.g. 33, 41) of the V3D tech version /* Short representation (e.g. 33, 41) of the V3D tech version */
* and revision.
*/
int ver; int ver;
/* Short representation (e.g. 5, 6) of the V3D tech revision */
int rev;
bool single_irq_line; bool single_irq_line;
/* Different revisions of V3D have different total number of performance /* Different revisions of V3D have different total number of performance
......
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