Discussion:
[directfb-users] Can't get any hardware acceleration usingthesavage driver.
Tim Nicholson
2015-03-27 15:41:55 UTC
Permalink
Hi,

Ok, I can give it a go, but how would I go about doing that? Could you give me some pointers, such as were to look and how to get a log? The current build is using the following, should I enable additional options to get more information?

./configure --disable-png --disable-jpeg --disable-freetype --with-gfxdrivers=savage

Thanks for your help, I am happy to do the work, I just need to a little help about how to go about it and what to look for.

Regards
Tim
Hi,tim
I just want to say you video card is so old.
But It is support by DirectFB.
Under the directory Gfxdrivers/Savage, you can find the drivers code. You can debug and find why the video driver is not work!
Or you can send me a log and I will try to find why it's no work!
------------------ Original ------------------
Date: Fri, Mar 27, 2015 10:22 PM
Subject: Re: [directfb-users] Can't get any hardware acceleration usingthesavage driver.
Hi,
Yes that does work, I think that is the default option if you pass no parameters isn't it?
However, The program does not seem to be running with hardware acceleration. I say that because it runs the same speed when I run it with --dfb:no-hardware! It is also the same speed as if I run using the vesa frame buffer (/dev/fb1) which does not support acceleration. I really wanted to get the GPU to do the work.
Regards
hi, tim
You can juse use this command
-bash-3.1# ./test --dfb:hardware
I think it will work.
" [no-]hardware Enable/disable hardware acceleration\n"‍
option "no-software" disable software fallbacks.
This is mainly fordebugging/profiling purpose.
It will print out a warning with the operationand flags each time a fallback would occur.
And I think it is just print some information.
------------------ Original ------------------
Date: Fri, Mar 27, 2015 08:21 PM
Subject: [directfb-users] Can't get any hardware acceleration using thesavage driver.
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.
-bash-3.1$ gcc -I /usr/local/include/directfb -lm -ldirectfb directfb_test.c -o test
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
-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
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;
}
Loading...