Unbeknownst to me, the MGA DRM has been broken since August 4th (yes, over two months). The MGA is the only driver that allocates the AGP region from within the DRM instead of from user space (via a DRM ioctl). The net result is that dev->agp->memory doesn't get initialized. Changes made to drm_addmap on August 4th make this an error condition. A fix is in progress.
Reassigning to myself.
Created attachment 3573 [details] [review] Almost fix AGP problems in MGA DRM. Converts the remaining drm_agp_foo functions to be a drm_agp_foo and drm_agp_foo_ioctl pair. Modifies the MGA DRM to use the drm_agp_foo functions instead of the drm_foo_agp functions. The drm_foo_agp functions are no longer exported by drm.ko. The bsd-core side of things will also need these (or similar) changes applied. When this patch was applied (with some conflicts) to a '-D "20050804 23:59 GMT"' DRM check out, everything worked correctly. However, against current CVS, everything seems to work fine in the kernel, but I get the following error message in Xorg.0.log: (EE) MGA(0): [drm] Failed to map DMA buffers list
Adding 'Option "ForcePciDma" "TRUE"' to xorg.conf with attachment #3573 [details] [review] causes direct render to be enabled. However, the glxgears window is all black. There are obviously still some problems.
Created attachment 3586 [details] [review] Almost fix AGP problems in MGA DRM, take 2. This patch includes everything of the previous patch, but it also makes sure that dma->seg_count and dma->page_count are properly set in drm_addbufs_{agp,sg,fb}. drm_addbufs_pci was already correct. Direct rendering is now enabled in the AGP case, but it's still not right. The Linux VM *kills* any direct rendering apps that run.
Created attachment 3587 [details] /var/log/messages with attachment #3586 [details] [review] Output of /var/log/messages of starting X and running glxgears when attachment #3586 [details] [review] is applied.
(In reply to comment #0) > Unbeknownst to me, the MGA DRM has been broken since August 4th (yes, over two > months). Vanilla kernels > 2.6.12 crashes here xorg (6.8.2) and Matrox G400 always: "EE MGA(0): [dri] Idle timed out, resetting engine...". The crash occurs if glxgears is executed. Exec of glxinfo doesn't crash xorg and shows direct rendering as enabled. Currently I have to switch back to kernel 2.6.11.12, this one works with the same kernel config/xorg combination without any problem. Is there any patch on top of 2.6.14? Regards from Germany Matthias
It looks like the commit of version 1.65 of linux-core/drm_bufs.c is responsible for breaking PCI MGA.
(In reply to comment #6) > (In reply to comment #0) > > Unbeknownst to me, the MGA DRM has been broken since August 4th (yes, over two > > months). > > Vanilla kernels > 2.6.12 crashes here xorg (6.8.2) and Matrox G400 always: "EE > MGA(0): [dri] Idle timed out, resetting engine...". The crash occurs if glxgears > is executed. Exec of glxinfo doesn't crash xorg and shows direct rendering as > enabled. > > Currently I have to switch back to kernel 2.6.11.12, this one works with the > same kernel config/xorg combination without any problem. Is there any patch on > top of 2.6.14? Can you try 2.6.14? I fixed a number of issues with MGA before 2.6.14 went out.. but not with MGA PCI. Dave.
(In reply to comment #8) > (In reply to comment #6) > > (In reply to comment #0) > > > Unbeknownst to me, the MGA DRM has been broken since August 4th (yes, over two > > > months). > > > > Vanilla kernels > 2.6.12 crashes here xorg (6.8.2) and Matrox G400 always: "EE > > MGA(0): [dri] Idle timed out, resetting engine...". The crash occurs if glxgears > > is executed. Exec of glxinfo doesn't crash xorg and shows direct rendering as > > enabled. > > > > Currently I have to switch back to kernel 2.6.11.12, this one works with the > > same kernel config/xorg combination without any problem. Is there any patch on > > top of 2.6.14? > > Can you try 2.6.14? I fixed a number of issues with MGA before 2.6.14 went out.. > but not with MGA PCI. Dave... ...yes, because I have seen these changes in the Changelog I've tried 2.6.14 last week: Without distinction :-( The G400 card resides in an AGP-Slot, using IRQ 11, the kernel is compiled for SMP always, the server comes with two PIII CPU's at 1,00 gHz per CPU. IO-APIC is used. $ cat /proc/interrupts says on kernel 2.6.11.12 (as I said, no probs there with DRI): CPU0 CPU1 0: 773469 751432 IO-APIC-edge timer 1: 1411 1115 IO-APIC-edge i8042 2: 0 0 XT-PIC cascade 8: 1 0 IO-APIC-edge rtc 9: 0 0 IO-APIC-edge acpi 10: 732 84 IO-APIC-level EMU10K1 11: 149525 1 IO-APIC-level eth0, mga@pci:0000:01:00.0 12: 21780 18458 IO-APIC-edge i8042 14: 101359 96633 IO-APIC-level aic7xxx, uhci_hcd, uhci_hcd, uhci_hcd 15: 6 1 IO-APIC-level tmscsim NMI: 0 0 LOC: 1524674 1524700 ERR: 0 MIS: 0 Regards Matthias
(In reply to comment #4) > Direct rendering is now enabled in the AGP case, but it's still not right. The > Linux VM *kills* any direct rendering apps that run. I've tracked this down to mga_draw_triangle (in src/mesa/drivers/dri/mga/mgatris.c). After calling mgaAllocDmaLow, the pointer returned is not accessable by the process. After I discovered that, I verified that each of mmesa->mgaScreen->bufs->list[].address was not accessable. I thought the whole point of calling drmMapBufs was to get accessable pointers. This *only* happens if the buffers are in AGP memory. If I put back the virt_to_bus call in the kernel, PCI mode works perfectly. So now I'm not sure whether the problem lies in the MGA DRM or in the client-side driver (or the DDX?). My guess is that DRM isn't doing something that it should do. Suggestions?
(In reply to comment #10) > So now I'm not sure whether the problem lies in the MGA DRM or in the > client-side driver (or the DDX?). My guess is that DRM isn't doing something > that it should do. Suggestions? The problem is definitely in the kernel somewhere. If I add 'Option "OldDmaInit" "TRUE"' to my xorg.conf everything works correctly. There's obviously a step being missed in the kernel that used to be done by the DDX. Ugh...
Created attachment 3685 [details] [review] Acquire AGP and allocate AGP memory, take 3 This patch does everything that patch #3586 does, but it also makes sure that mga_do_agp_dma_bootstrap correctly sets agp_buffer_token. This seems to fix all the problems with the MGA DRM on AGP cards on Linux. Are similar changes needed for BSD?
I have committed attachment #3685 [details] [review], and I am closing this bug. I will submit another bug for the PCI DMA issue.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.