Bug 1950 - AGP Ring-buffer support for the Unichrome driver.
AGP Ring-buffer support for the Unichrome driver.
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/Unichrome
x86 (IA32) Linux (All)
: high enhancement
Assigned To: Default DRI bug account
Depends on:
  Show dependency treegraph
Reported: 2004-11-27 15:09 UTC by Thomas Hellström
Modified: 2009-08-24 12:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Patch to submit 3D commands through DRM mechanisms. (40.38 KB, patch)
2004-11-27 15:12 UTC, Thomas Hellström
Details | Splinter Review
New version of the patch with additional functionality. (70.30 KB, patch)
2004-12-13 06:22 UTC, Thomas Hellström
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hellström 2004-11-27 15:09:16 UTC
The Unichrome (via) DRM module implements an AGP ring buffer and the Unichrome
Mesa driver is currently not using it, but instead relies on its own programming
of the DMA engine. This is not good from a security point of view, since the
register space of the Unichrome chip must be exported read-write.

This patch makes the Unichrome driver use the AGP ring buffer in the DRM or fall
back to a PCI MMIO mechanism also in DRM if AGP is not enabled. 

Before this patch is commited, DRM must implement a more versatile command
buffer verifier. The current one does not let any 3D commands through, so it
must be disabled for this code to work. This code will help people debug such a
command verifier.

The patch also removes the VQ disabling from the driver. It uses direct video
register writes and it apparently is there for Tuxracer when the pci path is
used, but this seems to work fine on my test setup.

Comment 1 Thomas Hellström 2004-11-27 15:12:07 UTC
Created attachment 1410 [details] [review]
Patch to submit 3D commands through DRM mechanisms.

The patch. It requires via drm driver version 2.1.0 or above and that the
command verifyier in drm is manually removed. (File shared/via_dma.c or
shared-core/via_dma.c ).
Comment 2 Thomas Hellström 2004-12-13 06:22:33 UTC
Created attachment 1538 [details] [review]
New version of the patch with additional functionality.

New version of the patch. This one is using the functionality just recenctly
commited to DRM and since the command verifier now is implemented. This patch
should be fully OK to apply. In addition to the DRM command buffer
functionality, it fixes

1. A locking bug that caused the driver not to keep up with drawable changes.
2. Blitter problems caused by the blitter losing context when the command
buffer is executed through AGP.
3. AGP textures are reenabled.
4. Check for texture memory allocation failure.

The driver avoids filling the ring-buffer by checking the command regulator
lag. Presently this is allowed to be only 50kB. This is tuneable, but larger
values seem to make applications unresponsive while at the same time providing
little performance gain.

With Miniglx, the driver will use the PCI path until someone finds time to
patch the Miniglx server to initialize the AGP ring-buffer.
Comment 3 Thomas Hellström 2004-12-15 14:00:29 UTC
This has been comitted now in a slightly modified variant.
Comment 4 ajax at nwnk dot net 2009-08-24 12:22:53 UTC
Mass version move, cvs -> git