You are viewing jglisse

Previous Entry | Next Entry

Road to upstream

I have been working on porting radeon kernel modesetting to new ttm developed at VMware by Thomas Hellstrom. Just to avoid confusion ttm is used inside the driver the API we expose to userspace is the GEM api. I cleaned up the radeon code along the way and i feel it's now ready for wider range of tester ! Few words on the code itself, there is now a split between old drm path and new kernel modesetting path, i did so in order to avoid breaking old path while also being able to have a clean design & code for new kernel modesetting path. I am quite happy with how the code looks now, of course i am not the only one guilty about all this work Dave Airlie and Alex Deucher did lot of the original modesetting work, Dave also worked hard in last few month on mesa radeon rewrite which has root into Nicolai Haehnle initial work. Big kudos to Maciej Cencora (aka Osiris) for all improvement he done on the code. So here is a screenshot of what you can get with kernel modesetting, a decent ddx and proper mesa (radeon-rewrite branch) :

radeon newttm screenshot

So if you feel adventurous here are things you need:

Kernel:
git clone git://people.freedesktop.org/~glisse/drm-next
cd drm-next
git branch drm-next-radeon origin/drm-next-radeon
git checkout drm-next-radeon
Then usual kernel configuration just enable fbcon,ttm and radeon kernel modesetting.

git clone git://anongit.freedesktop.org/git/mesa/drm
cd drm
git branch modesetting-gem origin/modesetting-gem
git checkout modesetting-gem
./autogen.sh --prefix=/usr --libdir=/usr/lib64
(libdir is only needed if on x86-64)
make
sudo make install

git clone git://people.freedesktop.org/~glisse/xf86-video-ati
cd xf86-video-ati
git branch radeon-gem-cs3 origin/radeon-gem-cs3
git checkout radeon-gem-cs3
./autogen.sh --prefix=/usr --libdir=/usr/lib64
(libdir is only needed if on x86-64)
You also need the Xorg dev package from you distribution sudo yum-builddep xorg-x11-drv-ati.x86_64 (on fedora)
make
sudo make install

git clone git://anongit.freedesktop.org/git/mesa/mesa
cd mesa
git branch radeon-rewrite origin/radeon-rewrite
git checkout radeon-rewrite
./autogen.sh --prefix=/usr --libdir=/usr/lib64 --with-dri-drivers=radeon,r200,r300
(libdir is only needed if on x86-64)
make
sudo make install

Now once you reboot under new kernel you need to load radeon module with modeset=1, then your userspace should be all set, i know this needs many things to build but hopefully soon we could start merging little by little thing upstream and so it should end up in your distro. Anyway if you own an x200 (igp) or x1250/x1200 with intel CPU i would love to know if you got any issues with this code. Early tester are always appreciated and i would like to thanks spstarr, dilex, osiris, ... for their early testing and reporting on this code.

Forget to mention that suspend/resume should work flawlessly even if you are in a middle of quake3 game while spinning compiz cube (don't think it's a normal use case but you never know).

Of course performance are not yet what it used to be, but here is my todo list which should also bring us back somewhere near old performance and maybe even outperform old path :
-erase memory on bo allocation (security needed before upstreaming)
-more check on command stream (security needed before upstreaming)
-port & cleanup Dave's page allocator to avoid heavy cache flushing (performances)
-buffer swapping (performances)
-buffer tiling (performances)

Comments

( 43 comments — Leave a comment )
FireBurn [myopenid.com]
Apr. 30th, 2009 07:15 pm (UTC)
Problems with RS690
Hi

X doesn't start and I get the following messages in my xorg.conf

Too big adjustment 32
[drm:radeon_cp_init_kms] *ERROR* invalid ioctl with kms radeon_cp_init_kms
[drm:radeon_cp_init_kms] *ERROR* invalid ioctl with kms radeon_cp_init_kms
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
Too big adjustment 32
hda-intel: Invalid position buffer, using LPIB read method instead.
hda-intel: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.
[drm:radeon_cp_init_kms] *ERROR* invalid ioctl with kms radeon_cp_init_kms
[drm:radeon_cp_init_kms] *ERROR* invalid ioctl with kms radeon_cp_init_kms

X boots up with with a vanilla 2.6.29 kernel but not with the drm-2.6 rawhide kernel branch

It does however work if I pass the boot parm radeon.modeset=0

Let me know if you'd like any more info / logs

Cheers

