This fixes the broken direct rendering problem seen by several people
on the XFree list and tracked to XvMC by Mike Harris. The issue
doesn't seem to actually be XvMC or XFree at all. As far as I can
tell XFree does correctly have direct rendering working. For some
reason the zero sized drmMap that occurs when XvMC is disabled
(since the drm has hardcoded maps I figured it was wise to keep
the placeholder) confuses the direct rendering portion of the
OGL/GLX libs.  I haven't bothered to track this further because
the fix is easier in XFree. I only create the maps when there are 
surfaces to be used.

This is the /proc/dri/card/0/vm output when in the broken state:

slot     offset       size type flags    address mtrr
   0 0xf8000000 0x00000000  AGP  0x00 0x00000000    2
   1 0xf9e7d000 0x00001000  AGP  0x00 0x00000000    2
   2 0xf8320000 0x01a00000  AGP  0x00 0x00000000    2
   3 0xf8300000 0x00010000  AGP  0x00 0x00000000    2
   4 0xf9d7d000 0x00100000  AGP  0x00 0x00000000    2
   5 0xfb000000 0x00182000  AGP  0x00 0x00000000    2
   6 0xfb800000 0x00182000  AGP  0x00 0x00000000    2
   7 0xffa80000 0x00080000  REG  0x00 0xc8a58000 none
   8 0xf8000000 0x00180000   FB  0x00 0xc88d7000 none
   9 0xc88d4000 0x00002000  SHM  0x20 0xc88d4000 none

This is the same with XvMC surfaces enabled:

slot     offset       size type flags    address mtrr
   0 0xfa900000 0x00700000  AGP  0x00 0x00000000    2
   1 0xf9e7d000 0x00001000  AGP  0x00 0x00000000    2
   2 0xf8320000 0x01a00000  AGP  0x00 0x00000000    2
   3 0xf8300000 0x00010000  AGP  0x00 0x00000000    2
   4 0xf9d7d000 0x00100000  AGP  0x00 0x00000000    2
   5 0xfb000000 0x00182000  AGP  0x00 0x00000000    2
   6 0xfb800000 0x00182000  AGP  0x00 0x00000000    2
   7 0xffa80000 0x00080000  REG  0x00 0xc8a58000 none
   8 0xf8000000 0x00180000   FB  0x00 0xc88d7000 none
   9 0xc88d4000 0x00002000  SHM  0x20 0xc88d4000 none

Note the first map is zero size in the broken version and has a
valid size in the non-broken version. The X log output is nearly
identical and indicates that DRI is working in both cases. glxinfo
reports that DRI is NOT working in the first case.

Anyone who is experiencing the problem can either put
Option "XvMCSurfaces" "6"
in the device section of their XF86Config file or apply this patch.
Using the patch is recommended since XvMC does use 7-8MB of memory.

-Matt

Attachment: xfree.diff.gz
Description: Binary data

Reply via email to