Skip to content

Commit f76b987

Browse files
committed
drm/fsl-dcu: fix register initialization
The layer enumeration start with 0 (0-15 for LS1021a and 0-63 for Vybrid) whereas the register enumeration start from 1 (1-10 for LS1021a and 1-9 for Vybrid). The loop started off from 0 for both iterations and initialized the number of layers inclusive, which is one layer too many. All extensively written registers seem to be unassigned, it seems that the write to those registers did not do any harm in practice. Signed-off-by: Stefan Agner <stefan@agner.ch>
1 parent 4bc390c commit f76b987

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ int fsl_dcu_drm_crtc_create(struct fsl_dcu_drm_device *fsl_dev)
164164
reg_num = LS1021A_LAYER_REG_NUM;
165165
else
166166
reg_num = VF610_LAYER_REG_NUM;
167-
for (i = 0; i <= fsl_dev->soc->total_layer; i++) {
168-
for (j = 0; j < reg_num; j++)
167+
for (i = 0; i < fsl_dev->soc->total_layer; i++) {
168+
for (j = 1; j <= reg_num; j++)
169169
regmap_write(fsl_dev->regmap, DCU_CTRLDESCLN(i, j), 0);
170170
}
171171
regmap_update_bits(fsl_dev->regmap, DCU_DCU_MODE,

0 commit comments

Comments
 (0)