xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Fbdev graphics broken in xen/next dom0
@ 2010-03-12 20:24 Eamon Walsh
  2010-03-12 21:42 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 11+ messages in thread
From: Eamon Walsh @ 2010-03-12 20:24 UTC (permalink / raw)
  To: Xen-devel; +Cc: George Coker

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

Hello:

I work in the same group as Dave Quigley and George Coker.  I'm working
on a graphical switcher application for Xen which uses the DirectFB
library on top of Linux VESA fbdev.  This runs in dom0 at the moment. 
I'm using the latest xen/next pvops dom0 and xen-unstable hypervisor
compiled from source, with vga=ask so I can boot dom0 in a graphical mode.

The problem I'm having is illustrated by the attached test program that
displays a green background with a white square for 10 seconds when run
as root.  It doesn't work on the xen/next / xen-unstable combo.  The
program runs and exits normally but all I see is a black screen.

The program *does* work on xen/next running on the bare metal.  It also
works using the xen-unstable hypervisor with an older dom0, the 2.6.31.4
kernel with Novell patches.  So I think the issue is in the xen/next
kernel.  I've run the test program on different machines and observed
the same behavior.

The xen-unstable / 2.6.31.4 dom0 combination works and I'm using that
for the moment but I'd like to be using pvops.  I would be happy to run
more tests / provide more data if needed.


-- 

Eamon Walsh 
National Security Agency


[-- Attachment #2: dfbtest.c --]
[-- Type: text/plain, Size: 2689 bytes --]

/* Requires the directfb-devel package, compile with
 * gcc -I/usr/include/direcfb -o dfbtest dfbtest.c -ldirectfb
 */

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>

#include <directfb.h>

#define DFBCHECK(x...) \
        {                                                                      \
           int ret = x;                                                        \
           if (ret != DFB_OK) {                                                \
              fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ );           \
              DirectFBErrorFatal( #x, ret );                                   \
           }                                                                   \
        }

int
main(int argc, char **argv)
{
    IDirectFB *dfb;
    IDirectFBDisplayLayer *dl;
    DFBWindowDescription wdesc;
    IDirectFBScreen *scr;
    IDirectFBWindow *window;
    IDirectFBSurface *surf;
    int screen_width, screen_height;

    // Create the frame buffer interface
    DFBCHECK(DirectFBInit(&argc, &argv))
    DFBCHECK(DirectFBCreate(&dfb));
    DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_EXCLUSIVE));

    // Grab the interface to the screen primary display layer
    DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &dl));
    DFBCHECK(dl->SetCooperativeLevel(dl, DLSCL_EXCLUSIVE));
    DFBCHECK(dfb->GetScreen(dfb, 0, &scr));
    DFBCHECK(scr->GetSize(scr, &screen_width, &screen_height));
    DFBCHECK(dl->SetBackgroundColor(dl, 0, 0xff, 0, 0xff));
    DFBCHECK(dl->SetBackgroundMode(dl, DLBM_COLOR));

    /* Create a window */
    memset(&wdesc, 0, sizeof(wdesc));
    wdesc.flags = DWDESC_CAPS | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY | DWDESC_PIXELFORMAT | DWDESC_SURFACE_CAPS | DWDESC_OPTIONS | DWDESC_STACKING;
    wdesc.caps = DWCAPS_DOUBLEBUFFER | DWCAPS_NODECORATION | DWCAPS_NOFOCUS;
    wdesc.width = 100;
    wdesc.height = 100;
    wdesc.posx = screen_width / 2 - 50;
    wdesc.posy = screen_height / 2 - 50;
    wdesc.surface_caps = DSCAPS_FLIPPING;
    wdesc.pixelformat = DSPF_RGB32;
    wdesc.options = DWOP_SCALE | DWOP_INDESTRUCTIBLE | DWOP_GHOST;
    wdesc.stacking = DWSC_UPPER;
    DFBCHECK(dl->CreateWindow(dl, &wdesc, &window))

    window->SetOpacity(window, 0xff);
    window->GetSurface(window, &surf);
    surf->Clear(surf, 0xff, 0xff, 0xff, 0xff);
    surf->Flip(surf, NULL, DSFLIP_ONSYNC);
    window->SetOpacity(window, 0xff);

    sleep(10);

    surf->Release(surf);
    window->Destroy(window);
    window->Release(window);
    dl->Release(dl);
    dfb->Release (dfb);

    return 0;
}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-03-28  9:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 20:24 Fbdev graphics broken in xen/next dom0 Eamon Walsh
2010-03-12 21:42 ` Jeremy Fitzhardinge
2010-03-13  0:44   ` Eamon Walsh
2010-03-13  0:51     ` Jeremy Fitzhardinge
2010-03-16  0:46       ` Konrad Rzeszutek Wilk
2010-03-16 21:52         ` Eamon Walsh
2010-03-16 22:19           ` Konrad Rzeszutek Wilk
2010-03-25 23:55             ` Eamon Walsh
2010-03-27  9:14               ` Arvind R
2010-03-27 21:52                 ` Jeremy Fitzhardinge
2010-03-28  9:33                   ` Arvind R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).