Re: [PATCH V3 1/3] dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible

2023-08-06 Thread Frank Oltmanns
Hi Chris,
hi Guido,

On 2023-06-06 at 08:12:36 +0200, Frank Oltmanns  wrote:
> Hi Chris,
> hi Guido,
>
> On 2023-04-26 at 16:54:46 +0200, Guido Günther  wrote:
>> Hi Chris,
>> could you check if these two modifications by Frank of the init sequence
>>
>>
>> https://lore.kernel.org/dri-devel/20230211171748.36692-2-fr...@oltmanns.dev/
>>
>> https://lore.kernel.org/dri-devel/20230213123238.76889-2-fr...@oltmanns.dev/
>>
>> work for your panel too?
>
> I saw that Chris' patchset got accepted into drm-next, and I'm glad that
> more panels will therefore work out of the box. But: Did anyone check if
> the modifications I submitted in February and that Guido referenced
> above work with the new panel?

Chris, could you please check that the new rg353v-panel-v2 works with
the changes I proposed.

Guido, could you please check that the jh057n00900 panel works with the
changes I proposed.

Without these patches the XBD599 panel does not work reliably, so in the
long run it's desirable to include them in mainline. Currently, the only
user of the XBD599 panel that I'm aware of is the pinephone. Therefore,
all distributions supporting the pinephone rely on out-of-tree patches
to support the XDB599 panel.

I'd appreciate if we could rectify this situation.

Thank you both for your support,
  Frank

> Thanks,
>   Frank
>
>> Cheers,
>>  -- Guido
>>
>> On Wed, Apr 26, 2023 at 09:32:11AM -0500, Chris Morgan wrote:
>>> From: Chris Morgan 
>>>
>>> The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel.
>>> It's based on the ST7703 LCD controller just like rocktech,jh057n00900.
>>> It's used in a 2nd revision of the Anbernic RG353V handheld gaming
>>> device. Like the first revision of the RG353V the control chip is known
>>> but the panel itself is unknown, so name it for the device.
>>>
>>> Signed-off-by: Chris Morgan 
>>> Acked-by: Krzysztof Kozlowski 
>>> Acked-by: Guido Günther 
>>> ---
>>>  .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml 
>>> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>>> index 09b5eb7542f8..150e81090af2 100644
>>> --- 
>>> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>>> +++ 
>>> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>>> @@ -20,6 +20,8 @@ allOf:
>>>  properties:
>>>compatible:
>>>  enum:
>>> +  # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel
>>> +  - anbernic,rg353v-panel-v2
>>># Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
>>>- rocktech,jh057n00900
>>># Xingbangda XBD599 5.99" 720x1440 TFT LCD panel
>>> --
>>> 2.34.1
>>>
>>
>> On Wed, Apr 26, 2023 at 09:32:12AM -0500, Chris Morgan wrote:
>>> From: Chris Morgan 
>>>
>>> A later revision of the datasheet for the ST7703 refers to this command
>>> as "SETECO".
>>>
>>> Signed-off-by: Chris Morgan 
>>> Reviewed-by: Guido Günther 
>>> ---
>>>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
>>> b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>>> index 6747ca237ced..fc55b5fbb67f 100644
>>> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>>> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>>> @@ -41,8 +41,8 @@
>>>  #define ST7703_CMD_UNKNOWN_BF   0xBF
>>>  #define ST7703_CMD_SETSCR   0xC0
>>>  #define ST7703_CMD_SETPOWER 0xC1
>>> +#define ST7703_CMD_SETECO   0xC6
>>>  #define ST7703_CMD_SETPANEL 0xCC
>>> -#define ST7703_CMD_UNKNOWN_C6   0xC6
>>>  #define ST7703_CMD_SETGAMMA 0xE0
>>>  #define ST7703_CMD_SETEQ0xE3
>>>  #define ST7703_CMD_SETGIP1  0xE9
>>> @@ -249,8 +249,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
>>>   * ESD_DET_TIME_SEL = 0 frames
>>>   */);
>>>
>>> -   /* Undocumented command. */
>>> -   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_C6, 0x01, 0x00, 0xFF, 
>>> 0xFF, 0x00);
>>> +   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x01, 0x00, 0xFF, 0xFF, 
>>> 0x00);
>>>
>>> mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
>>>0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */
>>> --
>>> 2.34.1
>>>
>>
>> On Wed, Apr 26, 2023 at 09:32:13AM -0500, Chris Morgan wrote:
>>> From: Chris Morgan 
>>>
>>> The Anbernic RG353V-V2 is a 5 inch panel used in a new revision of the
>>> Anbernic RG353V handheld gaming device. Add support for it.
>>>
>>> Unfortunately it appears this controller is not able to support 120hz
>>> or 100hz mode like the first revision panel.
>>>
>>> Signed-off-by: Chris Morgan 
>>> Reviewed-by: Guido Günther 
>>> ---
>>>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++
>>>  1 file changed, 97 insertions(+)
>>>
>>> diff 

