diff options
author | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-12-10 09:10:34 +0300 |
---|---|---|
committer | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-12-12 09:44:29 +0300 |
commit | 6fd70eab49caf32a0b486b4bf098bf885bda48e8 (patch) | |
tree | 364e3fc2d937ede1375a8b1f50e91d284a033a3c /drivers/gpu/drm/arm | |
parent | 14856e9efb87381ab3ff71085ae8129ee4b2607e (diff) | |
download | linux-6fd70eab49caf32a0b486b4bf098bf885bda48e8.tar.xz |
drm/komeda: Correct d71 register block counting
Per HW, d71->num_blocks includes reserved blocks but no PERIPH block,
correct the block counting accordingly.
D71 happens to only have one reserved block and periph block, which
hides this counting error.
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com>
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210061015.25905-1-james.qian.wang@arm.com
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c index 822b23a1ce75..d53f95dea0a1 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c @@ -414,8 +414,11 @@ static int d71_enum_resources(struct komeda_dev *mdev) d71->pipes[i] = to_d71_pipeline(pipe); } - /* loop the register blks and probe */ - i = 2; /* exclude GCU and PERIPH */ + /* loop the register blks and probe. + * NOTE: d71->num_blocks includes reserved blocks. + * d71->num_blocks = GCU + valid blocks + reserved blocks + */ + i = 1; /* exclude GCU */ offset = D71_BLOCK_SIZE; /* skip GCU */ while (i < d71->num_blocks) { blk_base = mdev->reg_base + (offset >> 2); @@ -425,9 +428,9 @@ static int d71_enum_resources(struct komeda_dev *mdev) err = d71_probe_block(d71, &blk, blk_base); if (err) goto err_cleanup; - i++; } + i++; offset += D71_BLOCK_SIZE; } |