Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Unified Diff: target/dartuinoP0/display/LS013B7DH06.c

Issue 1755273004: [display] Add DISPLAY_FORMAT_RGB_x111 (Closed) Base URL: https://github.com/littlekernel/lk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/dev/display.h ('k') | target/dartuinoP0/include/target/display/LS013B7DH06.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: target/dartuinoP0/display/LS013B7DH06.c
diff --git a/target/dartuinoP0/display/LS013B7DH06.c b/target/dartuinoP0/display/LS013B7DH06.c
index 5a3965ce9487f2f222e2e4c4806f060a2295d77c..21730324eda34d5bbeeb4b1ece7c31604a63b08a 100644
--- a/target/dartuinoP0/display/LS013B7DH06.c
+++ b/target/dartuinoP0/display/LS013B7DH06.c
@@ -33,6 +33,7 @@ uint8_t lcd_get_line(uint8_t *framebuffer, uint8_t idx, uint8_t *result)
memset(result, 0, MLCD_BYTES_LINE);
+#if FB_FORMAT == DISPLAY_FORMAT_RGB_332
for (int i = 0; i < MLCD_WIDTH; ++i) {
uint8_t inpix = framebuffer[i];
@@ -47,7 +48,39 @@ uint8_t lcd_get_line(uint8_t *framebuffer, uint8_t idx, uint8_t *result)
if (inpix & 0x02) {
SET_BIT(result, j + 2);
}
+ }
+#elif FB_FORMAT == DISPLAY_FORMAT_RGB_x111
+ for (int i = 0; i < FB_STRIDE; ++i) {
+ uint8_t val = framebuffer[i];
+ uint8_t inpix;
+
+ int j = i * 6;
+ inpix = val & 0xf;
+ if (inpix & 0x4) {
+ SET_BIT(result, j);
+ }
+ if (inpix & 0x2) {
+ SET_BIT(result, j + 1);
+ }
+ if (inpix & 0x1) {
+ SET_BIT(result, j + 2);
+ }
+
+ inpix = val >> 4;
+ if (inpix & 0x4) {
+ SET_BIT(result, j + 3);
+ }
+ if (inpix & 0x2) {
+ SET_BIT(result, j + 4);
+ }
+ if (inpix & 0x1) {
+ SET_BIT(result, j + 5);
+ }
}
+#else
+ #error Unhandled FB_FORMAT
+#endif
+
return MLCD_BYTES_LINE;
-}
+}
« no previous file with comments | « include/dev/display.h ('k') | target/dartuinoP0/include/target/display/LS013B7DH06.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698