Mike
jglisse
Apr. 30th, 2009 10:39 pm (UTC)
Re: Problems with RS690
You didn't properly install the ddx or didn't compiled the right branch of the ddx or the right branch of libdrm (hard to say which one is not properly installed here).
FireBurn [myopenid.com]
May. 1st, 2009 10:49 am (UTC)
Re: Problems with RS690
I used the standard live ebuilds but changed where default branches and added the new location for the ati driver

This is how I normally change between branches

I'll retry compiling everything tonight
swulf
May. 7th, 2009 08:21 pm (UTC)
Re: Problems with RS690
I think the problem is that the xserver you use is to new. In xserver 1.6.1 the DRI2 protocol was changed to 1.1. The following patch fix this problem

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index eb15ff2..21c62c0 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -36,15 +36,19 @@

#include "radeon.h"
#include "radeon_dri2.h"
+#include "radeon_bufmgr_gem.h"
#include "radeon_version.h"

#ifdef DRI2
+#if DRI2INFOREC_VERSION >= 1
+#define USE_DRI2_1_1_0
+#endif

struct dri2_buffer_priv {
PixmapPtr pixmap;
};

-
+#ifndef USE_DRI2_1_1_0
static DRI2BufferPtr
radeon_dri2_create_buffers(DrawablePtr drawable,
unsigned int *attachments,
@@ -108,7 +112,72 @@ radeon_dri2_create_buffers(DrawablePtr drawable,
}
return buffers;
}
+#else
+static DRI2BufferPtr
+radeon_dri2_create_buffer(DrawablePtr drawable,
+ unsigned int attachments,
+ unsigned int format)
+{
+ ScreenPtr pScreen = drawable->pScreen;
+ DRI2BufferPtr buffers;
+ struct dri2_buffer_priv *privates;
+ PixmapPtr pixmap, depth_pixmap;
+ struct radeon_exa_pixmap_priv *driver_priv;
+ int r;
+
+ buffers = xcalloc(1, sizeof *buffers);
+ if (buffers == NULL) {
+ return NULL;
+ }
+ privates = xcalloc(1, sizeof(struct dri2_buffer_priv));
+ if (privates == NULL) {
+ xfree(buffers);
+ return NULL;
+ }

+ depth_pixmap = NULL;
+
+ if (attachments == DRI2BufferFrontLeft) {
+ if (drawable->type == DRAWABLE_PIXMAP) {
+ pixmap = (PixmapPtr)drawable;
+ } else {
+ pixmap = (*pScreen->GetWindowPixmap)((WindowPtr)drawable);
+ }
+ pixmap->refcnt++;
+ } else if (attachments == DRI2BufferStencil && depth_pixmap) {
+ pixmap = depth_pixmap;
+ pixmap->refcnt++;
+ } else {
+ pixmap = (*pScreen->CreatePixmap)(pScreen,
+ drawable->width,
+ drawable->height,
+ drawable->depth,
+ 0);
+ }
+
+ if (attachments == DRI2BufferDepth) {
+ depth_pixmap = pixmap;
+ }
+ driver_priv = exaGetPixmapDriverPrivate(pixmap);
+ r = radeon_bo_gem_name_buffer(driver_priv->bo, &buffers->name);
+ if (r) {
+ /* FIXME: cleanup */
+ fprintf(stderr, "flink error: %d %s\n", r, strerror(r));
+ xfree(buffers);
+ xfree(privates);
+ return NULL;
+ }
+ buffers->attachment = attachments;
+ buffers->pitch = pixmap->devKind;
+ buffers->cpp = pixmap->drawable.bitsPerPixel / 8;
+ buffers->driverPrivate = privates;
+ buffers->flags = 0; /* not tiled */
+ privates->pixmap = pixmap;
+
+ return buffers;
+}
+#endif
+#ifndef USE_DRI2_1_1_0
static void
radeon_dri2_destroy_buffers(DrawablePtr drawable,
DRI2BufferPtr buffers,
@@ -127,7 +196,24 @@ radeon_dri2_destroy_buffers(DrawablePtr drawable,
xfree(buffers);
}
}
+#else
+static void
+radeon_dri2_destroy_buffer(DrawablePtr drawable,
+ DRI2BufferPtr buffers)
+{
+ if(buffers)
+ {
+ ScreenPtr pScreen = drawable->pScreen;
+ struct dri2_buffer_priv *private;

+ private = buffers->driverPrivate;
+ (*pScreen->DestroyPixmap)(private->pixmap);
+
+ xfree(buffers->driverPrivate);
+ xfree(buffers);
+ }
+}
+#endif
static void
radeon_dri2_copy_region(DrawablePtr drawable,
RegionPtr region,
@@ -207,9 +293,17 @@ radeon_dri2_screen_init(ScreenPtr pScreen)
}
dri2_info.fd = info->dri2.drm_fd;
dri2_info.deviceName = info->dri2.device_name;
+
+#ifndef USE_DRI2_1_1_0
dri2_info.version = 1;
dri2_info.CreateBuffers = radeon_dri2_create_buffers;
dri2_info.DestroyBuffers = radeon_dri2_destroy_buffers;
+#else
+ dri2_info.version=2;
+ dri2_info.CreateBuffer = radeon_dri2_create_buffer;
+ dri2_info.DestroyBuffer = radeon_dri2_destroy_buffer;
+#endif
+
dri2_info.CopyRegion = radeon_dri2_copy_region;
info->dri2.enabled = DRI2ScreenInit(pScreen, &dri2_info);
return info->dri2.enabled;
FireBurn [myopenid.com]
May. 8th, 2009 06:13 am (UTC)
Re: Problems with RS690
That seems to have done the trick