Re: [PATCH V3 1/3] dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible

2023-06-06 Thread Frank Oltmanns
Hi Chris,
hi Guido,

On 2023-04-26 at 16:54:46 +0200, Guido Günther  wrote:
> Hi Chris,
> could you check if these two modifications by Frank of the init sequence
>
>
> https://lore.kernel.org/dri-devel/20230211171748.36692-2-fr...@oltmanns.dev/
>
> https://lore.kernel.org/dri-devel/20230213123238.76889-2-fr...@oltmanns.dev/
>
> work for your panel too?

I saw that Chris' patchset got accepted into drm-next, and I'm glad that
more panels will therefore work out of the box. But: Did anyone check if
the modifications I submitted in February and that Guido referenced
above work with the new panel?

Thanks,
  Frank

> Cheers,
>  -- Guido
>
> On Wed, Apr 26, 2023 at 09:32:11AM -0500, Chris Morgan wrote:
>> From: Chris Morgan 
>>
>> The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel.
>> It's based on the ST7703 LCD controller just like rocktech,jh057n00900.
>> It's used in a 2nd revision of the Anbernic RG353V handheld gaming
>> device. Like the first revision of the RG353V the control chip is known
>> but the panel itself is unknown, so name it for the device.
>>
>> Signed-off-by: Chris Morgan 
>> Acked-by: Krzysztof Kozlowski 
>> Acked-by: Guido Günther 
>> ---
>>  .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml 
>> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>> index 09b5eb7542f8..150e81090af2 100644
>> --- 
>> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>> +++ 
>> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
>> @@ -20,6 +20,8 @@ allOf:
>>  properties:
>>compatible:
>>  enum:
>> +  # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel
>> +  - anbernic,rg353v-panel-v2
>># Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
>>- rocktech,jh057n00900
>># Xingbangda XBD599 5.99" 720x1440 TFT LCD panel
>> --
>> 2.34.1
>>
>
> On Wed, Apr 26, 2023 at 09:32:12AM -0500, Chris Morgan wrote:
>> From: Chris Morgan 
>>
>> A later revision of the datasheet for the ST7703 refers to this command
>> as "SETECO".
>>
>> Signed-off-by: Chris Morgan 
>> Reviewed-by: Guido Günther 
>> ---
>>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
>> b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> index 6747ca237ced..fc55b5fbb67f 100644
>> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> @@ -41,8 +41,8 @@
>>  #define ST7703_CMD_UNKNOWN_BF0xBF
>>  #define ST7703_CMD_SETSCR0xC0
>>  #define ST7703_CMD_SETPOWER  0xC1
>> +#define ST7703_CMD_SETECO0xC6
>>  #define ST7703_CMD_SETPANEL  0xCC
>> -#define ST7703_CMD_UNKNOWN_C60xC6
>>  #define ST7703_CMD_SETGAMMA  0xE0
>>  #define ST7703_CMD_SETEQ 0xE3
>>  #define ST7703_CMD_SETGIP1   0xE9
>> @@ -249,8 +249,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
>>* ESD_DET_TIME_SEL = 0 frames
>>*/);
>>
>> -/* Undocumented command. */
>> -mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_C6, 0x01, 0x00, 0xFF, 
>> 0xFF, 0x00);
>> +mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x01, 0x00, 0xFF, 0xFF, 
>> 0x00);
>>
>>  mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
>> 0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */
>> --
>> 2.34.1
>>
>
> On Wed, Apr 26, 2023 at 09:32:13AM -0500, Chris Morgan wrote:
>> From: Chris Morgan 
>>
>> The Anbernic RG353V-V2 is a 5 inch panel used in a new revision of the
>> Anbernic RG353V handheld gaming device. Add support for it.
>>
>> Unfortunately it appears this controller is not able to support 120hz
>> or 100hz mode like the first revision panel.
>>
>> Signed-off-by: Chris Morgan 
>> Reviewed-by: Guido Günther 
>> ---
>>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++
>>  1 file changed, 97 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
>> b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> index fc55b5fbb67f..3aa31f3d6157 100644
>> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
>> @@ -28,6 +28,7 @@
>>  /* Manufacturer specific Commands send via DSI */
>>  #define ST7703_CMD_ALL_PIXEL_OFF 0x22
>>  #define ST7703_CMD_ALL_PIXEL_ON  0x23
>> +#define ST7703_CMD_SETAPID   0xB1
>>  #define ST7703_CMD_SETDISP   0xB2
>>  #define ST7703_CMD_SETRGBIF  0xB3
>>  #define ST7703_CMD_SETCYC0xB4
>> @@ -42,11 +43,14 @@
>>  #define ST7703_CMD_SETSCR0xC0
>>  #define ST7703_CMD_SETPOWER  0xC1
>>  #define ST7703_CMD_SETECO0xC6
>> +#define ST7703_CMD_SETIO 0xC7
>> +#define ST7703_CMD_SETCABC   0xC8
>>  #define 

