i915 DRM breakage in -CURRENT

Jonathan Fosburgh jonathan at fosburgh.org
Fri Apr 14 15:53:37 UTC 2006


The recent DRM commit broke the DRM on my i915 card.  After digging around in 
the drm sources I came across something that didn't seem right to me and 
after changing it DRM works again. At the bottom of i915_dma.c there is a 
comment that reads "All Intel graphics chipsets are treated as AGP...A value 
of 1 is always retured to indictate every i9x5 is AGP."  And then it is set:

int i915_driver_device_is_agp(drm_device_t * dev)
{
        return 1;
}

And then in i915_drc.c, device_is_agp is set to the value of 
i915_device_is_agp, and then drm_agpsupport.c uses this to determine if it 
can attach an agp device.  This used to work, but in digging through the 
sources something caught my eye that doesn't make sense.  There is a comment 
in drm_agpsupport.c that reads:

                /* device_is_agp returns a tristate, 0 = not AGP, 1 = 
definitely
                 * AGP, 2 = fall back to PCI capability
                 */
But the check in the drm_device_is_agp function to determine whether or not to 
attach as agp changed from

	if(ret != 2)

to

	if(ret != DRM_MIGHT_BE_AGP)

The value of DRM_MIGHT_BE_AGP is set in an enum in drmP.h

	enum {
		DRM_IS_NOT_AGP,
        		DRM_MIGHT_BE_AGP,
        		DRM_IS_AGP
};

I read this as DRM_IS_NOT_AGP == 0, DRM_MIGHT_BE_AGP == 1, and DRM_IS_AGP == 
2.  Granted, in my limited coding skills I have never really used enum, but 
it at least seems to me that that is what is being set.  This therefore 
conflicts with what one would expect from the comments.  And based on this, 
the i915 needs to be set to 2, and not 1.  I have done this, and now the drm 
attaches again and appears to work (Xorg says Direct Rendering is enabled and 
so far the appearance feels right.)  The only problem I see is the drm attach 
message says it has 0MB instead of reporting the AGP aperture size of 256MB, 
as I think it used to.

agp0: <Intel 82915G (915G GMCH) SVGA controller> on vgapci0
agp0: detected 7932k stolen memory
agp0: aperture size is 256M

drm0: <Intel i915G> on vgapci0
info: [drm] AGP at 0xcfd00000 0MB
info: [drm] Initialized i915 1.4.0 20060119

HTH.
	

-- 
Jonathan Fosburgh
AIX and Storage Administrator
UT MD Anderson Cancer Center
Houston, TX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-x11/attachments/20060414/24b45a41/attachment.pgp


More information about the freebsd-x11 mailing list