From owner-freebsd-current@FreeBSD.ORG Fri Jan 25 20:07:01 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D74C928 for ; Fri, 25 Jan 2013 20:07:01 +0000 (UTC) (envelope-from taku@tackymt.homeip.net) Received: from basalt.tackymt.homeip.net (unknown [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by mx1.freebsd.org (Postfix) with ESMTP id D343C6D5 for ; Fri, 25 Jan 2013 20:07:00 +0000 (UTC) Received: from basalt.tackymt.homeip.net (localhost [127.0.0.1]) by basalt.tackymt.homeip.net (Postfix) with ESMTP id 0594583C0 for ; Sat, 26 Jan 2013 05:06:59 +0900 (JST) X-Virus-Scanned: amavisd-new at tackymt.homeip.net Received: from localhost by basalt.tackymt.homeip.net (amavisd-new, unix socket) with ESMTP id TsGf7lMIIgP1 for ; Sat, 26 Jan 2013 05:06:55 +0900 (JST) Received: from basalt.tackymt.homeip.net (basalt.tackymt.homeip.net [IPv6:2001:3e0:577:0:20d:61ff:fecc:2253]) by basalt.tackymt.homeip.net (Postfix) with ESMTPSA for ; Sat, 26 Jan 2013 05:06:55 +0900 (JST) Date: Sat, 26 Jan 2013 05:06:54 +0900 From: Taku YAMAMOTO To: FreeBSD Current Subject: [PATCH] to fix slow gen2 Intel video (i830, i845, i85x, i865) with KMS Message-Id: <20130126050654.37ac83fd477464a911b49bf6@tackymt.homeip.net> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.6; i386-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sat__26_Jan_2013_05_06_54_+0900_2f/IEF=5_9PGFAyl" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 20:07:01 -0000 This is a multi-part message in MIME format. --Multipart=_Sat__26_Jan_2013_05_06_54_+0900_2f/IEF=5_9PGFAyl Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi all, A good news to owners of i830, i845, i852, i855 and i865 (a.k.a. gen2), who've got frustrated with the bad performance with KMS. I managed to track down the root cause of the slowness of gen2 with KMS and finally fixed it. The attached one-liner patch is the fix. (It was my surprise that the actual problem lied in agp rather than i915kms.) -- -|-__ YAMAMOTO, Taku | __ < - A chicken is an egg's way of producing more eggs. - --Multipart=_Sat__26_Jan_2013_05_06_54_+0900_2f/IEF=5_9PGFAyl Content-Type: text/plain; name="agp_i830_chipset_flush.patch" Content-Disposition: attachment; filename="agp_i830_chipset_flush.patch" Content-Transfer-Encoding: 7bit --- sys/dev/agp/agp_i810.c.orig 2013-01-20 16:18:33.382363986 +0900 +++ sys/dev/agp/agp_i810.c 2013-01-25 05:47:17.046570619 +0900 @@ -2228,7 +2228,7 @@ agp_i830_chipset_flush(device_t dev) bus_write_4(sc->sc_res[0], AGP_I830_HIC, hic | (1 << 31)); for (i = 0; i < 20000 /* 1 sec */; i++) { hic = bus_read_4(sc->sc_res[0], AGP_I830_HIC); - if ((hic & (1 << 31)) != 0) + if ((hic & (1 << 31)) == 0) break; DELAY(50); } --Multipart=_Sat__26_Jan_2013_05_06_54_+0900_2f/IEF=5_9PGFAyl--