almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
108 stars 46 forks source link

Fix size and orientation issues #9

Closed brianmay closed 2 years ago

brianmay commented 2 years ago

Fixes #7 Fixes #8

almindor commented 2 years ago

Sorry about the delay, I need to get my setup in working order again after losing an mcu to a short. I should be able to test these in a week or so.

brianmay commented 2 years ago

Updated to remove merge conflicts. Change to clear no longer as invasive. Will update again once #14 is merged.

brianmay commented 2 years ago

Rebased to latest master.

almindor commented 2 years ago

@brianmay what is instead of having "two world" (model vs display/lib) we unify the framebuffer_size in the model by either enforcing the orientation knowledge in the model, or by making it into fn frabebuffer_size(&self, orientation: Orientation) (provided Orientation has all the required info as I'd like).

This way we can keep a single source of size info. Same can be done for display_size then.

brianmay commented 2 years ago

@brianmay what is instead of having "two world" (model vs display/lib) we unify the framebuffer_size in the model by either enforcing the orientation knowledge in the model, or by making it into fn frabebuffer_size(&self, orientation: Orientation) (provided Orientation has all the required info as I'd like).

This way we can keep a single source of size info. Same can be done for display_size then.

I would be happy with both of these approaches. At present the model has no state information, the display is the authoritative source for all information. We probably should keep this unless we have a good reason to change it (e.g. if RGB/BGR config requires it). If so, then the later option would suffice. Also note that we only need to know the Portrait/Landscape stuff, we don't need to know bout the invert stuff here.