[okl4-developer] Is there any double buffering? S3C2410 lcd - FB
Geoffrey Lee
glee at ok-labs.com
Wed Aug 27 10:20:18 EST 2008
On Tue, Aug 26, 2008 at 05:45:34PM +0200, Dennis Gessner wrote:
> Hi,
>
Hi Dennis
> first of all, thank you Geoffrey, your hint with
> "enable_fastpaths=False" solved the "clz" problems inside traps.spp. If
> I find some time, I'll rewrite (patch) the traps.spp without all the
> clz-instructions (which are not supported inside the ARMv4 architecture
> of the S3C2410).
That's great to hear. :)
>
> Now the kernel (okl4 2.1.1 patch 9) compiles and runs again on my real
> hardware (gta01). What surprises me, it's not working inside qemu
> (segmentation fault) - maybe there is something wrong with qemu...
>
> Now my problem:
>
> I am wondering if there is anything like double buffering inside the
> lcd-output (fb) of the device. I initialize the lcd correctly, I get an
> LCD-Mode returned (480x640 at 10).. I write
> values to the fb, but the display is still black.
>
Does your code work on hardware? It is possible that the emulation
in qemu is incomplete or incorrect and may produce strange
results. A crash of qemu however definitely appears to be a qemu
bug.
-gl
> I am missing some command like "fb_refresh()" or anything that tells
> okl4 that it should repaint the framebuffer with the new values.
> Otherwise I do not understand why my display still stays black.
>
> Here is what I did:
>
> ...
> static int init_fb(struct ig_fb * fb, struct ig_lcd * lcd) {
>
> struct lcd_control_block *ctrl = lcd->control;
> fb->size = ctrl->xres * ctrl->yres * ctrl->bpp / 8;
>
> fb->ms = memsection_create_dma
> (
> fb->size,
> &fb->vbase,
> &fb->pm,
> L4_WriteThroughMemory
> );
>
> virtual_lcd_set_fb(lcd->server, lcd->obj, fb->vbase, NULL);
>
> return 0;
> }
>
> static int write_to_fb(struct ig_fb * fb, struct ig_lcd * lcd) {
>
> int x, y, i = 0;
> char r, g, b;
>
> uintptr_t fb_base;
> struct lcd_control_block *ctrl = lcd->control;
>
> uint16_t col;
>
> virtual_lcd_get_fb(lcd->server, lcd->obj, &fb_base, NULL);
> virtual_lcd_get_mode(lcd->server, lcd->obj,
> &ctrl->xres,&ctrl->yres,&ctrl->bpp, NULL);
>
> uint16_t *fbp = (uint16_t*) fb_base;
>
> printf("xx LCD Mode is %ldx%ld@%lx\n", lcd->control->xres,
> lcd->control->yres,lcd->control->bpp);
>
> printf("\nLeading 15 values of the fb: \n\n");
> for (i=0; i < 15; i++) {
> printf("%d--",fbp[i]);
> }
>
> i = 0;
>
> printf("\n...fill the fb...\n");
> for (x=0; x < ctrl->yres; x++) {
> for (y = 0; y < (ctrl->xres); y++) {
>
> r = (x<y)?0:255;
> g = (x<(ctrl->xres/2))?0:255;
> b = (y<(ctrl->yres/2))?0:255;
>
> col = (r&0x1f) |
> ((g&0x3f)<<5) |
> ((b&0x1f)<<11);
>
> /* I also tried to manually set all values to 1024 */
> // fbp[i++] = 1024;
>
> fbp[i++] = col;
> }
> }
>
> printf("\nLeading 15 values of the fb: \n\n");
> for (i=0; i < 15; i++) {
> printf("%d--",fbp[i]);
> }
> printf("\n");
>
> /* I also tried the following, but this leads to a crash of
> okl4
> */
> // fb_base = (uintptr_t) fbp;
> // virtual_lcd_set_fb(lcd->server, lcd->obj, &fb_base, NULL);
>
> return 0;
> }
>
> What am I doing wrong?
>
> Best regards,
> Dennis
>
--
More information about the Developer
mailing list