Skip to contentSkip to conversation

drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

PATCH RESEND Superseded Ao Zhong 3 participants 9 messages Jan 28, 2024 – Feb 10, 2024

Subsystems (4)
lore
Share & tools
lore

Ao Zhong

author
#0 lore raw

cover drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

Due to parameter errors, the Anbernic RG353V-V2 screen couldn't be properly initialized, resulting in a black screen and unable to display anything. After correcting these parameters by referencing the device tree in JELOS (which uses the BSP kernel for RK3566), the panel started to work properly.

Fixes 0ed9208cb120 ("drm/panel: st7703: Add Anbernic RG353V-V2 Panel Support")

Ao Zhong (1):
drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH RESEND 1/1 drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

This patch resolves the issue with the panel initialization of the Anbernic RG353V-V2 caused by incorrect parameters.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Hi Ao,

this doesn't say why that was changed but your cover letter has that information:

Quoted 3 lines

After correcting these parameters by referencing the
device tree in JELOS (which uses the BSP kernel for RK3566), the panel started to work properly.

Can you add that to the commit message and maybe add an URL as reference please?

I've added Chris to the cc: list. He submitted the original rg353v2 and we don't want to break other devices. Chris, do you have any means to check these values?

Cheers,
-- Guido

Quoted 26 lines · Ao Zhong

This patch resolves the issue with the panel initialization of the Anbernic RG353V-V2 caused by incorrect parameters.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
Tested-by
#3 lore raw
Quoted 9 lines · Guido Günther

Hi Ao,

this doesn't say why that was changed but your cover letter has that information:

Quoted 3 lines

After correcting these parameters by referencing the
device tree in JELOS (which uses the BSP kernel for RK3566), the panel started to work properly.

Quoted 6 lines

Can you add that to the commit message and maybe add an URL as reference please?

I've added Chris to the cc: list. He submitted the original rg353v2 and we don't want to break other devices. Chris, do you have any means to check these values?

I checked. I'm not sure exactly how but when I fired up the most recent kernel this panel appeared to have problems with the init sequence as defined. After making the changes from this patch series it seems to be back to normal. So these changes appear to be needed for existing devices, and I'm not sure what could have caused the regression...

Note the previous settings did still appear to work, the panel just took much longer to start working after the init sequence (as much as 20 seconds on cold boot, clearly indicating a problem).

Thank you for the fix!

Quoted 31 lines

Cheers,
-- Guido

Quoted 26 lines · Ao Zhong

This patch resolves the issue with the panel initialization of the Anbernic RG353V-V2 caused by incorrect parameters.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
author
#4 lore raw

Hello Chris Morgan, Guido Günther,

I will post a v2 patch. I will supplement the commit information and attach the reference links I used when modifying the init sequence.

Ao Zhong

Am Fr., 9. Feb. 2024 um 22:35 Uhr schrieb Chris Morgan <[email protected]>:

Quoted 63 lines · Guido Günther
Quoted 9 lines

Hi Ao,

this doesn't say why that was changed but your cover letter has that information:

Quoted 3 lines

After correcting these parameters by referencing the
device tree in JELOS (which uses the BSP kernel for RK3566), the panel started to work properly.

Quoted 6 lines

Can you add that to the commit message and maybe add an URL as reference please?

I've added Chris to the cc: list. He submitted the original rg353v2 and we don't want to break other devices. Chris, do you have any means to check these values?

I checked. I'm not sure exactly how but when I fired up the most recent kernel this panel appeared to have problems with the init sequence as defined. After making the changes from this patch series it seems to be back to normal. So these changes appear to be needed for existing devices, and I'm not sure what could have caused the regression...

Note the previous settings did still appear to work, the panel just took much longer to start working after the init sequence (as much as 20 seconds on cold boot, clearly indicating a problem).

Thank you for the fix!

Quoted 31 lines

Cheers,
-- Guido

Quoted 26 lines · Ao Zhong

This patch resolves the issue with the panel initialization of the Anbernic RG353V-V2 caused by incorrect parameters.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -3
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
                           0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
    mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
    mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
                           0xf0, 0x63);
    mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
                           0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
--

2.43.0

author
#5 lore raw

PATCH v2 1/1 drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

This patch addresses an issue with the Anbernic RG353V-V2 panel initialization that was caused by incorrect parameter. The correct initialization sequence was derived by referencing the JELOS (Just Enough Linux OS) BSP kernel's device tree for the V2 panel, which is identified by the ID "38 21". The relevant device tree can be found at:

https://github.com/JustEnoughLinuxOS/rk356x-kernel/blob/d4d7335a5ca18fc216a29712d5c6cecfb86147d2/arch/arm64/boot/dts/rockchip/rk3568-evb-rg353v.dtsi#L582

The proper initialization sequence was further informed by dissecting instructions as outlined in the "Rockchip_DRM_Panel_Porting_Guide", starting from page 18 of the document.

https://web.archive.org/web/20240209211932/http://download.t-firefly.com/product/Board/Common/Document/Developer/Rockchip_Developer_Guide_DRM_Panel_Porting_CN.pdf

Upon comparing the initialization sequence within the rg353v2_init_sequence function against the device tree in the BSP kernel, discrepancies were identified in two instructions. The relevant instructions in the device tree are:

1. 15 00 03 b6 7f 7f corresponding to the ST7703_CMD_SETVCOM command with parameters 7f 7f
2. 39 00 05 b8 26 62 f0 63 corresponding to the ST7703_CMD_SETPOWER_EXT command with parameters 26 62 f0 63

Adjusting the parameters to match those specified in the BSP kernel's device tree allow the panel to initialize correctly.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
author
#6 lore raw

