From owner-freebsd-bugs@FreeBSD.ORG Mon May 29 15:20:44 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org 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 4AC7D16ABE0 for ; Mon, 29 May 2006 15:20:44 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25F9A43D7B for ; Mon, 29 May 2006 15:20:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4TFKQ3Z055741 for ; Mon, 29 May 2006 15:20:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4TFKQJS055740; Mon, 29 May 2006 15:20:26 GMT (envelope-from gnats) Resent-Date: Mon, 29 May 2006 15:20:26 GMT Resent-Message-Id: <200605291520.k4TFKQJS055740@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, Mike M Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A00A716A7BD for ; Mon, 29 May 2006 15:19:55 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from shrike.submonkey.net (cpc2-cdif2-0-0-cust107.cdif.cable.ntl.com [81.104.168.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37E9043D76 for ; Mon, 29 May 2006 15:19:55 +0000 (GMT) (envelope-from ceri@submonkey.net) Received: from ceri by shrike.submonkey.net with local (Exim 4.62 (FreeBSD)) (envelope-from ) id 1FkjX8-000AB5-HU for FreeBSD-gnats-submit@freebsd.org; Mon, 29 May 2006 16:19:54 +0100 Message-Id: Date: Mon, 29 May 2006 16:19:54 +0100 From: Mike M Sender: Ceri Davies To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/98094: AGP driver misconfigures aperture size on X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mike M List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2006 15:20:48 -0000 >Number: 98094 >Category: kern >Synopsis: AGP driver misconfigures aperture size on >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 29 15:20:25 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Mike M >Release: FreeBSD 6.1-STABLE i386 >Organization: none >Environment: System: FreeBSD blunderbox.domain.actdsltmp 6.1-STABLE FreeBSD 6.1-STABLE #3: Sun May 28 20:40:21 PDT 2006 mmcg@blunderbox.domain.actdsltmp:/M/0/a/usr.obj/M/0/a/usr.src6/sys/BLUNDE= RBOX32 i386 Athlon 64, running FreeBSD/i386 >Description: Running FreeBSD-i386 on an Athlon 64, with a radeon 9600 video card and a SiS760 AGP bridge, using X.org 6.9; GENERIC kernel with agp, dri, and radeon dri compiled in. When starting Xorg using the system as configured above, DRM fails to initialize with the following: agp0: binding memory at bad offset 0 This causes DRM, hence DRI to fail, resulting in no acceleration for GLX under X. Somewhat frustrating, as I had purchased the radeon card to solve precisely this problem (with the built-in graphics). The reason: the AGP driver thinks that the aperture size is 4M - when, in fact, it is 64M. The aperture initialization then fails because AGP_GET_APERTURE() is returning 4M, whereas the radeon DRI driver is using the size information returned by agp_get_info() (which retrieves the size of the allocated resource directly from the resource manager, using rman_get_size(sc->as_aperture) - this may or may not be a bug). So agp_alloc_gatt() fails because it's asked to allocate 64M but only believes 4M is available. >How-To-Repeat: Use an Athlon 64 motherboard with a SiS 760 AGP bridge and (in my case) a radeon 9600 video card. Start Xorg. No DRI. >Fix: After the following patch, things magically started working (it just adds the SiS760 device ID to the agp_amd64.c handler): diff -c /usr/src/sys/pci/agp_amd64.c{.ctm,} *** /usr/src/sys/pci/agp_amd64.c.ctm Sun May 28 19:37:02 2006 --- /usr/src/sys/pci/agp_amd64.c Sun May 28 19:41:42 2006 *************** *** 97,102 **** --- 97,104 ---- return ("AMD 8151 AGP graphics tunnel"); case 0x07551039: return ("SiS 755 host to AGP bridge"); + case 0x07601039: + return ("SiS 760 host to AGP bridge"); case 0x168910b9: return ("ULi M1689 AGP Controller"); case 0x00d110de: glxgears went from 90fps to 1200fps. WARNING: I do not know how (or whether) this will affect non-athlon64s. >Release-Note: >Audit-Trail: >Unformatted: Athlon64 with SiS 760 controller (+PATCH)