Is there any chance this could be committed to tree?

The X server now starts (I'm ssh'd into my box). I'll have to wait until next week to see what it looks like

Cheers for this

Mike
nikespawn
May. 1st, 2009 12:35 am (UTC)
segfault
[drm] Initialized drm 1.1.0 20060810
[drm] radeon kernel modesetting enabled.
ACPI: PCI Interrupt Link [APC5] enabled at IRQ 16
radeon 0000:01:00.0: PCI INT A -> Link[APC5] -> GSI 16 (level, low) -> IRQ 16
[drm] radeon: Initializing kernel modesetting.
[drm] register mmio base: 0xD1000000
[drm] register mmio size: 65536
ATOM BIOS: RADEON
[drm] GPU reset succeed (RBBM_STATUS=0x10000140)
[drm] Detected VRAM RAM=512M, BAR=256M
[drm] RAM width 256bits DDR
agpgart-amd64 0000:00:00.0: AGP 3.0 bridge
agpgart-amd64 0000:00:00.0: putting AGP V3 device into 4x mode
radeon 0000:01:00.0: putting AGP V3 device into 4x mode
[drm] Limit VRAM to 256M
radeon: VRAM 256M
radeon: VRAM from 0x00000000 to 0x0FFFFFFF
[drm] radeon: GTT 512M
[drm] radeon: GTT from 0x20000000 to 0x3FFFFFFF
[drm] GART: num cpu pages 0, num gpu pages 0
[drm] Clocks initialized !
[drm] radeon: irq initialized.
TTM available graphics memory: 1005 MiB
TTM available object memory: 1005 MiB
[drm] radeon: 256M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] radeon: 3 pipes initialized.
[drm:radeon_invalid_rreg] *ERROR* Invalid callback to read register 0x0010
------------[ cut here ]------------
Kernel BUG at ffffffffa00bce2b [verbose debug info unavailable]
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/class/drm/version
CPU 1
Modules linked in: radeon(+) ttm drm unionfs squashfs fuse usbhid ohci_hcd ehci_hcd amd64_agp usbcore agpgart
Pid: 4251, comm: modprobe Not tainted 2.6.29 #1
RIP: 0010:[] [] 0xffffffffa00bce2b
RSP: 0018:ffff880078c89c88 EFLAGS: 00010292
RAX: 000000000000004e RBX: ffff88007ce88000 RCX: 0000000000003fff
RDX: ffff880001029000 RSI: 0000000000000046 RDI: ffffffff806961d4
RBP: 0000000000000000 R08: 0000000000007cd6 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88007f01c800
a R13: 0000000000000019 R14: ffffffffa011f140 R15: ffff88007f945370
FS: 00007fff14c00730(0000) GS:ffff880001029000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000067d078 CR3: 0000000078cad000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 4251, threadinfo ffff880078c88000, task ffff88007c7f9cc0)
Stack:
0000000000000000 ffffffffa00db89f ffff88007ce88000 ffffffffa00de436
ffff88007ce88000 ffffffffa00bd6ad ffff88007f945000 ffff88007f945000
ffff88007ce88000 0000000000400019 ffffffffa011d200 ffffffffa00be0be
Call Trace:
[] ? 0xffffffffa00db89f
[] ? 0xffffffffa00de436
[] ? 0xffffffffa00bd6ad
[] ? 0xffffffffa00be0be
[] ? 0xffffffffa0081f6b
[] ? 0xffffffff803a9032
[] ? 0xffffffff803a98e4
[] ? 0xffffffff80426b3a
[] ? 0xffffffff80426c50
[] ? 0xffffffff80252fcd
[] ? 0xffffffff80426de3
[] ? 0xffffffff80426d50
[] ? 0xffffffff8042644b
[] ? 0xffffffff80425c22
[] ? 0xffffffffa0128000
[] ? 0xffffffffa0128000
[] ? 0xffffffff804270ae
[] ? 0xffffffffa0128000
[] ? 0xffffffff803a9b8c
[] ? 0xffffffff8020904b
[] ? 0xffffffff8025fa5f
[] ? 0xffffffff8020b31b
Code: fe 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 89 f2 48 83 ec 08 48 c7 c6 80 dc 10 a0 48 c7 c7 e8 75 11 a0 31 c0 e8 42 11 47 e0 <0f> 0b eb fe 90 41 56 b8 ed ff ff ff 41 55 41 54 41 89 f4 55 48
RIP [] 0xffffffffa00bce2b
RSP
nikespawn
May. 1st, 2009 12:35 am (UTC)
Re: segfault
my video:
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon X1950 GT (rev 9a) (prog-if 00 [VGA controller])
Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16
Memory at c0000000 (32-bit, prefetchable) [size=256M]
I/O ports at a000 [size=256]
Memory at d1000000 (32-bit, non-prefetchable) [size=64K]
[virtual] Expansion ROM at d0000000 [disabled] [size=128K]
Capabilities: [50] Power Management version 2
Capabilities: [58] AGP version 3.0
Capabilities: [80] MSI: Mask- 64bit+ Count=1/1 Enable-
jglisse
May. 1st, 2009 09:21 am (UTC)
Re: segfault
I pushed a fix for AGP cards, if you can test and report.
nikespawn
May. 1st, 2009 01:11 pm (UTC)
Re: segfault
ok work :)
but...

