dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support
@ 2023-07-18 15:12 Michael Riesch
  2023-07-18 15:12 ` [PATCH 1/2] " Michael Riesch
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael Riesch @ 2023-07-18 15:12 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel, Michael Riesch

Hi all,

This series adds support for orientation specification in the device
tree to the Sitronix ST7789V panel driver. 

This is can be seen as reduced version of [0] (some things of [0] have
been implemented in more general fashion in the scope of [1], other
things have been rejected).

Looking forward to your comments!

[0] https://lore.kernel.org/lkml/20230314115644.3775169-1-gerald.loacker@wolfvision.net/
[1] https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/

---
Michael Riesch (2):
      drm/panel: sitronix-st7789v: add panel orientation support
      dt-bindings: display: add rotation property to sitronix,st7789v

 .../bindings/display/panel/sitronix,st7789v.yaml   |  2 ++
 drivers/gpu/drm/panel/panel-sitronix-st7789v.c     | 28 ++++++++++++++++++----
 2 files changed, 25 insertions(+), 5 deletions(-)
---
base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
change-id: 20230718-feature-st7789v-4d0c2c6e2429

Best regards,
-- 
Michael Riesch <michael.riesch@wolfvision.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] drm/panel: sitronix-st7789v: add panel orientation support
  2023-07-18 15:12 [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
@ 2023-07-18 15:12 ` Michael Riesch
  2023-08-02 12:39   ` Neil Armstrong
  2023-07-18 15:12 ` [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v Michael Riesch
  2023-08-02 12:23 ` [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
  2 siblings, 1 reply; 8+ messages in thread
From: Michael Riesch @ 2023-07-18 15:12 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel, Michael Riesch

Determine the orientation of the display based on the device tree and
propagate it.

While at it, fix the indentation in the struct drm_panel_funcs.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 28 +++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
index bbc4569cbcdc..6575f07d49e3 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
@@ -116,6 +116,7 @@ struct st7789v {
 	struct spi_device *spi;
 	struct gpio_desc *reset;
 	struct regulator *power;
+	enum drm_panel_orientation orientation;
 };
 
 enum st7789v_prefix {
@@ -170,6 +171,7 @@ static const struct drm_display_mode default_mode = {
 static int st7789v_get_modes(struct drm_panel *panel,
 			     struct drm_connector *connector)
 {
+	struct st7789v *ctx = panel_to_st7789v(panel);
 	struct drm_display_mode *mode;
 
 	mode = drm_mode_duplicate(connector->dev, &default_mode);
@@ -188,9 +190,22 @@ static int st7789v_get_modes(struct drm_panel *panel,
 	connector->display_info.width_mm = 61;
 	connector->display_info.height_mm = 103;
 
+	/*
+	 * TODO: Remove once all drm drivers call
+	 * drm_connector_set_orientation_from_panel()
+	 */
+	drm_connector_set_panel_orientation(connector, ctx->orientation);
+
 	return 1;
 }
 
+static enum drm_panel_orientation st7789v_get_orientation(struct drm_panel *p)
+{
+	struct st7789v *ctx = panel_to_st7789v(p);
+
+	return ctx->orientation;
+}
+
 static int st7789v_prepare(struct drm_panel *panel)
 {
 	struct st7789v *ctx = panel_to_st7789v(panel);
@@ -346,11 +361,12 @@ static int st7789v_unprepare(struct drm_panel *panel)
 }
 
 static const struct drm_panel_funcs st7789v_drm_funcs = {
-	.disable	= st7789v_disable,
-	.enable		= st7789v_enable,
-	.get_modes	= st7789v_get_modes,
-	.prepare	= st7789v_prepare,
-	.unprepare	= st7789v_unprepare,
+	.disable = st7789v_disable,
+	.enable	= st7789v_enable,
+	.get_modes = st7789v_get_modes,
+	.get_orientation = st7789v_get_orientation,
+	.prepare = st7789v_prepare,
+	.unprepare = st7789v_unprepare,
 };
 
 static int st7789v_probe(struct spi_device *spi)
@@ -382,6 +398,8 @@ static int st7789v_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
+	of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
+
 	drm_panel_add(&ctx->panel);
 
 	return 0;

-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v
  2023-07-18 15:12 [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
  2023-07-18 15:12 ` [PATCH 1/2] " Michael Riesch
@ 2023-07-18 15:12 ` Michael Riesch
  2023-07-18 15:52   ` Conor Dooley
  2023-08-02 12:23 ` [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
  2 siblings, 1 reply; 8+ messages in thread
From: Michael Riesch @ 2023-07-18 15:12 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel, Michael Riesch

The sitronix-st7789v driver now considers the rotation property.
Add the property to the documentation.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
index fa6556363cca..694d7f771d0c 100644
--- a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
+++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
@@ -22,6 +22,7 @@ properties:
   power-supply: true
   backlight: true
   port: true
+  rotation: true
 
   spi-cpha: true
   spi-cpol: true
@@ -52,6 +53,7 @@ examples:
             reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>;
             backlight = <&pwm_bl>;
             power-supply = <&power>;
+            rotation = <180>;
             spi-max-frequency = <100000>;
             spi-cpol;
             spi-cpha;

-- 
2.30.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v
  2023-07-18 15:12 ` [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v Michael Riesch
@ 2023-07-18 15:52   ` Conor Dooley
  0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2023-07-18 15:52 UTC (permalink / raw)
  To: Michael Riesch
  Cc: Neil Armstrong, Conor Dooley, devicetree, Gerald Loacker,
	Sam Ravnborg, Sebastian Reichel, Maxime Ripard, linux-kernel,
	Rob Herring, dri-devel, Krzysztof Kozlowski, Miquel Raynal

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

On Tue, Jul 18, 2023 at 05:12:46PM +0200, Michael Riesch wrote:
> The sitronix-st7789v driver now considers the rotation property.
> Add the property to the documentation.
> 
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
> index fa6556363cca..694d7f771d0c 100644
> --- a/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
> @@ -22,6 +22,7 @@ properties:
>    power-supply: true
>    backlight: true
>    port: true
> +  rotation: true
>  
>    spi-cpha: true
>    spi-cpol: true
> @@ -52,6 +53,7 @@ examples:
>              reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>;
>              backlight = <&pwm_bl>;
>              power-supply = <&power>;
> +            rotation = <180>;
>              spi-max-frequency = <100000>;
>              spi-cpol;
>              spi-cpha;
> 
> -- 
> 2.30.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support
  2023-07-18 15:12 [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
  2023-07-18 15:12 ` [PATCH 1/2] " Michael Riesch
  2023-07-18 15:12 ` [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v Michael Riesch
@ 2023-08-02 12:23 ` Michael Riesch
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Riesch @ 2023-08-02 12:23 UTC (permalink / raw)
  To: Neil Armstrong, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel

Hi all,

On 7/18/23 17:12, Michael Riesch wrote:
> Hi all,
> 
> This series adds support for orientation specification in the device
> tree to the Sitronix ST7789V panel driver. 
> 
> This is can be seen as reduced version of [0] (some things of [0] have
> been implemented in more general fashion in the scope of [1], other
> things have been rejected).
> 
> Looking forward to your comments!

Gentle ping!

The DT part has already received an Acked-by -- are there any objections
from the DRM side?

Thanks and best regards,
Michael

> 
> [0] https://lore.kernel.org/lkml/20230314115644.3775169-1-gerald.loacker@wolfvision.net/
> [1] https://lore.kernel.org/lkml/20230714013756.1546769-1-sre@kernel.org/
> 
> ---
> Michael Riesch (2):
>       drm/panel: sitronix-st7789v: add panel orientation support
>       dt-bindings: display: add rotation property to sitronix,st7789v
> 
>  .../bindings/display/panel/sitronix,st7789v.yaml   |  2 ++
>  drivers/gpu/drm/panel/panel-sitronix-st7789v.c     | 28 ++++++++++++++++++----
>  2 files changed, 25 insertions(+), 5 deletions(-)
> ---
> base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
> change-id: 20230718-feature-st7789v-4d0c2c6e2429
> 
> Best regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] drm/panel: sitronix-st7789v: add panel orientation support
  2023-07-18 15:12 ` [PATCH 1/2] " Michael Riesch
@ 2023-08-02 12:39   ` Neil Armstrong
  2023-08-02 13:19     ` Michael Riesch
  0 siblings, 1 reply; 8+ messages in thread
From: Neil Armstrong @ 2023-08-02 12:39 UTC (permalink / raw)
  To: Michael Riesch, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel

On 18/07/2023 17:12, Michael Riesch wrote:
> Determine the orientation of the display based on the device tree and
> propagate it.
> 
> While at it, fix the indentation in the struct drm_panel_funcs.
> 
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>   drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 28 +++++++++++++++++++++-----
>   1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> index bbc4569cbcdc..6575f07d49e3 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
> @@ -116,6 +116,7 @@ struct st7789v {
>   	struct spi_device *spi;
>   	struct gpio_desc *reset;
>   	struct regulator *power;
> +	enum drm_panel_orientation orientation;
>   };
>   
>   enum st7789v_prefix {
> @@ -170,6 +171,7 @@ static const struct drm_display_mode default_mode = {
>   static int st7789v_get_modes(struct drm_panel *panel,
>   			     struct drm_connector *connector)
>   {
> +	struct st7789v *ctx = panel_to_st7789v(panel);
>   	struct drm_display_mode *mode;
>   
>   	mode = drm_mode_duplicate(connector->dev, &default_mode);
> @@ -188,9 +190,22 @@ static int st7789v_get_modes(struct drm_panel *panel,
>   	connector->display_info.width_mm = 61;
>   	connector->display_info.height_mm = 103;
>   
> +	/*
> +	 * TODO: Remove once all drm drivers call
> +	 * drm_connector_set_orientation_from_panel()
> +	 */
> +	drm_connector_set_panel_orientation(connector, ctx->orientation);
> +
>   	return 1;
>   }
>   
> +static enum drm_panel_orientation st7789v_get_orientation(struct drm_panel *p)
> +{
> +	struct st7789v *ctx = panel_to_st7789v(p);
> +
> +	return ctx->orientation;
> +}
> +
>   static int st7789v_prepare(struct drm_panel *panel)
>   {
>   	struct st7789v *ctx = panel_to_st7789v(panel);
> @@ -346,11 +361,12 @@ static int st7789v_unprepare(struct drm_panel *panel)
>   }
>   
>   static const struct drm_panel_funcs st7789v_drm_funcs = {
> -	.disable	= st7789v_disable,
> -	.enable		= st7789v_enable,
> -	.get_modes	= st7789v_get_modes,
> -	.prepare	= st7789v_prepare,
> -	.unprepare	= st7789v_unprepare,
> +	.disable = st7789v_disable,
> +	.enable	= st7789v_enable,
> +	.get_modes = st7789v_get_modes,
> +	.get_orientation = st7789v_get_orientation,
> +	.prepare = st7789v_prepare,
> +	.unprepare = st7789v_unprepare,

Changing the indentation of the whole block is a spurious change,
either change it in a separate patch or use the current indentation style...

>   };
>   
>   static int st7789v_probe(struct spi_device *spi)
> @@ -382,6 +398,8 @@ static int st7789v_probe(struct spi_device *spi)
>   	if (ret)
>   		return ret;
>   
> +	of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
> +
>   	drm_panel_add(&ctx->panel);
>   
>   	return 0;
> 

With this changed:

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] drm/panel: sitronix-st7789v: add panel orientation support
  2023-08-02 12:39   ` Neil Armstrong
@ 2023-08-02 13:19     ` Michael Riesch
  2023-08-02 13:26       ` neil.armstrong
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Riesch @ 2023-08-02 13:19 UTC (permalink / raw)
  To: neil.armstrong, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel

Hi Neil,

On 8/2/23 14:39, Neil Armstrong wrote:
> On 18/07/2023 17:12, Michael Riesch wrote:
>> Determine the orientation of the display based on the device tree and
>> propagate it.
>>
>> While at it, fix the indentation in the struct drm_panel_funcs.
>>
>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>> ---
>>   drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 28
>> +++++++++++++++++++++-----
>>   1 file changed, 23 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>> b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>> index bbc4569cbcdc..6575f07d49e3 100644
>> --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>> @@ -116,6 +116,7 @@ struct st7789v {
>>       struct spi_device *spi;
>>       struct gpio_desc *reset;
>>       struct regulator *power;
>> +    enum drm_panel_orientation orientation;
>>   };
>>     enum st7789v_prefix {
>> @@ -170,6 +171,7 @@ static const struct drm_display_mode default_mode = {
>>   static int st7789v_get_modes(struct drm_panel *panel,
>>                    struct drm_connector *connector)
>>   {
>> +    struct st7789v *ctx = panel_to_st7789v(panel);
>>       struct drm_display_mode *mode;
>>         mode = drm_mode_duplicate(connector->dev, &default_mode);
>> @@ -188,9 +190,22 @@ static int st7789v_get_modes(struct drm_panel
>> *panel,
>>       connector->display_info.width_mm = 61;
>>       connector->display_info.height_mm = 103;
>>   +    /*
>> +     * TODO: Remove once all drm drivers call
>> +     * drm_connector_set_orientation_from_panel()
>> +     */
>> +    drm_connector_set_panel_orientation(connector, ctx->orientation);
>> +
>>       return 1;
>>   }
>>   +static enum drm_panel_orientation st7789v_get_orientation(struct
>> drm_panel *p)
>> +{
>> +    struct st7789v *ctx = panel_to_st7789v(p);
>> +
>> +    return ctx->orientation;
>> +}
>> +
>>   static int st7789v_prepare(struct drm_panel *panel)
>>   {
>>       struct st7789v *ctx = panel_to_st7789v(panel);
>> @@ -346,11 +361,12 @@ static int st7789v_unprepare(struct drm_panel
>> *panel)
>>   }
>>     static const struct drm_panel_funcs st7789v_drm_funcs = {
>> -    .disable    = st7789v_disable,
>> -    .enable        = st7789v_enable,
>> -    .get_modes    = st7789v_get_modes,
>> -    .prepare    = st7789v_prepare,
>> -    .unprepare    = st7789v_unprepare,
>> +    .disable = st7789v_disable,
>> +    .enable    = st7789v_enable,
>> +    .get_modes = st7789v_get_modes,
>> +    .get_orientation = st7789v_get_orientation,
>> +    .prepare = st7789v_prepare,
>> +    .unprepare = st7789v_unprepare,
> 
> Changing the indentation of the whole block is a spurious change,
> either change it in a separate patch or use the current indentation
> style...

OK, if we agree that the indentation should be changed I'll be happy to
move the change to an extra patch.

>>   };
>>     static int st7789v_probe(struct spi_device *spi)
>> @@ -382,6 +398,8 @@ static int st7789v_probe(struct spi_device *spi)
>>       if (ret)
>>           return ret;
>>   +    of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
>> +
>>       drm_panel_add(&ctx->panel);
>>         return 0;
>>
> 
> With this changed:
> 
> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks!

Best regards,
Michael

> 
> Thanks,
> Neil
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] drm/panel: sitronix-st7789v: add panel orientation support
  2023-08-02 13:19     ` Michael Riesch
@ 2023-08-02 13:26       ` neil.armstrong
  0 siblings, 0 replies; 8+ messages in thread
From: neil.armstrong @ 2023-08-02 13:26 UTC (permalink / raw)
  To: Michael Riesch, Sam Ravnborg, David Airlie, Daniel Vetter,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Ripard,
	Miquel Raynal, Sebastian Reichel, Gerald Loacker
  Cc: devicetree, linux-kernel, dri-devel

On 02/08/2023 15:19, Michael Riesch wrote:
> Hi Neil,
> 
> On 8/2/23 14:39, Neil Armstrong wrote:
>> On 18/07/2023 17:12, Michael Riesch wrote:
>>> Determine the orientation of the display based on the device tree and
>>> propagate it.
>>>
>>> While at it, fix the indentation in the struct drm_panel_funcs.
>>>
>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>>> ---
>>>    drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 28
>>> +++++++++++++++++++++-----
>>>    1 file changed, 23 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>>> b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>>> index bbc4569cbcdc..6575f07d49e3 100644
>>> --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>>> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c
>>> @@ -116,6 +116,7 @@ struct st7789v {
>>>        struct spi_device *spi;
>>>        struct gpio_desc *reset;
>>>        struct regulator *power;
>>> +    enum drm_panel_orientation orientation;
>>>    };
>>>      enum st7789v_prefix {
>>> @@ -170,6 +171,7 @@ static const struct drm_display_mode default_mode = {
>>>    static int st7789v_get_modes(struct drm_panel *panel,
>>>                     struct drm_connector *connector)
>>>    {
>>> +    struct st7789v *ctx = panel_to_st7789v(panel);
>>>        struct drm_display_mode *mode;
>>>          mode = drm_mode_duplicate(connector->dev, &default_mode);
>>> @@ -188,9 +190,22 @@ static int st7789v_get_modes(struct drm_panel
>>> *panel,
>>>        connector->display_info.width_mm = 61;
>>>        connector->display_info.height_mm = 103;
>>>    +    /*
>>> +     * TODO: Remove once all drm drivers call
>>> +     * drm_connector_set_orientation_from_panel()
>>> +     */
>>> +    drm_connector_set_panel_orientation(connector, ctx->orientation);
>>> +
>>>        return 1;
>>>    }
>>>    +static enum drm_panel_orientation st7789v_get_orientation(struct
>>> drm_panel *p)
>>> +{
>>> +    struct st7789v *ctx = panel_to_st7789v(p);
>>> +
>>> +    return ctx->orientation;
>>> +}
>>> +
>>>    static int st7789v_prepare(struct drm_panel *panel)
>>>    {
>>>        struct st7789v *ctx = panel_to_st7789v(panel);
>>> @@ -346,11 +361,12 @@ static int st7789v_unprepare(struct drm_panel
>>> *panel)
>>>    }
>>>      static const struct drm_panel_funcs st7789v_drm_funcs = {
>>> -    .disable    = st7789v_disable,
>>> -    .enable        = st7789v_enable,
>>> -    .get_modes    = st7789v_get_modes,
>>> -    .prepare    = st7789v_prepare,
>>> -    .unprepare    = st7789v_unprepare,
>>> +    .disable = st7789v_disable,
>>> +    .enable    = st7789v_enable,
>>> +    .get_modes = st7789v_get_modes,
>>> +    .get_orientation = st7789v_get_orientation,
>>> +    .prepare = st7789v_prepare,
>>> +    .unprepare = st7789v_unprepare,
>>
>> Changing the indentation of the whole block is a spurious change,
>> either change it in a separate patch or use the current indentation
>> style...
> 
> OK, if we agree that the indentation should be changed I'll be happy to
> move the change to an extra patch.

Sure,

Neil

> 
>>>    };
>>>      static int st7789v_probe(struct spi_device *spi)
>>> @@ -382,6 +398,8 @@ static int st7789v_probe(struct spi_device *spi)
>>>        if (ret)
>>>            return ret;
>>>    +    of_drm_get_panel_orientation(spi->dev.of_node, &ctx->orientation);
>>> +
>>>        drm_panel_add(&ctx->panel);
>>>          return 0;
>>>
>>
>> With this changed:
>>
>> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> 
> Thanks!
> 
> Best regards,
> Michael
> 
>>
>> Thanks,
>> Neil
>>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-02 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-18 15:12 [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch
2023-07-18 15:12 ` [PATCH 1/2] " Michael Riesch
2023-08-02 12:39   ` Neil Armstrong
2023-08-02 13:19     ` Michael Riesch
2023-08-02 13:26       ` neil.armstrong
2023-07-18 15:12 ` [PATCH 2/2] dt-bindings: display: add rotation property to sitronix,st7789v Michael Riesch
2023-07-18 15:52   ` Conor Dooley
2023-08-02 12:23 ` [PATCH 0/2] drm/panel: sitronix-st7789v: add panel orientation support Michael Riesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).