Skip to contentSkip to conversation

drm/komeda: Correct d71 register block counting

PATCH In review james qian wang (Arm Technology China) 2 participants 2 messages Dec 10, 2019 – Dec 11, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +6 -3
index 822b23a1ce75..d53f95dea0a1 100644
@@ -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;
 	}
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · On Tuesday, 10 December 2019 06:10:34 GMT james qian wang (Arm Technology…

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.

---
 drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +5 -2
index 822b23a1ce75..d53f95dea0a1 100644
@@ -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);

drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c static int d71_enum_resources(struct komeda_dev *mdev) · line 436

Quoted 10 lines
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +1 -1
@@ -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;
 	}
 
Signature · 8 lines
Mihail



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel