Date: Mon, 31 May 2010 13:39:29 -0700 From: Brian Somers <brian@FreeBSD.org> To: gljennjohn@googlemail.com Cc: x11@FreeBSD.org Subject: Re: xf86-video-mga patch Message-ID: <20100531133929.0f035c0c@FreeBSD.org> In-Reply-To: <20100531115939.06d6eea5@ernst.jennejohn.org> References: <20100531011111.22064479@dev.lan.Awfulhak.org> <20100531115939.06d6eea5@ernst.jennejohn.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/NGnUAFP4z1_5h6D+CG3Su+m Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 31 May 2010 11:59:39 +0200, Gary Jennejohn <gljennjohn@googlemail.com> wrote: > On Mon, 31 May 2010 01:11:11 -0700 > Brian Somers <brian@FreeBSD.org> wrote: > > > Hi, > > > > Since upgrading to xorg-7.5 (on -current) my dual-head matrox g450 configuration > > has broken with the following error: > > > > "MGA(0): Unable to map BAR 0. Invalid argument (22)" > > > > This is talked about on various forums and can be fixed with the attached patch. > > > > ENPOATCH > > -- > Gary Jennejohn Oops, what a moron. I've attached it this time! -- Brian Somers <brian@Awfulhak.org> Don't _EVER_ lose your sense of humour ! <brian@FreeBSD.org> --MP_/NGnUAFP4z1_5h6D+CG3Su+m Content-Type: application/octet-stream; name=patch-mga-driver-3 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=patch-mga-driver-3 ZGlmZiAtdXJOIG9sZC1zcmMvbWdhX2RyaXZlci5jIHNyYy9tZ2FfZHJpdmVyLmMKLS0tIG9sZC1z cmMvbWdhX2RyaXZlci5jCTIwMDgtMTEtMTMgMTU6MTE6MzUuMDAwMDAwMDAwICswMDAwCisrKyBz cmMvbWdhX2RyaXZlci5jCTIwMDgtMTEtMTMgMTU6MTc6MjQuMDAwMDAwMDAwICswMDAwCkBAIC0y OTkwLDMwICsyOTk0LDU3IEBACiAjaWZkZWYgWFNFUlZFUl9MSUJQQ0lBQ0NFU1MKICAgICBzdHJ1 Y3QgcGNpX2RldmljZSAqY29uc3QgZGV2ID0gcE1nYS0+UGNpSW5mbzsKICAgICBzdHJ1Y3QgcGNp X21lbV9yZWdpb24gKnJlZ2lvbjsKLSAgICB2b2lkICoqbWVtb3J5WzJdOwogICAgIGludCBpLCBl cnI7CiAjZW5kaWYKIAogCiAgICAgaWYgKCFwTWdhLT5GQkRldikgewogI2lmZGVmIFhTRVJWRVJf TElCUENJQUNDRVNTCi0gICAgICAgIG1lbW9yeVtwTWdhLT5pb19iYXJdID0gJnBNZ2EtPklPQmFz ZTsKLSAgICAgICAgbWVtb3J5W3BNZ2EtPmZyYW1lYnVmZmVyX2Jhcl0gPSAmcE1nYS0+RmJCYXNl OwogCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspIHsKLSAgICAgICAgICAgIHJlZ2lv biA9ICZkZXYtPnJlZ2lvbnNbaV07Ci0gICAgICAgICAgICBlcnIgPSBwY2lfZGV2aWNlX21hcF9y YW5nZShkZXYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24t PmJhc2VfYWRkciwgcmVnaW9uLT5zaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgUENJX0RFVl9NQVBfRkxBR19XUklUQUJMRSwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIG1lbW9yeVtpXSk7CisJICAgIHBjaWFkZHJfdCBmYmFkZHIgPSBw TWdhLT5GYkFkZHJlc3M7CisJICAgIHBjaWFkZHJfdCBmYnNpemUgPSBwTWdhLT5GYk1hcFNpemU7 CisJZXJyID0gcGNpX2RldmljZV9tYXBfcmFuZ2UoZGV2LAorCQkJCSAgIGZiYWRkciwgZmJzaXpl LAorCQkJCSAgIFBDSV9ERVZfTUFQX0ZMQUdfV1JJVEFCTEUsCisJCQkJICAgKHZvaWQgKiopJnBN Z2EtPkZiQmFzZSk7CiAKLSAgICAgICAgICAgIGlmIChlcnIpIHsKKwlpZiAoZXJyKSB7CiAgICAg ICAgICAgICAgICAgeGY4NkRydk1zZyhwU2Nybi0+c2NybkluZGV4LCBYX0VSUk9SLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgIlVuYWJsZSB0byBtYXAgQkFSICVpLiAgJXMgKCVkKVxuIiwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIHN0cmVycm9yKGVyciksIGVycik7CisgICAg ICAgICAgICAgICAgICAgICAgICAgICAiVW5hYmxlIHRvIG1hcCBGcmFtZWJ1ZmZlciAlMDhsbFgg JWxseC4gICVzICglZClcbiIsIChsb25nIGxvbmcpZmJhZGRyLCAobG9uZyBsb25nKWZic2l6ZSwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVycm9yKGVyciksIGVycik7CiAgICAgICAg ICAgICAgICAgcmV0dXJuIEZBTFNFOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJfQorCWVs c2UKKyAgICAgICAgICAgICAgICB4Zjg2RHJ2TXNnKHBTY3JuLT5zY3JuSW5kZXgsIFhfSU5GTywK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICJNQVBQRUQgRnJhbWVidWZmZXIgJTA4bGxYICVs bHggdG8gJTA4bGxYLlxuIiwgKGxvbmcgbG9uZylmYmFkZHIsIChsb25nIGxvbmcpZmJzaXplLCAo bG9uZyBsb25nKXBNZ2EtPkZiQmFzZSk7CisKKwkKKwlpZihwTWdhLT5lbnRpdHlQcml2YXRlID09 IE5VTEwgfHwgcE1nYS0+ZW50aXR5UHJpdmF0ZS0+bWFwcGVkSU9Vc2FnZSA9PSAwKQorCXsKKwkJ cmVnaW9uID0gJmRldi0+cmVnaW9uc1twTWdhLT5pb19iYXJdOworCQllcnIgPSBwY2lfZGV2aWNl X21hcF9yYW5nZShkZXYsCisJCQkJICAgcmVnaW9uLT5iYXNlX2FkZHIsIHJlZ2lvbi0+c2l6ZSwK KwkJCQkgICBQQ0lfREVWX01BUF9GTEFHX1dSSVRBQkxFLAorCQkJCSAgICZw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AogICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24tPmJhc2VfYWRkciwgcmVnaW9u LT5zaXplLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQ0lfREVWX01BUF9G TEFHX1dSSVRBQkxFLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAq KSAmcE1nYS0+SUxPQURCYXNlKTsKLQlpZiAoZXJyKSB7Ci0JICAgIHhmODZEcnZNc2cocFNjcm4t PnNjcm5JbmRleCwgWF9FUlJPUiwKLQkJICAgICAgICJVbmFibGUgdG8gbWFwIEJBUiAyIChJTE9B RCByZWdpb24pLiAgJXMgKCVkKVxuIiwKLQkJICAgICAgIHN0cmVycm9yKGVyciksIGVycik7Ci0J ICAgIHJldHVybiBGQUxTRTsKKwkJaWYgKGVycikgeworCQkJeGY4NkRydk1zZyhwU2Nybi0+c2Ny bkluZGV4LCBYX0VSUk9SLAorCQkJCSAgICJVbmFibGUgdG8gbWFwIEJBUiAyIChJTE9BRCByZWdp b24pLiAgJXMgKCVkKVxuIiwKKwkJCQkgICBzdHJlcnJvcihlcnIpLCBlcnIpOworCQkJcmV0dXJu IEZBTFNFOworCQl9CisKKwkJaWYocE1nYS0+ZW50aXR5UHJpdmF0ZSAhPSBOVUxMKQorCQkJcE1n YS0+ZW50aXR5UHJpdmF0ZS0+bWFwcGVkSUxPQURCYXNlID0gcE1nYS0+SUxPQURCYXNlOwogCX0K KwllbHNlCisJCXBNZ2EtPklMT0FEQmFzZSA9IHBNZ2EtPmVudGl0eVByaXZhdGUtPm1hcHBlZElM T0FEQmFzZTsKKworCWlmKHBNZ2EtPmVudGl0eVByaXZhdGUgIT0gTlVMTCkKKwkJcE1nYS0+ZW50 aXR5UHJpdmF0ZS0+bWFwcGVkSUxPQURVc2FnZSArKzsKICNlbHNlCiAJcE1nYS0+SUxPQURCYXNl ID0geGY4Nk1hcFBjaU1lbShwU2Nybi0+c2NybkluZGV4LAogCQk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pbnRlcilwTWdhLT5JTE9BREJhc2UsIDB4ODAwMDAwKTsKICNlbmRpZgpkaWZmIC11ck4g b2xkLXNyYy9tZ2EuaCBzcmMvbWdhLmgKLS0tIG9sZC1zcmMvbWdhLmgJMjAwOC0xMS0xMyAxNTox MTozNS4wMDAwMDAwMDAgKzAwMDAKKysrIHNyYy9tZ2EuaAkyMDA4LTExLTEzIDE1OjE3OjEzLjAw MDAwMDAwMCArMDAwMApAQCAtMzMzLDYgKzMzMywxMyBAQAogICAgIGludAkJCW1hc3RlcnZpZGVv UmFtOwogICAgIGludAkJCXNsYXZldmlkZW9SYW07CiAgICAgQm9vbAkJZGlyZWN0UmVuZGVyaW5n RW5hYmxlZDsKKworICAgIHZvaWQgICoJCW1hcHBlZElPQmFzZTsKKyAgICBpbnQJCQltYXBwZWRJ T1VzYWdlOworCisgICAgdm9pZCAgKgkJbWFwcGVkSUxPQURCYXNlOworICAgIGludAkJCW1hcHBl ZElMT0FEVXNhZ2U7CisKICAgICBTY3JuSW5mb1B0ciAJcFNjcm5fMTsKICAgICBTY3JuSW5mb1B0 ciAJcFNjcm5fMjsKIH0gTUdBRW50UmVjLCAqTUdBRW50UHRyOwo= --MP_/NGnUAFP4z1_5h6D+CG3Su+m--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100531133929.0f035c0c>