kern/56297: Agp problem for intel chipsets ? DRM and DRI Related.

Dan Angelescu mrhsaacdoh at yahoo.com
Mon Sep 1 21:50:03 PDT 2003


>Number:         56297
>Category:       kern
>Synopsis:       Agp problem for intel chipsets ? DRM and
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 01 21:50:00 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dan Angelescu <mrhsaacdoh at yahoo.com>
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
none
>Environment:
System: FreeBSD AdiLaura.sonix.ro 4.8-STABLE FreeBSD
4.8-STABLE #0: Fri
Aug 29 0
9:21:49 GMT 2003
root at AdiLaura.sonix.ro:/usr/src/sys/compile/MyComputer_DRM
i386
Machine I386 ,Cpu PIII 667MHz or Cpu Celeron 600Mhz
Os Any FreeBSD > 4.6.2-p13
Programs: XFree86-4.1.0 to XFree86-4.3.0
,drm-kmod-0.9.4 to
drm-kmod-0.9.6 and
drm included in Kernel from Kernel>= 4.8.
I use a motherboard frm MSI respectively MS 6334 wich
is intel 82815
chipset
based and has integrated graphics.I use  a Ati Radeon
VE QY video card
inserted
in
the agp slot.

>Description:
After FreeBSD > 4.6.2-p13 system crash at the second
,third or fourth
restart of
X Server when DRI and DRM are activated for Ati Radeon
VE QY video
card.
I have noticed that at the restarting of X sever on my
screen apears
images from my previous X session even i have changed
the windowmanager
from
.xinitrc.

>How-To-Repeat:
Install drm-kmod from ports or compile it in Kernel
for FReeBSD >=4.8.
Install and configure X Server to use DRI.
Start X Server once , exit and restart several times X
Server.
       
>Fix:
It seems that problem is due to code from function
agp_intel_flush_tlb(device_tdev)  wich is in 
/sys/pci/agp_intel.c.
In FreeBSD < 4.7 it was
  agp_intel_flush_tlb(device_t dev)
{
        pci_write_config(dev, AGP_INTEL_AGPCTRL,
0x2200, 4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL,
0x2280, 4);
}
In FreeBSD> 4.6.2-p13
agp_intel_flush_tlb(device_t dev)
{
        u_int32_t val;
        val = pci_read_config(dev, AGP_INTEL_AGPCTRL,
4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL,val &
~(1 << 8)  , 4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL, val ,
4);
}.
After i have inspected agp code for intel chipsets in
NetBSD-1.6 ,
OpenBSD-3.2
and Linux i have noticed that:
In OpenBSD and NetBSD is used a code similar from
FreeBSD <= 4.6.2-p13.
In Linux it is used a code similar with FreeBSD>
4.6.2-p13 with a
little
diference:
In Linux instead of variabile val & ~(1 << 8) it is
used val & ~(1 <<
7) at the
first invocation
of function pci_write_config and at the second
invocation it is used
val | (1 <<7) instead of val used in FreeBSD.
To fix the problem it seems to be  three posibilities:

1) The use of the old FreeBSD code for
agp_intel_flush_tlb(device_t
dev)
but i don't know if it works for all chipsets. 
agp_intel_flush_tlb(device_t dev)
{
        pci_write_config(dev, AGP_INTEL_AGPCTRL,
0x2200, 4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL,
0x2280, 4);
}

2) The use of the code from FreeBSD > 4.6.2-p13 with a
minor
modification
where we write 7 instead of 8 in val & ~(1 << 8) at
the first
invocation of pci_
write_config

agp_intel_flush_tlb(device_t dev)
{
        u_int32_t val;
        val = pci_read_config(dev, AGP_INTEL_AGPCTRL,
4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL,val &
~(1 << 7)  , 4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL, val ,
4);
}

 3) The use of the Linux code adapted for FreeBSD

agp_intel_flush_tlb(device_t dev)
{
        u_int32_t val;
        val = pci_read_config(dev, AGP_INTEL_AGPCTRL,
4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL, val &
~(1 << 7), 4);
        val = pci_read_config(dev, AGP_INTEL_AGPCTRL,
4);
        pci_write_config(dev, AGP_INTEL_AGPCTRL, val |
(1 << 7), 4);
}.
With any of these modifications all works well on my
motherboard.
I haven't tested that for other motherboards or
chipsets because
i have only one Computer.
Hope it helps !


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
>Release-Note:
>Audit-Trail:
>Unformatted:
 DRI Related.


More information about the freebsd-bugs mailing list