[drm] GART: num cpu pages 0, num gpu pages 0
[drm] Clocks initialized !
[drm] radeon: irq initialized.
TTM available graphics memory: 1005 MiB
TTM available object memory: 1005 MiB
[drm] radeon: 512M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] radeon: 3 pipes initialized.
[drm:radeon_gart_unbind] *ERROR* trying to unbind memory to unitialized GART !
[drm] radeon: cp idle (0x10000C03)
[drm] Loading R500 Microcode
[drm] radeon: ring at 0x0000000020000000
[drm] ring test succeeded in 2 usecs
[drm] radeon: ib pool ready.
[drm] ib test succeeded in 0 usecs
i2c-adapter i2c-0: unable to read EDID block.
radeon 0000:01:00.0: DVI-I-1: no EDID data
[drm] fb mappable at 0xFFFFC20000B80000
[drm] vram apper at 0xC0000000
[drm] size 7257600
[drm] fb depth is 24
[drm] pitch is 6912
fb0: radeondrmfb frame buffer device
a registered panic notifier
[drm] radeon: kernel modesetting successfully initialized.
[drm] Initialized radeon 2.0.0 20080528 for 0000:01:00.0 on minor 0
[drm:radeon_cp_getparam_kms] *ERROR* invalid ioctl with kms radeon_cp_getparam_kms
--------------
after modprobe radeon modeset=1
screen black, monitor get in standby - fb not work :(
last line in dmesg it i startx.
libdrm from git - modesetting-gem
where i can get "rigth" ddx?
and why:
------------
TTM available graphics memory: 1005 MiB
TTM available object memory: 1005 MiB
[drm] radeon: 512M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
-----------
if my card have only 512Mb..
nikespawn
May. 1st, 2009 01:40 pm (UTC)
Re: segfault
ok.. fb console work ^^ forgot enable it on kernel
[drm] TMDS-8: set mode 1680x1050 1c

but xorg..
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 7, (OK)
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 7, (OK)
drmOpenByBusid: Searching for BusID pci:0000:01:00.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 7, (OK)
drmOpenByBusid: drmOpenMinor returns 7
drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
(II) [drm] DRM interface version 1.3
(II) [drm] DRM open master succeeded.
(II) RADEON(0): Output DVI-0 using monitor section aticonfig-Monitor[0]
(II) RADEON(0): Output DVI-1 has no monitor section
(II) RADEON(0): Output DVI-0 disconnected
(II) RADEON(0): Output DVI-1 connected
(II) RADEON(0): Using user preference for initial modes
(II) RADEON(0): Output DVI-1 using initial mode 1680x1050
initing gart:20000000 vram: s:20000000 v:1fc00000
(II) UnloadModule: "radeon"
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found
jglisse
May. 1st, 2009 08:15 pm (UTC)
Re: segfault
Wrong ddx, i pushed an updated ddx which will be more verbose on configure and tell you if modesetting support is enabled or not.
nikespawn
May. 2nd, 2009 12:40 am (UTC)
Re: segfault
ok work ^^
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 20090101 TCL DRI2
OpenGL version string: 1.4 Mesa 7.5-devel

but..
# glxinfo
name of display: :0.0
IRQ's not enabled, falling back to busy waits: 2 0
display: :0 screen: 0
direct rendering: Yes

it's normal?

and on screen very much garbage..
glxgears 1770 frames in 5.0 seconds = 353.947 FPS
on dri1 4500+...wait perfomance :)

