Skip to contentSkip to conversation

dt-bindings: display: ssd1307fb: Change "solomon,page-offset" default value

PATCH In review Javier Martinez Canillas 4 participants 9 messages Nov 16, 2023 – Nov 20, 2023

Subsystems (5)
lore
Share & tools
lore

Javier Martinez Canillas

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: display: ssd1307fb: Change "solomon,page-offset" default value

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 fbdev is attached to the framebuffer console.

---

 .../devicetree/bindings/display/solomon,ssd1307fb.yaml          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +1 -1
index 3afbb52d1b7f..badd81459aaa 100644
@@ -35,7 +35,7 @@ properties:
 
   solomon,page-offset:
     $ref: /schemas/types.yaml#/definitions/uint32
-    default: 1
+    default: 0
     description:
       Offset of pages (band of 8 pixels) that the screen is mapped to
 
Signature · 1 line
2.41.0
author maintainer
#1 lore raw

PATCH 2/3 fbdev: ssd1307fb: Change "solomon,page-offset" property default value

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 fbdev is attached to the framebuffer console.

---

 drivers/video/fbdev/ssd1307fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/ssd1307fb.c +1 -1
index 5ae48e36fccb..34f014bf4994 100644
@@ -637,7 +637,7 @@ static int ssd1307fb_probe(struct i2c_client *client)
 		par->height = 16;
 
 	if (device_property_read_u32(dev, "solomon,page-offset", &par->page_offset))
-		par->page_offset = 1;
+		par->page_offset = 0;
 
 	if (device_property_read_u32(dev, "solomon,col-offset", &par->col_offset))
 		par->col_offset = 0;
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH 2/3] fbdev: ssd1307fb: Change "solomon,page-offset" property default value

Quoted 6 lines · Javier Martinez Canillas

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.

Quoted 8 lines

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 fbdev is attached to the framebuffer console.

Closes?
Fixes?

Quoted 1 line
Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#3 lore raw

Re: [PATCH 2/3] fbdev: ssd1307fb: Change "solomon,page-offset" property default value

Andy Shevchenko <[email protected]> writes:

Hello Andy,

Quoted 11 lines · Javier Martinez Canillas
Quoted 10 lines

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.

Quoted 6 lines
Quoted 4 lines

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

Closes?

There's no report in a mailing list or bug tracker to reference.

Quoted 2 lines

Fixes?

Since the default has been the same since the driver was merged, it doesn't make that much sense for me to reference that commit.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
author maintainer
#4 lore raw

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

In reply to Javier Martinez Canillas

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.

---

 drivers/gpu/drm/solomon/ssd130x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/solomon/ssd130x.c +1 -1
index bef293922b98..8944129a8e0b 100644
@@ -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;
Signature · 1 line
2.41.0
maintainer
#5 lore raw

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

Quoted 9 lines · Javier Martinez Canillas

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.

Quoted 2 lines

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

author maintainer
#6 lore raw

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

Maxime Ripard <[email protected]> writes:

Hello Maxime,

Quoted 7 lines · Javier Martinez Canillas
Quoted 6 lines

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.

Quoted 6 lines
Quoted 3 lines

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

Quoted 5 lines
Quoted 2 lines

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.

Quoted 1 line

Maxime

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
#7 lore raw
In reply to Javier Martinez Canillas
Quoted 25 lines · Javier Martinez Canillas

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 fbdev is attached to the framebuffer console.

---

 .../devicetree/bindings/display/solomon,ssd1307fb.yaml          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +0 -0
index 3afbb52d1b7f..badd81459aaa 100644

Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml properties: · line 38

Quoted 5 lines
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +1 -1
@@ -35,7 +35,7 @@ properties:
 
   solomon,page-offset:
     $ref: /schemas/types.yaml#/definitions/uint32
-    default: 1
+    default: 0

I think I saw it pointed out by Maxime elsewhere that this breaks the ABI. It would be nice if DT defaults matched the hardware's, but I don't really think it is worth breaking the ABI here. Expanding the property description to explain the impact of the particular values might help with incorrect usage.

Thanks,
Conor.

Quoted 6 lines
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +0 -0
     description:
       Offset of pages (band of 8 pixels) that the screen is mapped to
 
Signature · 1 line
2.41.0
author maintainer
#8 lore raw

Conor Dooley <[email protected]> writes:

Hello Connor,

Quoted 27 lines · Javier Martinez Canillas
Quoted 26 lines

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 fbdev is attached to the framebuffer console.

---

 .../devicetree/bindings/display/solomon,ssd1307fb.yaml          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +0 -0
index 3afbb52d1b7f..badd81459aaa 100644
@@ -35,7 +35,7 @@ properties:
 
Quoted 8 lines

Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml properties: · line 38

Quoted 4 lines
Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +1 -1
   solomon,page-offset:
     $ref: /schemas/types.yaml#/definitions/uint32
-    default: 1
+    default: 0

I think I saw it pointed out by Maxime elsewhere that this breaks the ABI. It would be nice if DT defaults matched the hardware's, but I don't really think it is worth breaking the ABI here. Expanding the property

Yes, Maxime also agrees with you as you mentioned. It's fair to say that this may affect potential users even when I honestly think that's unlikely.

I'll just discard these patches and point out to people reporting the same problem than Sahaj, that they need to add a "solomon,page-offset" property.

Quoted 3 lines

description to explain the impact of the particular values might help with incorrect usage.

I'm unsure how much that would help to be honest but I might post a patch.

Quoted 3 lines

Thanks,
Conor.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat