From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 1 21:50:03 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A16A716A4BF for ; Mon, 1 Sep 2003 21:50:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37B0543FB1 for ; Mon, 1 Sep 2003 21:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h824o1Up062241 for ; Mon, 1 Sep 2003 21:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h824o118062240; Mon, 1 Sep 2003 21:50:01 -0700 (PDT) Resent-Date: Mon, 1 Sep 2003 21:50:01 -0700 (PDT) Resent-Message-Id: <200309020450.h824o118062240@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Angelescu Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4B5316A4BF for ; Mon, 1 Sep 2003 21:39:59 -0700 (PDT) Received: from web12207.mail.yahoo.com (web12207.mail.yahoo.com [216.136.173.91]) by mx1.FreeBSD.org (Postfix) with SMTP id 67FAD4400B for ; Mon, 1 Sep 2003 21:39:57 -0700 (PDT) (envelope-from mrhsaacdoh@yahoo.com) Received: from [213.233.97.10] by web12207.mail.yahoo.com via HTTP; Mon, 01 Sep 2003 21:39:57 PDT Message-Id: <20030902043957.24635.qmail@web12207.mail.yahoo.com> Date: Mon, 1 Sep 2003 21:39:57 -0700 (PDT) From: Dan Angelescu To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/56297: Agp problem for intel chipsets ? DRM and DRI Related. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2003 04:50:03 -0000 >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 >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@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.