last update on http://cgit.freedesktop.org/~glisse/drm-next/commit/?h=drm-next-radeon&id=125d3d0cd1d62ca618c5aeaa48c5252b102ee1fb
missing file radeon_fixed.h and cant test 'radeon set subpixel precision to 1/16 to avoid rendering glitches'
mefcon1
May. 2nd, 2009 08:51 am (UTC)
Basic kernel compile issues
I had trouble with compiling for x86_64 that I fixed with the patch listed here:
http://patchwork.kernel.org/patch/15149/

Now I'm having trouble with errors like the following:
drivers/gpu/drm/radeon/atombios_crtc.c:29:26: error: radeon_fixed.h: No such file or directory

Am I just too n00b to do this, or is this an x86_64 issue again?
tirdc
May. 2nd, 2009 08:35 pm (UTC)
Re: Basic kernel compile issues
mefcon1
May. 3rd, 2009 05:15 am (UTC)
Re: Basic kernel compile issues
That seems to be working now - still compiling. Also turned off the staging drivers.
Many thanks.
https://me.yahoo.com/a/WjsxL6xsv.qwR5gYsYkBFDRl83c2xiQEIR.AApo-#fd65d
May. 4th, 2009 08:22 pm (UTC)
KMS and "No Signal"
After loading radeon module with option modeset=1
monitor doesn't get any signal from card(No Signal).
Output from dmesg(drm debug=1)
http://www.pastebin.ca/1412230
It also contains output from blindly starting X(gdm actually).
Log from X:
http://www.pastebin.ca/1412248

Radeon X1650 pro
Philips 200VW
Asus M2A-VM
nikespawn
May. 4th, 2009 10:31 pm (UTC)
Re: KMS and "No Signal"
maybe forgot enable console fb in kernel? (like me :) )
https://me.yahoo.com/a/WjsxL6xsv.qwR5gYsYkBFDRl83c2xiQEIR.AApo-#fd65d
May. 4th, 2009 11:07 pm (UTC)
Re: KMS and "No Signal"
My kernel config
http://www.pastebin.ca/1412780
Now I will try turning off vesafb
https://me.yahoo.com/a/WjsxL6xsv.qwR5gYsYkBFDRl83c2xiQEIR.AApo-#fd65d
May. 5th, 2009 11:24 am (UTC)
Re: KMS and "No Signal"
Without vesafb radeon(modeset=1) loads and there is actually console visible.
Unfortunately now I still can't start X.
It looks like drmModeAddFB(in libdrm used by 2d driver) is failing and returning -1.
Examining drm_mode_addfb(drm) gave me nothing as there was no "framebuffer" in new dmesg output.
https://me.yahoo.com/a/WjsxL6xsv.qwR5gYsYkBFDRl83c2xiQEIR.AApo-#fd65d
May. 5th, 2009 12:55 pm (UTC)
Re: KMS and "No Signal"
New dmesg.
http://www.pastebin.ca/1413219
no signal in modeset=1 with vesafb and vga16
https://me.yahoo.com/a/WjsxL6xsv.qwR5gYsYkBFDRl83c2xiQEIR.AApo-#fd65d
May. 7th, 2009 03:43 pm (UTC)
Re: KMS and "No Signal"
Is there anybody out there?
jglisse
May. 7th, 2009 08:49 pm (UTC)
Re: KMS and "No Signal"
This can't work if vesafb or vga is enabled, and you likely have a too recent Xserver you need 1.6 or 1.6.1. I will update bits soon i am working on fixing rendering & lockup issues. All this is still experimental code we don't intend it to be ready for consumption yet :)
lowell87
May. 5th, 2009 07:49 pm (UTC)
git repository access over http?
I'm behind a firewall that doesn't allow git traffic. It seems like normally I can just swap "git://" for "http://" and make that work, but it doesn't seem to work for several of the git repositories listed here.

Is there anything I can do to make this work over http?


