]> git.hungrycats.org Git - linux/commitdiff
drm/ssd130x: fix column and row end address in partial updates in ssd133x
authorAmit Barzilai <amit.barzilai22@gmail.com>
Mon, 22 Jun 2026 12:26:04 +0000 (15:26 +0300)
committerJavier Martinez Canillas <javierm@redhat.com>
Mon, 6 Jul 2026 10:35:03 +0000 (12:35 +0200)
On partial screen updates, SSD133X controllers expect to get the
rectangle addresses as arguments of the "Set Column Address" and "Set
Row Address" commands. Each command expects the start address and end
address of the row/column in absolute format, however the end
addresses were being sent in a relative format (relative to the start
address).

The relative end addresses work only when the start address is 0. In
those situations, there is no value difference between relative and
absolute addresses.

Fixes: b4299c936d8fd ("drm/ssd130x: Add support for the SSD133x OLED controller family")
Cc: stable@vger.kernel.org
Signed-off-by: Amit Barzilai <amit.barzilai22@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patch.msgid.link/20260622122604.32500-4-amit.barzilai22@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
drivers/gpu/drm/solomon/ssd130x.c

index 753aad54332ff1e56b6efbefbe7348c47c5bcc46..4907be694aecbd89c31447f6ab75633a9ff2d0ac 100644 (file)
@@ -805,12 +805,12 @@ static int ssd133x_update_rect(struct ssd130x_device *ssd130x,
         */
 
        /* Set column start and end */
-       ret = ssd130x_write_cmd(ssd130x, 3, SSD133X_SET_COL_RANGE, x, columns - 1);
+       ret = ssd130x_write_cmd(ssd130x, 3, SSD133X_SET_COL_RANGE, x, x + columns - 1);
        if (ret < 0)
                return ret;
 
        /* Set row start and end */
-       ret = ssd130x_write_cmd(ssd130x, 3, SSD133X_SET_ROW_RANGE, y, rows - 1);
+       ret = ssd130x_write_cmd(ssd130x, 3, SSD133X_SET_ROW_RANGE, y, y + rows - 1);
        if (ret < 0)
                return ret;