Re: [PATCH V3 1/3] dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible

2023-04-26 Thread Guido Günther
Hi Chris,
could you check if these two modifications by Frank of the init sequence

   https://lore.kernel.org/dri-devel/20230211171748.36692-2-fr...@oltmanns.dev/
   https://lore.kernel.org/dri-devel/20230213123238.76889-2-fr...@oltmanns.dev/

work for your panel too?
Cheers,
 -- Guido

On Wed, Apr 26, 2023 at 09:32:11AM -0500, Chris Morgan wrote:
> From: Chris Morgan 
> 
> The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel.
> It's based on the ST7703 LCD controller just like rocktech,jh057n00900.
> It's used in a 2nd revision of the Anbernic RG353V handheld gaming
> device. Like the first revision of the RG353V the control chip is known
> but the panel itself is unknown, so name it for the device.
> 
> Signed-off-by: Chris Morgan 
> Acked-by: Krzysztof Kozlowski 
> Acked-by: Guido Günther 
> ---
>  .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml 
> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
> index 09b5eb7542f8..150e81090af2 100644
> --- 
> a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
> +++ 
> b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
> @@ -20,6 +20,8 @@ allOf:
>  properties:
>compatible:
>  enum:
> +  # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel
> +  - anbernic,rg353v-panel-v2
># Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
>- rocktech,jh057n00900
># Xingbangda XBD599 5.99" 720x1440 TFT LCD panel
> -- 
> 2.34.1
> 

On Wed, Apr 26, 2023 at 09:32:12AM -0500, Chris Morgan wrote:
> From: Chris Morgan 
> 
> A later revision of the datasheet for the ST7703 refers to this command
> as "SETECO".
> 
> Signed-off-by: Chris Morgan 
> Reviewed-by: Guido Günther 
> ---
>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
> b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index 6747ca237ced..fc55b5fbb67f 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -41,8 +41,8 @@
>  #define ST7703_CMD_UNKNOWN_BF 0xBF
>  #define ST7703_CMD_SETSCR 0xC0
>  #define ST7703_CMD_SETPOWER   0xC1
> +#define ST7703_CMD_SETECO 0xC6
>  #define ST7703_CMD_SETPANEL   0xCC
> -#define ST7703_CMD_UNKNOWN_C6 0xC6
>  #define ST7703_CMD_SETGAMMA   0xE0
>  #define ST7703_CMD_SETEQ  0xE3
>  #define ST7703_CMD_SETGIP10xE9
> @@ -249,8 +249,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
> * ESD_DET_TIME_SEL = 0 frames
> */);
>  
> - /* Undocumented command. */
> - mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_UNKNOWN_C6, 0x01, 0x00, 0xFF, 
> 0xFF, 0x00);
> + mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETECO, 0x01, 0x00, 0xFF, 0xFF, 
> 0x00);
>  
>   mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETPOWER,
>  0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */
> -- 
> 2.34.1
> 