$ git clone http://people.freedesktop.org/~glisse/drm-next
Initialized empty Git repository in .../drm-next/.git/
fatal: http://people.freedesktop.org/~glisse/drm-next/info/refs not found: did you run git update-server-info on the server?
df5jt.myopenid.com
May. 7th, 2009 02:01 pm (UTC)
Excellent work!
Some feedback on your excellent work.

Thinkpad T60p, FireGL V5200, 1600x1200

Framebuffer console at full resolution, very fast, a lot faster than vesafb.

Compiz works with no problems whatsoever, very fast, no visible tearing

glxgears on a spinning cube and with wobbliness

Smooth scrolling in Firefox, Fast Konsole in KDE

Caveats:

Wolfenstein/Quake worked on first try, then crashed ingame. Second start comes up with unplayably slow graphics.

Video: XV does not scale correctly. Only shows part of the picture in the video, no matter whether in window mode or fullscreen. I suspect that a video at 1600x1200 would play perfoct with -vo xv.

However: This will please you:

[swscaler @ 0x896d350]SwScaler: 720x576 -> 1024x576
VO: [gl2] 1024x576 => 1024x576 BGR 24-bit [fs] [zoom]
IRQ's not enabled, falling back to busy waits: 2 0
[gl2] You have OpenGL >= 1.2 capable drivers, GOOD (16bpp and BGR is ok!)
[gl2] antialiasing off
[gl2] bilinear linear

and a perfectly smooth video.

Just my first impressions. Could you give some hints as to how to update the individual bits and when to do so? I am not that familiar with git and its update mechanism.

Anyway, thanks for the great, excellent work!
awatry
May. 22nd, 2009 02:12 am (UTC)
Re: Excellent work!
Not sure if it'll help to mention this here, since the relevant parties are probably in communication with each other, but I found a diff/patch over in the Phoronix forums that might help a bit:

http://www.phoronix.com/forums/showpost.php?p=74755&postcount=35

I applied it against my copy of radeon-rewrite, and the video window is improved, but I'm still getting major cropping. It's probably going down the right path though.
awatry
May. 22nd, 2009 01:53 pm (UTC)
Re: Excellent work!
There was a follow-up patch from Alex Deucher which pointed out that a prior commit also had to be reverted (or just apply the full diff). Just follow my previous link, and view the thread in context to see the updated diff.
df5jt.myopenid.com
May. 30th, 2009 03:01 pm (UTC)
Re: Excellent work!
Indeed, this patch works as advertised.

This is incredible progress on all fronts and I applaude the developers for their efforts.

Right now I am using Mandriva Cooker with the tm-Kernel and Jerome's combined git-versions and it is now that everything works smoothly, i.e. flickerfree GL, XV without stuttering or tearing, compiz in all its glory, S2RAM and even Wolfenstein.

I am happy ;-)
df5jt.myopenid.com
Jun. 2nd, 2009 08:21 pm (UTC)
Re: Excellent work!
Is there a way to combine Jerome's git version with those versions that support DynamicPM and ForceLowPowerMode?
qjim
May. 10th, 2009 01:55 pm (UTC)
modeset failed on my 3850 AGP
I'm not so lucky. With jglisse's drm-next tree, radeon modeset failed.

I have X86, VIA KT600 and HD3850 AGP.
X.Org X Server 1.6.99.1: git://anongit.freedesktop.org/git/xorg/xserver
libdrm: git://anongit.freedesktop.org/git/mesa/drm:modesetting-gem


kernel command lines: (both failed)
root=/dev/sda5 read-only hpet=force fbcon=scrollback:128K drm.debug=1 radeon.modeset=1
root=/dev/sda5 read-only hpet=force fbcon=scrollback:128K drm.debug=1 radeon.modeset=1 radeon.agpmode=-1

config:
CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_MODE_HELPERS=y
CONFIG_FB_TILEBLITTING=y
CONFIG_DRM=y
CONFIG_DRM_TTM=y
CONFIG_DRM_RADEON=y
CONFIG_DRM_RADEON_KMS=y

dmesg:
...
Linux agpgart interface v0.103
agpgart: Detected VIA KT400/KT400A/KT600 chipset
agpgart-via 0000:00:00.0: AGP aperture is 256M @ 0xc0000000
[drm] Initialized drm 1.1.0 20060810
[drm] radeon kernel modesetting enabled.
[drm:drm_init]
[drm:drm_get_dev]
radeon 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[drm:drm_get_minor]
[drm:drm_get_minor] new minor assigned 64
[drm:drm_get_minor]
[drm:drm_get_minor] new minor assigned 0
[drm] radeon: Initializing kernel modesetting.
[drm] Forcing AGP to PCIE mode <--- with agpmode=-1
[drm:radeon_driver_load_kms] *ERROR* Failed to initialize radeon, disabling IOCTL
[drm:drm_put_minor] release secondary minor 0
radeon 0000:01:00.0: PCI INT A disabled
radeon: probe of 0000:01:00.0 failed with error -22
...

