From owner-freebsd-current@FreeBSD.ORG Fri Jan 25 20:48:32 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 8B5E4862 for ; Fri, 25 Jan 2013 20:48:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2B060883 for ; Fri, 25 Jan 2013 20:48:31 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0PKmMUt046421; Fri, 25 Jan 2013 22:48:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0PKmMUt046421 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0PKmLpg046420; Fri, 25 Jan 2013 22:48:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Jan 2013 22:48:21 +0200 From: Konstantin Belousov To: Taku YAMAMOTO Subject: Re: [PATCH] to fix slow gen2 Intel video (i830, i845, i85x, i865) with KMS Message-ID: <20130125204821.GY2522@kib.kiev.ua> References: <20130126050654.37ac83fd477464a911b49bf6@tackymt.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hcIbdsWGSbvvNW1J" Content-Disposition: inline In-Reply-To: <20130126050654.37ac83fd477464a911b49bf6@tackymt.homeip.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: FreeBSD Current 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:48:32 -0000 --hcIbdsWGSbvvNW1J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 26, 2013 at 05:06:54AM +0900, Taku YAMAMOTO wrote: > Hi all, >=20 > 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. >=20 > I managed to track down the root cause of the slowness of gen2 with KMS a= nd > finally fixed it. > The attached one-liner patch is the fix. > (It was my surprise that the actual problem lied in agp rather than i915k= ms.) >=20 > --=20 > -|-__ YAMAMOTO, Taku > | __ < >=20 > - A chicken is an egg's way of producing more eggs. - > --- 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 =3D 0; i < 20000 /* 1 sec */; i++) { > hic =3D bus_read_4(sc->sc_res[0], AGP_I830_HIC); > - if ((hic & (1 << 31)) !=3D 0) > + if ((hic & (1 << 31)) =3D=3D 0) > break; > DELAY(50); > } This looks right, comparing our (mine) code and the Linux intel-gtt.c. Thank you for tracking it down. Unfortunately, this magic is not documented at all. The 855GM datasheet I have completely omits a description for the register 0x70 of the host bridge. The only reference we are allowed to see is in the Linux agp driver source. I will wait a little before committing, in the hope that someone gives the change an additional test. --hcIbdsWGSbvvNW1J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRAu+UAAoJEJDCuSvBvK1B9pMQAIqibTx39+2PM1Urc4wL6LTM g4IdQLQ/TQZtitVYMHEC8OtkUNlRe5xxSVTSmng8E8sk+uCFm5JiDgwDrQ6kGAsh 3mDNhsBDe+GXOa9QkaeESoeOyEPCh22LK8NBwF6bBx2cVM9LNmUtmljEEwsLIt5C G/BJNrdV54IjIdp9F6IGUSucn695VjDQm7oJMbm0NLZyxIcKCt5oTD09ojJ59gr+ tCPvGJW8R/wSar1vk/ZpFrgJGF8ahTcbPd1hkhYVP6tXMSTJmSbUCeKWy7xTwCrj Fl8raY/V+3BzzWR9uu5G4KFK+jYZSit20u4HEzTFD3czryoxGUffA2aPQbJpEyYA HlbNQnZ2DvTkXjfcKfIEI87Pnhe6O5FhOOn7KbO2O55uC9MQ/pDUjsCFqH1vMdq+ IeopcAuAJorv1XwdSjRMnAy3HI96SiYKhrXQ9mo648oO2xjmYQzmBg8t1eQ6cL5y LCMq1pYlgZISuyQKp889dtfJQgGpNFUBX8B5hlS5fVzw9vlFJ/1/nkCvxhayJuzM SlXhxJWq8wGocg5wyZ6KqpLIQgJTDVcScOCG30opVnm0WH2clZEX3/Ma8QlED90q YD9SRWW47BgjRP+17BaDof5WxFLxCU+bK2AlScBVzGc1S1R2/kZdi6GrwLr7XUjW P+Ful6QsofOtoznXPHaj =jgSn -----END PGP SIGNATURE----- --hcIbdsWGSbvvNW1J--