Skip to content

Commit 7c78fdb

Browse files
committed
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: Maíra Canal <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c537fb4 commit 7c78fdb

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/gpu/drm/v3d/v3d_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
265265
struct v3d_dev *v3d;
266266
int ret;
267267
u32 mmu_debug;
268-
u32 ident1;
268+
u32 ident1, ident3;
269269
u64 mask;
270270

271271
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)
298298
v3d->cores = V3D_GET_FIELD(ident1, V3D_HUB_IDENT1_NCORES);
299299
WARN_ON(v3d->cores > 1); /* multicore not yet implemented */
300300

301+
ident3 = V3D_READ(V3D_HUB_IDENT3);
302+
v3d->rev = V3D_GET_FIELD(ident3, V3D_HUB_IDENT3_IPREV);
303+
301304
if (v3d->ver >= 71)
302305
v3d->max_counters = V3D_V71_NUM_PERFCOUNTERS;
303306
else if (v3d->ver >= 42)

drivers/gpu/drm/v3d/v3d_drv.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ struct v3d_perfmon {
9898
struct v3d_dev {
9999
struct drm_device drm;
100100

101-
/* Short representation (e.g. 33, 41) of the V3D tech version
102-
* and revision.
103-
*/
101+
/* Short representation (e.g. 33, 41) of the V3D tech version */
104102
int ver;
103+
104+
/* Short representation (e.g. 5, 6) of the V3D tech revision */
105+
int rev;
106+
105107
bool single_irq_line;
106108

107109
/* Different revisions of V3D have different total number of performance

0 commit comments

Comments
 (0)