Airlied's drm-2.6 tree with same config is more successfull with radeon modeset.
dmesg:
...
[drm:drm_get_minor] new minor assigned 0
[drm:radeon_driver_load] AGP card detected
[drm] Forcing AGP to PCIE mode
[drm:drm_addmap_core] offset = 0xe0020000, size = 0x00010000, type = 1
[drm:radeon_get_bios] ATOMBIOS detected
ATOM BIOS: 113-AB43300-104 RV670 GDDR3_16MX32 256BIT 512MB 669E/829M
[drm:radeon_get_vram_type] RAM width 128 bits DDR
[drm] Detected VRAM RAM=524288K, accessible=262144K, BAR=262144K
[drm:radeon_get_atom_connector_info_from_object_table] *ERROR* record type 1
[drm:radeon_get_atom_connector_info_from_object_table] *ERROR* record type 2
[drm:radeon_get_atom_connector_info_from_object_table] *ERROR* record type 4
[drm:drm_sysfs_connector_add] adding "DVI-I-1" to sysfs
...

After this I have fb console with resolution 1280x1024 75Hz only - EDID failed. Xorg has no problem with EDID.

On KMS enabled kernels I have slideshow with xf86-video-ati 6.12.2 and 9999 (git://anongit.freedesktop.org/git/xorg/driver/xf86-video-ati:master) ;)
With xf86-video-ati from git://people.freedesktop.org/~airlied/xf86-video-ati:radeon-gem-cs3 or git://people.freedesktop.org/~glisse/xf86-video-ati:radeon-gem-cs3, I ended with black screen, with cursor blinking in the upper left corner. :(

Xorg.0.log:
...
[6] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
[7] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
[8] -1 0 0x00000000 - 0x00000000 (0x1) IX[B]
[9] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
[10] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
(II) Setting vga for screen 0. <--- this is the end of Xorg.0.log

Do you have an idea why jglisse's drm-next failed on my AGP radeon?
And why xorg failed too?
jglisse
May. 22nd, 2009 11:25 am (UTC)
Re: modeset failed on my 3850 AGP
There is no support for r6xx/r7xx (so your card is not supported) hw yet.
qjim
May. 22nd, 2009 12:14 pm (UTC)
Re: modeset failed on my 3850 AGP
No support where? In kernel (drm-next) or in xorg/video-ati driver?
And is there any estimate when they could be supported?
b1u
May. 15th, 2009 02:40 am (UTC)
non-x86 build issue
hi. i've been trying to get it working on a ppc32 machine, and it appears the current radeon module is effectively x86-bound through indirect inclusion of the arch-specific header asm/iomap.h:

CC [M] drivers/gpu/drm/radeon/radeon_device.o
In file included from drivers/gpu/drm/radeon/radeon.h:51,
from drivers/gpu/drm/radeon/radeon_device.c:33:
include/linux/io-mapping.h:24:23: error: asm/iomap.h: No such file or directory
make[4]: *** [drivers/gpu/drm/radeon/radeon_device.o] Error 1
make[3]: *** [drivers/gpu/drm/radeon] Error 2
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2

now, my understanding is that asm/iomap.h should be only included through asm/io.h, rather than directly, as it the case above. actually, io-mappings.h already includes asm/io.h. so i patched the offending inclusion from it and the module built fine on ppc. i still haven't finished with the rest, so i cannot report anything from actually trying to run the edge, but hopefully i will soon.

an rv280 user here.
b1u
May. 27th, 2009 02:10 am (UTC)
Re: non-x86 build issue
first results from the ppc32 front:

while the kernel modesetting part works flawlessly, resulting in a fully-operational fbcon, the drm part fails at drmOpenDevice (Xorg.log applied)

http://pastebin.com/f1c7788b2

dmesg has next to nothing on the subject aside from the following two consecutive lines:

[drm:drm_stub_open]
[drm:drm_stub_open]
b1u
Jun. 18th, 2009 03:10 am (UTC)
Re: non-x86 build issue
so i got radeon-rewrite working on a ppc32 + rv280 here. the above issue was resolved by switching the radeon DRM driver to a loadable kernel module (was originally running as built-in).

the outstanding issues are:

a) under DRI my major issue with the previous 'mainstream' radeon is still present - static VBOs are re-emitted on each draw; huge hit for large VBOs.
b) i cannot get DRI2 working at all, the only diagnostics being:

