Skip to content

Commit

Permalink
updates RGB driver
Browse files Browse the repository at this point in the history
I am making a change to the RGB driver that will hopefully give a little bit better performance.

I opted to look at the buffers as if it was a buffer full of pixel data instead of byte data. so now instead of moving one byte at a time I am moving 1 pixel at a time. I believe the way I was going about it before was negating the inline for the functions. If that was the case then it would cause a lot of additional overhead. Plus instead of copying 1 byte at a time I am now copying 1 pixel ata  time which should hopefully give a speed bump. How much I am not sure.

I also corrected the blank line that would appear in rotations other than 0 degrees. It was corrected in Python code but that is not the best place to handle it. Having to do an instance check and checking the rotation every single time the flush function was called is less than ideal. The execution time of Python code can be some 200 times slower than C code, it was best to handle the problem in C code. I was able to do it so no additional overhead was added in the process.

I am hoping the changes work and there is some performance gains seen from doing it. We will find out.
  • Loading branch information
kdschlosser committed Dec 10, 2024
1 parent d589b25 commit 256a27a
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,6 @@ def _flush_cb(self, _, area, color_p):
lv.color_format_get_size(self._color_space)
)

if isinstance(self._data_bus, lcd_bus.RGBBus) and self._rotation>0:
y2+=1

cmd = self._set_memory_location(x1, y1, x2, y2)

# we have to use the __dereference__ method because this method is
Expand Down
Loading

0 comments on commit 256a27a

Please sign in to comment.