diff mbox series

[3/3] drm/ssd130x: Change "solomon, page-offset" property default value

Message ID 20231116180743.2763021-3-javierm@redhat.com (mailing list archive)
State Rejected
Headers show
Series [1/3] dt-bindings: display: ssd1307fb: Change "solomon, page-offset" default value | expand

Commit Message

Javier Martinez Canillas Nov. 16, 2023, 6:07 p.m. UTC
This is used to specify the page start address offset of the display RAM.

The value is used as offset when setting the page start address with the
SSD130X_SET_PAGE_RANGE command, and the driver currently sets its value to
1 if the property is not present in the Device Tree.

But the datasheet mentions that the value on reset for the page start is a
0, so it makes more sense to also have 0 as the default value for the page
offset if the property is not present.

In fact, using a default value of 1 leads to the display not working when
the emulated fbdev is attached to the framebuffer console.

Reported-by: Sahaj Sarup <sahaj.sarup@linaro.org>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 drivers/gpu/drm/solomon/ssd130x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Ripard Nov. 17, 2023, 8:38 a.m. UTC | #1
On Thu, Nov 16, 2023 at 07:07:39PM +0100, Javier Martinez Canillas wrote:
> This is used to specify the page start address offset of the display RAM.
> 
> The value is used as offset when setting the page start address with the
> SSD130X_SET_PAGE_RANGE command, and the driver currently sets its value to
> 1 if the property is not present in the Device Tree.
> 
> But the datasheet mentions that the value on reset for the page start is a
> 0, so it makes more sense to also have 0 as the default value for the page
> offset if the property is not present.

I can see the argument, but that's a DT ABI breaking change.

> In fact, using a default value of 1 leads to the display not working when
> the emulated fbdev is attached to the framebuffer console.

Could we fix that one instead? What is the issue about, exactly

Maxime
Javier Martinez Canillas Nov. 17, 2023, 8:59 a.m. UTC | #2
Maxime Ripard <mripard@kernel.org> writes:

Hello Maxime,

> On Thu, Nov 16, 2023 at 07:07:39PM +0100, Javier Martinez Canillas wrote:
>> This is used to specify the page start address offset of the display RAM.
>> 
>> The value is used as offset when setting the page start address with the
>> SSD130X_SET_PAGE_RANGE command, and the driver currently sets its value to
>> 1 if the property is not present in the Device Tree.
>> 
>> But the datasheet mentions that the value on reset for the page start is a
>> 0, so it makes more sense to also have 0 as the default value for the page
>> offset if the property is not present.
>
> I can see the argument, but that's a DT ABI breaking change.
>

Yes, I know it's a DT ABI breaking change but what I'm trying to argue is
that the DT binding schema isn't correct to start with. Even the RPi DTBO
for this device (which I guess is used by most people with a SSD1306) has
a property to explicitly set this to 0:

  ssd1306: oled@3c{
    ...
    solomon,page-offset = <0>;
    ...
  };

https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/ssd1306-overlay.dts

>> In fact, using a default value of 1 leads to the display not working when
>> the emulated fbdev is attached to the framebuffer console.
>
> Could we fix that one instead? What is the issue about, exactly
>

This is the issue that Sahaj reported:

https://twitter.com/sahajsarup/status/1725088484736766364

I can try to figure out how to make the fbcon to work with a page-offset=1
but didn't investigate since thought that 0 is a much better default. Just
like the maximum resolution is the default if no width and height are set.

> Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index bef293922b98..8944129a8e0b 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -1453,7 +1453,7 @@  static void ssd130x_parse_properties(struct ssd130x_device *ssd130x)
 		ssd130x->height = ssd130x->device_info->default_height;
 
 	if (device_property_read_u32(dev, "solomon,page-offset", &ssd130x->page_offset))
-		ssd130x->page_offset = 1;
+		ssd130x->page_offset = 0;
 
 	if (device_property_read_u32(dev, "solomon,col-offset", &ssd130x->col_offset))
 		ssd130x->col_offset = 0;