(II) AIGLX: Screen 0 is not DRI2 capable


git versions for the respective components are:
drm (modesetting-gem): 1edb70f1b909d06f1c0ee7c9c794aec99454e488
drm-next (drm-next-radeon): 57ed16f7686e9c0c4ec5f7711688a503481987c2
xf86-video-ati (radeon-gem-cs3): 7a514a750fc6bca34e9549eb28e344576c0de4f1
mesa (radeon-rewrite): 67bbfb9c68d0bf459f706a4cb50caf8245a37a34

xorg server version is 1.6.1
tom_5544
May. 15th, 2009 01:52 pm (UTC)
Problems with suspend
Works fine on Thinkpad T60, radeon x1300, except that coming back from suspend leaves the display blank (disk still active due to a compile running when I suspended). If i switch to other VTs from this state then the screen flashes garbage.

This is on debian 5 with xorg from unstable, 32-bit.

Oh, with mesa (radeon-rewrite, DRI2), there are seams of black pixels between triangles. For example in glxgears you can see the component triangles of the gears due to these artifacts. Otherwise GL performance is ok.
awatry
May. 22nd, 2009 12:44 am (UTC)
Re: Problems with suspend
Agreed. I was having some, probably, unrelated issues with video acceleration (slideshow) and decided to try to suspend. The laptop suspended successfully, but when I resumed, I had a bunch of random garbage characters on screen. By switching back and forth from a VT to X, the pattern of junk characters changed, but the system was unusable.

I rebooted and tried to suspend again, got the same results. I'm trying to dig up some debug info from the logs, and it looks like the only useful bit of info is from dmesg...

http://pastebin.com/m714b0832

[ 237.098166] [drm] [radeon_suspend_kms 682]
[ 237.179813] [drm:radeon_bo_move] *ERROR* CP is not ready use memcpy.

There's another radeon_bo_move error on resume from suspend as well.

There is nothing that I see as relevant in the Xorg.0.log, but here that is as well:
http://pastebin.com/d4f75a945

Hardware:
Dell Inspiron 6000
Intel Pentium M 2.13Ghz
4GB RAM
ATI Radeon Mobility x300 128MB (M22?)

Software:
Ubuntu 9.04
df5jt.myopenid.com
May. 30th, 2009 03:06 pm (UTC)
Re: Problems with suspend
Can't confirm this on my T60p with a FireGL V5200. S2RAM works perfect and glxgears shows no artefacts whatsoever.
nikespawn
Jun. 10th, 2009 12:00 am (UTC)
KMS ioctrl failed
after last _big_ commit not work Xorg - no screen found
reinstall all..
messages http://pastebin.com/m158421c9
xorg.log http://pastebin.com/m2ed0ab89
awatry
Jun. 11th, 2009 03:32 pm (UTC)
Re: KMS ioctrl failed
I know one of the previous commits broke my X as well, but then I realized that the Xv patch that I had applied was preventing part of the git update process from completing. I'm not saying that this is necessarily the case for you, but it might be worth checking if there's a merge conflict of some sorts if you've applied any 3rd party patches.
nikespawn
Jun. 13th, 2009 12:59 am (UTC)
Re: KMS ioctrl failed
Problem found:
(II) RADEON(0): Output DVI-0 using monitor section aticonfig-Monitor[0]
(II) RADEON(0): Output DVI-1 has no monitor section

I use DVI-1...but radeon cant find section.
change BusID cant help
and radeon modeset=1 cant start with agpmode>-1. agp not work, ring failed and kernel panic
nikespawn
Jun. 13th, 2009 03:02 pm (UTC)
Re: KMS ioctrl failed
connect dual. not work :(
dual http://pastebin.com/m5ecc8b42
only dvi-0 http://pastebin.com/m2787de12
pgeary
Jun. 19th, 2009 07:19 am (UTC)
MESA EGL support help

I have an RS690 (x1200) device and the acceleration appears to be working ok for me following all the steps. what i would like to do though is to get the MESA EGL driver running. It compiles ok, but i have a problem running the test apps in mesa/progs/egl. An example being the eglscreen test. These appear to be initially developed for Intel drivers but presumably should work with any card so i modified the file to connect to the "EGL_r300" driver. The program has a problem on calling eglShowScreenSurfaceMESA, which goes down to an ioctl to DRM_IOCTL_MODE_SETCRTC to the kernel. This kills the screen although i see no errors reported and the only way to recover is to reboot the PC. Any ideas if this should work??

Thanks,
( 43 comments — Leave a comment )