WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: GMA500 driver.  (Read 6371 times)

Offline JohnS

  • Newbie
  • *
  • Posts: 6
GMA500 driver.
« on: February 16, 2011, 10:38:30 AM »
Hi all.. I've been trying to get the GMA500 Xorg driver working under TC for a couple days now.. I've had some pretty good success at getting everything recompiled and loading.

Yes. I have the psb xorg driver loading and mostly working in TC.. Using kernel 2.6.33.3-tinycore and Xorg 7.5

I still have one issue (hopefully only one) remaining, and would like some ideas...

First: How I got the driver to work. This is a 'high level summary', not details. Hopefully will be enough for someone to duplicate my results. (mostly cause this was done over 2 days of hacking and I can't remember everything)

First, I downloaded the various RPM's from rpmfusion:
(hand typed, actual files may differ)
libdrm-poulsbo-2.3.0-12.fc14.src.rpm
psb-firmware-0.30-4.fc14.noarch.rpm
psb-kmod-4.41.1-14.fc14.2.src.rpm
xorg-x11-drv-psb-0.32.0-6.fc14.src.rpm
xpsb-glx-0.18-6.fc14.src.rpm

Then I started a VM with a base image of TC, installed the compiling package, linux-headers, Xorg-dev, and rpm

For each of those packages, I made a directory, cd into it, and then rpm -i the rpm I was working on.. I then analyzed the .spec file to see how they built the files, and duplicated that as best I could.

I first attacked psb-kmod, the kernel modules. I untarred the tarball, applied the patches and ran make. Pretty smooth. This generates two modules, drm-psb and psb.. You should be able to modprobe these.

Then onto libdrm-poulsbo.. Apply the patches, ./configure, make, make install. WHen I configured, I specificied a prefix to my own area, so I could build an extension out of it. (I used ~/INSTALL_BASE/usr).. This will create a INSTALL_BASE/lib/libdrm.so (more on that later).

Next is the pain in the ass. xorg-x11-drv-psb..  First, in the spec file, it mentions that you need to make sure yuo have CFLAG="-fvisibility=default". You *must* have this set in your env. Then run configure --disable static. I also had to set DRI_CFLAGS for some addition flags:  DRI_CFLAGS="-I/home/tc/INSTALL_BASE/usr/include -I/home/tc/INSTALL_BASE/usr/include/drm -I/usr/local/include/X11/dri" .. The fun part: applying the patches. Only some of them are valid. Pretty much, apply all the patches, but the 0.32 ones... It should build at that point..


The other two rpms xpsb-glx and psb-firmware contain binary files, and no source. Extract the files, and put them in the approriate places in the INSTALL_BASE area.

Note: Many of the files seem to want to go to INSTALL_BASE//usr/lib/xorg/, where as you need INSTALL_BASE/usr/local/lib/X11 for TC.

In the 'startup script' in the tce.installed, I do a modprobe of the kernel drivers, and do some re-arranging of the libdrm files... TC uses libdrm-2.4.0, where as we need libdrm-2.3.0 (the one we compiled above). So I swap the symlinks around to point to ours (note: I believe this is source of my final issue).

Here's my current (mostly working!) directory structure for INSTALL_BASE:

INSTALL_BASE/lib/firmware/msvdx_fw.bin
INSTALL_BASE/lib/modules/2.6.33.3-tinycore/kernel/psb.ko
INSTALL_BASE/lib/modules/2.6.33.3-tinycore/kernel/drm-psb.ko
INSTALL_BASE/usr/lib/libmm.so
INSTALL_BASE/usr/lib/libmm.la
INSTALL_BASE/usr/local/tce.installed/psb-drivers
INSTALL_BASE/usr/local/lib/X11/modules/dri/psb_dri.so
INSTALL_BASE/usr/local/lib/X11/modules/drivers/psb_drv.so
INSTALL_BASE/usr/local/lib/X11/modules/drivers/psb_drv.la
INSTALL_BASE/usr/local/lib/X11/modules/drivers/Xpsb.so
INSTALL_BASE/usr/local/lib/X11/modules/drivers/Xpsb.la
INSTALL_BASE/usr/local/lib/va/drivers/psb_drv_video.so
INSTALL_BASE/usr/local/lib/pkgconfig/libdrm.pc
INSTALL_BASE/usr/local/lib/libdrm.so.2.3.0
INSTALL_BASE/usr/local/lib/libdrm.la
INSTALL_BASE/usr/include/drm/psb_schedule.h
INSTALL_BASE/usr/include/drm/psb_reg.h
INSTALL_BASE/usr/include/drm/psb_drm.h
INSTALL_BASE/usr/include/drm/psb_drv.h
INSTALL_BASE/usr/include/drm/via_3d_reg.h
INSTALL_BASE/usr/include/drm/r300_reg.h
INSTALL_BASE/usr/include/drm/via_drm.h
INSTALL_BASE/usr/include/drm/sis_drm.h
INSTALL_BASE/usr/include/drm/savage_drm.h
INSTALL_BASE/usr/include/drm/radeon_drm.h
INSTALL_BASE/usr/include/drm/r128_drm.h
INSTALL_BASE/usr/include/drm/nouveau_drm.h
INSTALL_BASE/usr/include/drm/mga_drm.h
INSTALL_BASE/usr/include/drm/mach64_drm.h
INSTALL_BASE/usr/include/drm/i915_drm.h
INSTALL_BASE/usr/include/drm/drm_sarea.h
INSTALL_BASE/usr/include/drm/drm.h
INSTALL_BASE/usr/include/xf86mm.h
INSTALL_BASE/usr/include/xf86drm.h

I then make  an extension out of it and toss into my /tce dir (and add to onboot.lst)

I start TC with a base xorg install, using the vesa driver.. I kill X (cntrl-alt-bkspc), and create a xorg.conf from xorg.conf.vesa, and change the driver to psd (from vesa).

I then have a script that starts X:

x&
aterm

In the atrem I start flwm_topside. I can't seem to start it  in the script for some reason. Maybe it starts too quickly before X is loaded. Whatever.

I am not able to use startx, it crashes/locks up.

Its not completely smooth, but it works. Looking at the X.log.0 file, I see that the various pieces of PSB loaded, and I get the 3D acceleration is enabled message (and Xv for those interested)

But... When I run glxinfo, I get "software rendering". (glxgears gives me 60fps, the original vesa driver gave me 30fps). When i run: LIBGL_DEBUG=1 glxinfo, I see an error that psb_dri.so couldnt find _glapi_set_warning_func. This is my problem.

Note on debugging this: I got quite a few HARD lockups when starting X. The screen would go blank, and nothing. ctrl-alt-del did nothing, ctrl-alt-bck did nothing, and even hitting capslock wouldn't toggle the light on the keyboard... In order to figure out what was happening there, I used the (reallly old) alt-sysrq trick.. First, I would run X and redirect to a file (on the HD):

X &> /mnt/sda1/X.log

When it would lock up, I would wait a minute or 2, then hit: alt-sysrq-s (sync all filesystems), then alt-sysrq-b (reboot).. I was then able to get partial logs, telling me that the psb driver couldn't load cause of amissing file or symbol (in this case, I would make sure I applied the patches)..

Sorry for the long winded spewing of thought, but I figured there's others out there who would like the GMA500 working on TC.. I know i'm really close, since i get all the right messages in the X log, just need to figure out why glxinfo isn't happy.

Anyways.. I hope this gets someone started in a direction to possibly help me out in getting this to work..

Offline JohnS

  • Newbie
  • *
  • Posts: 6
Re: GMA500 driver.
« Reply #1 on: February 17, 2011, 10:07:29 AM »
FYI- I did eventually get this to work!

I added 2 stub methods to libdrm, end xf86drm.c:

typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
void
_glapi_set_warning_func( _glapi_warning_func func )
{
}

void
_glapi_noop_enable_warnings( char b)
{
}

Now I have it working with glx!  Getting about 300fps in glxgears.

Unfortuately, this is still too slow for our product, so now I'm investigating the iegd drivers.

Offline wdef

  • Jr. Member
  • **
  • Posts: 59
Re: GMA500 driver.
« Reply #2 on: September 06, 2011, 08:28:13 AM »
Apologies for reactivating an old thread but I'm wondering how you went with this?  I have access to some Atom/GMA500 hardware.