insane-adding-machines / frosted

Frosted: Free POSIX OS for tiny embedded devices
GNU General Public License v2.0
215 stars 39 forks source link

LTDC: buffer allocation & blank #81

Closed sferrini closed 7 years ago

sferrini commented 7 years ago

Reading the stm32f7_ltdc driver implementation I was trying to understand the screen_buffer and how this driver in general works.

And I've noticed at this line that the buffer allocation is done calculating the size like so: fb->var.xres * fb->var.xres * (fb->var.bits_per_pixel/8). Shouldn't be calculated also involving the yres? So like fb->var.xres * fb->var.yres * (fb->var.bits_per_pixel/8)?

Also in the function ltdc_blank at this line shouldn't fb->var.bits_per_pixel be (fb->var.bits_per_pixel/8)?

Maybe I get the implementation in a wrong way, so sorry in advance if so.

@maximevince can you please have a look?

Let me know what you think, and I'll do a PR if needed.

Thanks

danielinux commented 7 years ago

@sferrini thanks for reporting. Indeed let's wait for @maximevince comment.

maximevince commented 7 years ago

@sferrini hey, thanks for reviewing our code, we like that. that is a huge typo indeed, nicely spotted! if you make another pull request, we'll integrate that.

maximevince commented 7 years ago

Both of your suggestions are correct, by the way!

The LTDC implementation right now is very basic; i just rushed into it, to get DOOM working :) So any improvements are welcome!

sferrini commented 7 years ago

@maximevince It's a pleasure! I'll do the PR in a bit 😉

brabo commented 7 years ago

:D