On Wed, Apr 26, 2023 at 09:32:13AM -0500, Chris Morgan wrote:
> From: Chris Morgan 
> 
> The Anbernic RG353V-V2 is a 5 inch panel used in a new revision of the
> Anbernic RG353V handheld gaming device. Add support for it.
> 
> Unfortunately it appears this controller is not able to support 120hz
> or 100hz mode like the first revision panel.
> 
> Signed-off-by: Chris Morgan 
> Reviewed-by: Guido Günther 
> ---
>  drivers/gpu/drm/panel/panel-sitronix-st7703.c | 97 +++
>  1 file changed, 97 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c 
> b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index fc55b5fbb67f..3aa31f3d6157 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -28,6 +28,7 @@
>  /* Manufacturer specific Commands send via DSI */
>  #define ST7703_CMD_ALL_PIXEL_OFF 0x22
>  #define ST7703_CMD_ALL_PIXEL_ON   0x23
> +#define ST7703_CMD_SETAPID0xB1
>  #define ST7703_CMD_SETDISP0xB2
>  #define ST7703_CMD_SETRGBIF   0xB3
>  #define ST7703_CMD_SETCYC 0xB4
> @@ -42,11 +43,14 @@
>  #define ST7703_CMD_SETSCR 0xC0
>  #define ST7703_CMD_SETPOWER   0xC1
>  #define ST7703_CMD_SETECO 0xC6
> +#define ST7703_CMD_SETIO  0xC7
> +#define ST7703_CMD_SETCABC0xC8
>  #define ST7703_CMD_SETPANEL   0xCC
>  #define ST7703_CMD_SETGAMMA   0xE0
>  #define ST7703_CMD_SETEQ  0xE3
>  #define ST7703_CMD_SETGIP10xE9
>  #define ST7703_CMD_SETGIP20xEA
> +#define ST7703_CMD_UNKNOWN_EF 0xEF
>  
>  struct st7703 {
>   struct device *dev;
> @@ -337,6 +341,98 @@ static const struct st7703_panel_desc xbd599_desc = {
>   .init_sequence = xbd599_init_sequence,
>  };
>  
> +static int rg353v2_init_sequence(struct 

[PATCH V3 1/3] dt-bindings: panel: Add Anbernic RG353V-V2 panel compatible

2023-04-26 Thread Chris Morgan
From: Chris Morgan 

The Anbernic RG353V-V2 panel is a 3.5 inch 640x480 MIPI-DSI LCD panel.
It's based on the ST7703 LCD controller just like rocktech,jh057n00900.
It's used in a 2nd revision of the Anbernic RG353V handheld gaming
device. Like the first revision of the RG353V the control chip is known
but the panel itself is unknown, so name it for the device.

Signed-off-by: Chris Morgan 
Acked-by: Krzysztof Kozlowski 
Acked-by: Guido Günther 
---
 .../devicetree/bindings/display/panel/rocktech,jh057n00900.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml 
b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
index 09b5eb7542f8..150e81090af2 100644
--- a/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
+++ b/Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml
@@ -20,6 +20,8 @@ allOf:
 properties:
   compatible:
 enum:
+  # Anberic RG353V-V2 5.0" 640x480 TFT LCD panel
+  - anbernic,rg353v-panel-v2
   # Rocktech JH057N00900 5.5" 720x1440 TFT LCD panel
   - rocktech,jh057n00900
   # Xingbangda XBD599 5.99" 720x1440 TFT LCD panel
-- 
2.34.1