07-07-2011, 12:53 PM | #1 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
directfb
i am trying to write an application for directfb but it seems unable to switch to 4 bpp mode, the mode required by the e-ink framebuffer to render properly.
it seems to be unable to use LUT4; instead insisting on LUT8. does anyone know how to either switch the framebuffer to 8 bpp or coerce directfb into a 4 bpp mode? thanks. |
07-07-2011, 03:17 PM | #2 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
It doesn't even provide a definition of LUT4, does it? So LUT8 is probably all it provides (on API side). Did you check if LUT8 works out of the box? Or maybe what IDirectFB::EnumVideoModes provides?
|
Advert | |
|
07-07-2011, 04:50 PM | #3 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
no LUT4
LUT8 doesn't work.
the framebuffer only has 4bpp, so it ends up rendering everything at 2x magnification with white stripes (from the extra bits) between the lines. i'm working on forcing A4 by mmap()ing the framebuffer to a surface but it's being....well, a computer about it. :] |
07-07-2011, 06:00 PM | #4 |
fbdev
Posts: 107
Karma: 70177
Join Date: Jul 2011
Device: kindle
|
fixed (kind of)
what i wanted most was anti-aliased fonts (they're gorgeous with this hack!).
anti-aliasing needs A8 pixel format. i created a surface: einkdsc.flags = DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT |DSDESC_PIXELFORMAT|DSDESC_PREALLOCATED; einkdsc.caps = 0; einkdsc.width = 600; einkdsc.height = 800; einkdsc.pixelformat = DSPF_A8; einkdsc.preallocated[0].data = screenbuffer; einkdsc.preallocated[0].pitch = 600; einkdsc.preallocated[1].data = screenbuffer; einkdsc.preallocated[1].pitch = 600; dfb->CreateSurface(dfb,&einkdsc,&eink); then mmap()ed the framebuffer: framebuffer = mmap(NULL,(800 * 600) / 2,PROT_READ|PROT_WRITE,MAP_SHARED,fb,0); and i blit between the two: void fbblit(char* dst,char* src) { unsigned aa; aa = 0; for(; { dst[aa] = ((src[aa * 2] & 0xf) << 4) | (src[1 + (aa * 2)] & 0xf); dst[aa] ^= 0xff; ++aa; if(((600 * 800) / 2) == aa) break; } } |
07-08-2011, 06:23 AM | #5 |
Wizard
Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Hm. I really wonder how the Amazon stack does this. I think I'll put v3 on my Kindle DX this weekend and try myself (2.x firmware doesn't seem to include a ready-built DirectFB). But please update this thread if you stumble upon more information, much appreciated.
|
Advert | |
|
12-16-2011, 09:57 PM | #6 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
It appears that my kindle 4 (no keyboard) uses 8 bpp. The Touch is probably the same.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting SDL to work on DirectFB | B_Lizzard | Kindle Developer's Corner | 13 | 10-01-2012 12:42 PM |
Cross-compilation question--building directfb | mark03 | Kindle Developer's Corner | 4 | 06-20-2011 11:59 AM |
iLiad What if iLiad adopts GTK on DirectFB? | ericshliao | iRex Developer's Corner | 1 | 01-26-2008 05:36 AM |