Hi, I am trying to take advantage of the graphics accelerator on some embedded linux hardware. I have sucessfully built directfb and I have written some test code which runs fine but, it only appears to be using software drawing and I am at a loss as to what I need to do to utilize the hardware acceleration. Below are some details about my setup. Any help of advice would be much appreciated.
I have included the source code for my test program below, it simply rotates a wire cube using multiple DrawLine functions , I am compiling it using the following command line: -bash-3.1$ gcc -I /usr/local/include/directfb -lm -ldirectfb directfb_test.c -o test I have included details of various outputs below in the hope they may be of use: grub menu.lst entry kernel /boot/linux-2.6.16.46 root=/dev/hdc4 i8042.direct=1 atkbd.set=3 video=savagefb:mtrr,ywrap,pmipal,vga=0x301 ide=nodma quiet console=tty7 loglevel=0 -bash-3.1# cat /proc/version Linux version 2.6.16.46 (root@sentinel) (gcc version 4.0.3) #1 PREEMPT Sat Mar 10 13:17:45 EST 2012 -bash-3.1# fbset -i mode "640x400-70" # D: 25.176 MHz, H: 31.469 kHz, V: 69.932 Hz geometry 640 400 640 4096 8 timings 39721 40 24 39 9 96 2 accel true rgba 8/0,8/0,8/0,0/0 endmode Frame buffer device information: Name : TwisterP Address : 0xe0000000 Size : 33423360 Type : PACKED PIXELS Visual : PSEUDOCOLOR XPanStep : 4 YPanStep : 1 YWrapStep : 0 LineLength : 640 MMIO Address: 0xed000000 MMIO Size : 524288 Accelerator : Unknown (138) -bash-3.1$ lspci 00:00.0 Host bridge: VIA Technologies, Inc. VT8605 [ProSavage PM133] 00:01.0 PCI bridge: VIA Technologies, Inc. VT8605 [PM133 AGP] 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 40) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 1d) 00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 40) 00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 50) 00:0e.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller 01:00.0 VGA compatible controller: S3 Inc. 86C380 [ProSavageDDR K4M266] (rev 02) -bash-3.1# ./test test application is starting ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.9 |~~~~~~~~~~~~~~~~~~~~~~~~~~ (c) 2001-2008 The world wide DirectFB Open Source Community (c) 2000-2004 Convergence (integrated media) GmbH ---------------------------------------------------------------- (*) DirectFB/Core: Single Application Core. (2015-03-23 14:57) (*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] <8388608>... (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: AT Raw Set 3 keyboard (1) 0.1 (directfb.org) (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: PC Speaker (2) 0.1 (directfb.org) (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: DELL DELL USB Keyboard (3) 0.1 (directfb.org) (*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: Keyboard 0.9 (directfb.org) (*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org) (*) DirectFB/Genefx: MMX detected and enabled (*) DirectFB/Graphics: S3 Savage4 Series 0.3 (directfb.org) (*) DirectFB/Core/WM: Default 0.3 (directfb.org) (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 0) at offset 0 and pitch 640. (*) FBDev/Mode: Setting 640x400 LUT8 (*) FBDev/Mode: Switched to 640x400 (virtual 640x800) at 8 bit (LUT8), pitch 640 (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 1) at offset 256000 and pitch 640. (*) FBDev/Mode: Setting 640x400 LUT8 (*) FBDev/Mode: Switched to 640x400 (virtual 640x400) at 8 bit (LUT8), pitch 640 (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 0) at offset 0 and pitch 640. When I run the code specifying no-software, as follows, I just get a blank screen, so I am assuming hardware acceleration is not working. -bash-3.1# ./test --dfb:no-software test application is starting ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.9 |~~~~~~~~~~~~~~~~~~~~~~~~~~ (c) 2001-2008 The world wide DirectFB Open Source Community (c) 2000-2004 Convergence (integrated media) GmbH ---------------------------------------------------------------- (*) DirectFB/Core: Single Application Core. (2015-03-23 14:57) (*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] <8388608>... (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: AT Raw Set 3 keyboard (1) 0.1 (directfb.org) (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: PC Speaker (2) 0.1 (directfb.org) (*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: DELL DELL USB Keyboard (3) 0.1 (directfb.org) (*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: Keyboard 0.9 (directfb.org) (*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>... (*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org) (*) DirectFB/Genefx: MMX detected and enabled (*) DirectFB/Graphics: S3 Savage4 Series 0.3 (directfb.org) (*) DirectFB/Core/WM: Default 0.3 (directfb.org) (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 0) at offset 0 and pitch 640. (*) FBDev/Mode: Setting 640x400 LUT8 (*) FBDev/Mode: Switched to 640x400 (virtual 640x800) at 8 bit (LUT8), pitch 640 (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 1) at offset 256000 and pitch 640. (*) FBDev/Mode: Setting 640x400 LUT8 (*) FBDev/Mode: Switched to 640x400 (virtual 640x400) at 8 bit (LUT8), pitch 640 (*) FBDev/Surface: Allocated 640x400 8 bit LUT8 buffer (index 0) at offset 0 and pitch 640 /**************************************************** * Name: directfb_test.c * Author: Tim Nicholson * Purpose: Just for test the DirectFB ****************************************************/ #include <stdio.h> #include <unistd.h> #include <directfb.h> #include <math.h> #define HEIGHT 480 #define WIDTH 640 #define WHOLE 150 #define HALF (WHOLE/2.0) #define MIDX (WIDTH/2.0) #define MIDY (HEIGHT/2.0) static struct PointF { double x; double y; } c1,c2,c3,c4,p1,p2,p3,p4,p5,p6,p7,p8,mid1,mid2; static int x = 0; void calc (void); int main (int argc, char *argv[]) { IDirectFB *dfb = NULL; IDirectFBDisplayLayer *layer = NULL; IDirectFBSurface *surface = NULL; printf ("test application is starting\n"); DirectFBInit (&argc, &argv); DirectFBCreate (&dfb); dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer); layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE); layer->GetSurface (layer, &surface); mid1.x = MIDX - HALF; mid1.y = MIDY; mid2.x = MIDX + HALF; mid2.y = MIDY; while (1) { calc(); surface->SetColor (surface, 0x00, 0x00, 0x00, 0xff); surface->FillRectangle (surface, 0, 0, WIDTH, HEIGHT); surface->SetColor (surface, 0xff, 0xff, 0xff, 0xff); surface->DrawLine (surface, p1.x, p1.y, p2.x, p2.y); surface->DrawLine (surface, p2.x, p2.y, p3.x, p3.y); surface->DrawLine (surface, p3.x, p3.y, p4.x, p4.y); surface->DrawLine (surface, p4.x, p4.y, p1.x, p1.y); surface->DrawLine (surface, p5.x, p5.y, p6.x, p6.y); surface->DrawLine (surface, p6.x, p6.y, p7.x, p7.y); surface->DrawLine (surface, p7.x, p7.y, p8.x, p8.y); surface->DrawLine (surface, p8.x, p8.y, p5.x, p5.y); surface->DrawLine (surface, p1.x, p1.y, p5.x, p5.y); surface->DrawLine (surface, p2.x, p2.y, p6.x, p6.y); surface->DrawLine (surface, p3.x, p3.y, p7.x, p7.y); surface->DrawLine (surface, p4.x, p4.y, p8.x, p8.y); dfb->WaitForSync(dfb); } surface->Release (surface); layer->Release (layer); dfb->Release (dfb); return 0; } // ********************************************************************************************* // c a l c // ********************************************************************************************* void calc (void) { int a,b,c,d; x++; a = x; b = x + 90; c = x + 180; d = x + 270; a %= 360; b %= 360; c %= 360; d %= 360; c1.x = (sin(M_PI / 180.0 * a) * WHOLE); c1.y = (cos(M_PI / 180.0 * a) * WHOLE); c2.x = (sin(M_PI / 180.0 * b) * WHOLE); c2.y = (cos(M_PI / 180.0 * b) * WHOLE); c3.x = (sin(M_PI / 180.0 * c) * WHOLE); c3.y = (cos(M_PI / 180.0 * c) * WHOLE); c4.x = (sin(M_PI / 180.0 * d) * WHOLE); c4.y = (cos(M_PI / 180.0 * d) * WHOLE); p1.x = mid1.x + c1.x; p2.x = mid1.x + c2.x; p3.x = mid1.x + c3.x; p4.x = mid1.x + c4.x; p5.x = mid2.x + c1.x; p6.x = mid2.x + c2.x; p7.x = mid2.x + c3.x; p8.x = mid2.x + c4.x; p1.y = mid1.y + c1.y; p2.y = mid1.y + c2.y; p3.y = mid1.y + c3.y; p4.y = mid1.y + c4.y; p5.y = mid2.y + c1.y; p6.y = mid2.y + c2.y; p7.y = mid2.y + c3.y; p8.y = mid2.y + c4.y; }
_______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users