PATCH v3 1/1 drm/panel: st7703: Fix Panel Initialization for Anbernic RG353V-V2

In reply to Guido Günther

This patch addresses an issue with the Anbernic RG353V-V2 panel initialization that was caused by incorrect parameter. The correct initialization sequence was derived by referencing the JELOS (Just Enough Linux OS) BSP kernel's device tree for the V2 panel, which is identified by the ID "38 21". The relevant device tree can be found at:

https://github.com/JustEnoughLinuxOS/rk356x-kernel/blob/d4d7335a5ca18fc216a29712d5c6cecfb86147d2/arch/arm64/boot/dts/rockchip/rk3568-evb-rg353v.dtsi#L582

The proper initialization sequence was further informed by dissecting instructions as outlined in the "Rockchip_DRM_Panel_Porting_Guide", specifically in Chapter 3.3 of the document.

https://web.archive.org/web/20240209211932if_/http://download.t-firefly.com/product/Board/Common/Document/Developer/Rockchip_Developer_Guide_DRM_Panel_Porting_CN.pdf

Upon comparing the initialization sequence within the rg353v2_init_sequence function against the device tree in the BSP kernel, discrepancies were identified in two instructions. The relevant instructions in the device tree are:

1. 15 00 03 b6 7f 7f corresponding to the ST7703_CMD_SETVCOM command with parameters 7f 7f
2. 39 00 05 b8 26 62 f0 63 corresponding to the ST7703_CMD_SETPOWER_EXT command with parameters 26 62 f0 63

Adjusting the parameters to match those specified in the BSP kernel's device tree allow the panel to initialize correctly.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
Tested-by on v3 1/1
#7 lore raw
Quoted 24 lines · Ao Zhong

This patch addresses an issue with the Anbernic RG353V-V2 panel initialization that was caused by incorrect parameter. The correct initialization sequence was derived by referencing the JELOS (Just Enough Linux OS) BSP kernel's device tree for the V2 panel, which is identified by the ID "38 21". The relevant device tree can be found at:

https://github.com/JustEnoughLinuxOS/rk356x-kernel/blob/d4d7335a5ca18fc216a29712d5c6cecfb86147d2/arch/arm64/boot/dts/rockchip/rk3568-evb-rg353v.dtsi#L582

The proper initialization sequence was further informed by dissecting instructions as outlined in the "Rockchip_DRM_Panel_Porting_Guide", specifically in Chapter 3.3 of the document.

https://web.archive.org/web/20240209211932if_/http://download.t-firefly.com/product/Board/Common/Document/Developer/Rockchip_Developer_Guide_DRM_Panel_Porting_CN.pdf

Upon comparing the initialization sequence within the rg353v2_init_sequence function against the device tree in the BSP kernel, discrepancies were identified in two instructions. The relevant instructions in the device tree are:

1. 15 00 03 b6 7f 7f corresponding to the ST7703_CMD_SETVCOM command with parameters 7f 7f
2. 39 00 05 b8 26 62 f0 63 corresponding to the ST7703_CMD_SETPOWER_EXT command with parameters 26 62 f0 63

Quoted 4 lines

Adjusting the parameters to match those specified in the BSP kernel's device tree allow the panel to initialize correctly.

Quoted 22 lines
---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00, 0x00,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v3 1/1
#8 lore raw
In reply to Ao Zhong

Hi,

Quoted 47 lines · Ao Zhong

This patch addresses an issue with the Anbernic RG353V-V2 panel initialization that was caused by incorrect parameter. The correct initialization sequence was derived by referencing the JELOS (Just Enough Linux OS) BSP kernel's device tree for the V2 panel, which is identified by the ID "38 21". The relevant device tree can be found at:

https://github.com/JustEnoughLinuxOS/rk356x-kernel/blob/d4d7335a5ca18fc216a29712d5c6cecfb86147d2/arch/arm64/boot/dts/rockchip/rk3568-evb-rg353v.dtsi#L582

The proper initialization sequence was further informed by dissecting instructions as outlined in the "Rockchip_DRM_Panel_Porting_Guide", specifically in Chapter 3.3 of the document.

https://web.archive.org/web/20240209211932if_/http://download.t-firefly.com/product/Board/Common/Document/Developer/Rockchip_Developer_Guide_DRM_Panel_Porting_CN.pdf

Upon comparing the initialization sequence within the rg353v2_init_sequence function against the device tree in the BSP kernel, discrepancies were identified in two instructions. The relevant instructions in the device tree are:

1. 15 00 03 b6 7f 7f corresponding to the ST7703_CMD_SETVCOM command with parameters 7f 7f
2. 39 00 05 b8 26 62 f0 63 corresponding to the ST7703_CMD_SETPOWER_EXT command with parameters 26 62 f0 63

Adjusting the parameters to match those specified in the BSP kernel's device tree allow the panel to initialize correctly.

---
 drivers/gpu/drm/panel/panel-sitronix-st7703.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-sitronix-st7703.c +2 -2
index b55bafd1a8be..a346d6c3d283 100644
@@ -357,8 +357,8 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
 			       0x28, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETCYC, 0x80);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, 0x0a, 0x0a);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x92, 0x92);
-	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x25, 0x22,
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, 0x7f, 0x7f);
+	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER_EXT, 0x26, 0x62,
 			       0xf0, 0x63);
 	mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETMIPI, 0x33, 0x81, 0x05,
 			       0xf9, 0x0e, 0x0e, 0x20, 0x00, 0x00, 0x00,
Quoted 1 line

0x00,

-- Guido

Quoted 3 lines
Signature · 1 line
2.43.0