Skip to content

Commit dda604c

Browse files
Snevzornashif
authored andcommitted
drivers: display: ssd16xx: performance improvement
The driver writes the scan entry mode to the display controller on each set_window call. Multiple calls to set_window can be needed to update a single frame buffer in the controller. There's a performance improvement by only setting the scan mode when the orientation is changed (set_orientation, see previous commit) and when the profile has changed. For the latter the scan_mode is lost on the controller due to a software reset. Signed-off-by: Sven Depoorter <[email protected]>
1 parent e01f422 commit dda604c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/display/ssd16xx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,6 @@ static int ssd16xx_set_window(const struct device *dev,
453453
return -EINVAL;
454454
}
455455

456-
err = ssd16xx_write_cmd(dev, SSD16XX_CMD_ENTRY_MODE,
457-
&data->scan_mode, sizeof(data->scan_mode));
458-
if (err < 0) {
459-
return err;
460-
}
461-
462456
err = ssd16xx_set_ram_param(dev, x_start, x_end, y_start, y_end);
463457
if (err < 0) {
464458
return err;
@@ -895,6 +889,11 @@ static int ssd16xx_set_profile(const struct device *dev,
895889
}
896890
}
897891

892+
err = ssd16xx_write_uint8(dev, SSD16XX_CMD_ENTRY_MODE, data->scan_mode);
893+
if (err < 0) {
894+
return err;
895+
}
896+
898897
data->profile = type;
899898

900899
return 0;

0 commit comments

Comments
 (0)