drm/panel: visionox-r66451: Fix brightness and power on
Subsystems (3)
cover drm/panel: visionox-r66451: Fix brightness and power on
Two fixes for the Visionox R66451 panel driver, found while enabling the panel on the Qualcomm SM8350-HDK display card.
The first change sends the DCS brightness value MSB first, as the panel expects. Without it, the brightness does not follow the requested value, and the default brightness is received as a different value.
The second change waits longer after the panel reset. With the current 10ms delay, the panel misses the initialization commands, does not exit sleep mode, and the display stays black.
Vladimir Zapolskiy (2):
drm/panel: visionox-r66451: Send the brightness value MSB first drm/panel: visionox-r66451: Wait longer after the panel reset
drivers/gpu/drm/panel/panel-visionox-r66451.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.51.0
PATCH 2/2 drm/panel: visionox-r66451: Wait longer after the panel reset
The initialization sequence is sent 10ms after the panel reset is deasserted, however on the SM8350-HDK display card the panel does not answer a DCS read at that time, as a result the panel initialization commands are lost, and the panel does not exit sleep mode and the display stays black. With the first command sent about 15ms after the reset the panel comes up reliably, so wait 20ms after deasserting the reset.
--- drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-visionox-r66451.c +1 -1
@@ -36,7 +36,7 @@ static void visionox_r66451_reset(struct visionox_r66451 *ctx)gpiod_set_value_cansleep (ctx->reset_gpio,1 );usleep_range (10000 ,10100 );gpiod_set_value_cansleep (ctx->reset_gpio,0 ); -usleep_range (10000 ,10100 ); +usleep_range (20000 ,21000 ); }static int visionox_r66451_on (struct visionox_r66451 *ctx)
Signature · 1 line
2.51.0
PATCH 1/2 drm/panel: visionox-r66451: Send the brightness value MSB first
In reply to Vladimir ZapolskiyThe panel expects to get two bytes of the DCS Set Display Brightness command with the most significant byte first, and it uses the lower 12 bits of the value, use mipi_dsi_dcs_set_display_brightness_large() to correct the programmed brightness values.
Tested on the SM8350-HDK display card, the display brightness increases gradually with:
for v in $(seq 16 16 4095); do sleep 0.1; \
echo $v > /sys/class/backlight/ae94000.dsi.0/brightness; \
donewhile without the change the display is dark during all writes.
--- drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-visionox-r66451.c +1 -1
@@ -227,7 +227,7 @@ static int visionox_r66451_bl_update_status(struct backlight_device *bl)struct mipi_dsi_device *dsi =bl_get_data (bl);u16 brightness =backlight_get_brightness (bl); -return mipi_dsi_dcs_set_display_brightness (dsi, brightness); +return mipi_dsi_dcs_set_display_brightness_large (dsi, brightness); }static const struct backlight_ops visionox_r66451_bl_ops = {
Signature · 1 line
2.51.0
Re: [PATCH 1/2] drm/panel: visionox-r66451: Send the brightness value MSB first
Quoted 25 lines · Vladimir Zapolskiy
The panel expects to get two bytes of the DCS Set Display Brightness command with the most significant byte first, and it uses the lower 12 bits of the value, use
mipi_dsi_dcs_set_display_brightness_large()to correct the programmed brightness values.Tested on the SM8350-HDK display card, the display brightness increases gradually with:
for v in $(seq 16 16 4095); do sleep 0.1; \ echo $v > /sys/class/backlight/ae94000.dsi.0/brightness; \ donewhile without the change the display is dark during all writes.
Fixes a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panel/panel-visionox-r66451.c +0
-0
drivers/gpu/drm/panel/panel-visionox-r66451.c static int visionox_r66451_bl_update_status(struct backlight_device *bl) · line 233
Quoted 8 lines
drivers/gpu/drm/panel/panel-visionox-r66451.c +1
-1@@ -227,7 +227,7 @@ static int visionox_r66451_bl_update_status(struct backlight_device *bl)struct mipi_dsi_device *dsi =bl_get_data (bl);u16 brightness =backlight_get_brightness (bl); -return mipi_dsi_dcs_set_display_brightness (dsi, brightness); +return mipi_dsi_dcs_set_display_brightness_large (dsi, brightness); }static const struct backlight_ops visionox_r66451_bl_ops = {
Thanks,
Neil
Re: [PATCH 2/2] drm/panel: visionox-r66451: Wait longer after the panel reset
In reply to Vladimir ZapolskiyQuoted 18 lines · Vladimir Zapolskiy
The initialization sequence is sent 10ms after the panel reset is deasserted, however on the SM8350-HDK display card the panel does not answer a DCS read at that time, as a result the panel initialization commands are lost, and the panel does not exit sleep mode and the display stays black. With the first command sent about 15ms after the reset the panel comes up reliably, so wait 20ms after deasserting the reset.
Fixes a6dfab2738fc ("drm/panel: Add driver for Visionox r66451 panel")Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/gpu/drm/panel/panel-visionox-r66451.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panel/panel-visionox-r66451.c +0
-0
drivers/gpu/drm/panel/panel-visionox-r66451.c static void visionox_r66451_reset(struct visionox_r66451 *ctx) · line 42
Quoted 8 lines
drivers/gpu/drm/panel/panel-visionox-r66451.c +1
-1@@ -36,7 +36,7 @@ static void visionox_r66451_reset(struct visionox_r66451 *ctx)gpiod_set_value_cansleep (ctx->reset_gpio,1 );usleep_range (10000 ,10100 );gpiod_set_value_cansleep (ctx->reset_gpio,0 ); -usleep_range (10000 ,10100 ); +usleep_range (20000 ,21000 ); }static int visionox_r66451_on (struct visionox_r66451 *ctx)
Thanks,
Neil
Hi,
Quoted 8 lines · Vladimir Zapolskiy
Two fixes for the Visionox R66451 panel driver, found while enabling the panel on the Qualcomm SM8350-HDK display card.
The first change sends the DCS brightness value MSB first, as the panel expects. Without it, the brightness does not follow the requested value, and the default brightness is received as a different value.
[...]
Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-fixes)
[1/2] drm/panel: visionox-r66451: Send the brightness value MSB first
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/00fe6be187ffde738fdb71ea7deb671fc939e583 [2/2] drm/panel: visionox-r66451: Wait longer after the panel reset https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/b4b2778d5e175b166e4a27e5df5d61da468ad004
Signature · 1 line
Neil