Date: Sat, 18 Jun 2005 23:09:11 +0400 (MSD) From: "Polakov Alexander" <polachok@narod.ru> To: freebsd-current@freebsd.org Subject: Re: applying the vesa patch to stable for high console resolution Message-ID: <42B47157.000001.26107@camay.yandex.ru> In-Reply-To: <0II8003FRENI4G60@store.etat.lu> References: <0II8003FRENI4G60@store.etat.lu>
next in thread | previous in thread | raw e-mail | index | archive | help
--------------Boundary-00=_BVNA40MWKGMMYJ0CCJD0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit >Hi, >Sorry but I don't know. >You should ask the freebsd-current list. >Regards >Didier > >-----Original Message----- >From: Remington L [mailto:mrl0lz@gmail.com] >Sent: Thursday, June 16, 2005 21:06 >To: Didier Wiroth; freebsd-stable@freebsd.org; >freebsd-questions@freebsd.org >Subject: [SPAM-PAL] Re: applying the vesa patch to stable for high >console resolution I hacked vidcontrol patch a bit, so it worked for me fine just a few weeks ago. The kernel part doesn't need any modifications. -- Alexander Polakov --------------Boundary-00=_BVNA40MWKGMMYJ0CCJD0 Content-Disposition: attachment; Filename="vcc.diff.txt" Content-Type: text/plain; name="vcc.diff.txt" Content-Transfer-Encoding: base64 LS0tIC4vdmlkY29udHJvbC5jLm9yaWcJTW9uIE1heSAgOSAwMDowMjo0MiAyMDA1CisrKyAuL3Zp ZGNvbnRyb2wuYwlNb24gTWF5ICA5IDAwOjA5OjMxIDIwMDUKQEAgLTI2LDYgKzI2LDcgQEAKICAq IFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VD SCBEQU1BR0UuCiAgKi8KIAorCiAjaWZuZGVmIGxpbnQKIHN0YXRpYyBjb25zdCBjaGFyIHJjc2lk W10gPQogICAiJEZyZWVCU0Q6IHNyYy91c3Iuc2Jpbi92aWRjb250cm9sL3ZpZGNvbnRyb2wuYyx2 IDEuNDcgMjAwMy8wOS8xOCAxNjoyMDozMiBlaXZpbmQgRXhwICQiOwpAQCAt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Rv IG9wZW4gZWFjaCBjb21iaW5hdGlvbiBvZiBhIHNwZWNpZmllZCBzZXQKKyAqIG9mIGZpbGUgbmFt ZSBjb21wb25lbnRzLgorICovCisKIEZJTEUgKgogb3Blbmd1ZXNzKGNoYXIgKmFbXSwgY2hhciAq YltdLCBjaGFyICpjW10sIGNoYXIgKmRbXSwgY2hhciAqKm5hbWUpCiB7CkBAIC0xMDUsMTEgKzIy NywxNSBAQAogCQlmb3IgKGogPSAwOyBiW2pdICE9IE5VTEw7IGorKykgewogCQkJZm9yIChrID0g MDsgY1trXSAhPSBOVUxMOyBrKyspIHsKIAkJCQlmb3IgKGwgPSAwOyBkW2xdICE9IE5VTEw7IGwr KykgewotCQkJCQlhc3ByaW50ZihuYW1lLCAiJXMlcyVzJXMiLCBhW2ldLCBiW2pdLAotCQkJCQkg ICAgY1trXSwgZFtsXSk7CisJLy8JCQkJYXNwcmludGYobmFtZSwgIiVzJXMlcyVzIiwgYVtpXSwg YltqXSwKKwkvLwkJCQkgICAgY1trXSwgZFtsXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGFzcHJpbnRmKG5hbWUsICIlcyVzJXMlcyIsCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW2ldLCBiW2pdLCBjW2tdLCBk W2xdKTsKIAkJCQkJZiA9IGZvcGVuKCpuYW1lLCAiciIpOworCiAJCQkJCWlmIChmICE9IE5VTEwp CiAJCQkJCQlyZXR1cm4gKGYpOworCiAJCQkJCWZyZWUoKm5hbWUpOwogCQkJCX0KIAkJCX0KQEAg LTExOCw2ICsyNDQsMTAgQEAKIAlyZXR1cm4gKE5VTEwpOwogfQogCisvKgorICogTG9hZCBhIHNj cmVlbm1hcCBmcm9tIGEgZmlsZSBhbmQgc2V0IGl0LgorICovCisKIHZvaWQKIGxvYWRfc2Nybm1h cChjaGFyICpmaWxlbmFtZSkKIHsKQEAgLTEzMSwyNCArMjYxL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wMCkgfHwgKHZlc2FfY29scyA8PSAw KSkgewotCQkJCXdhcm54KCJpbmNvcnJlY3QgbnVtYmVyIG9mIGNvbHVtbnM6ICVkIiwKLQkJCQkg ICAgICB2ZXNhX2NvbHMpOwotCQkJCXNpemVbMF0gPSBfVkVTQV84MDB4NjAwX0RGTF9DT0xTOwor CisJCWlmIChtb2RlID09IDApIHsKKwkJCWlmIChuZXdfbW9kZV9udW0gPj0gTV9WRVNBX0JBU0Up CisJCQkJbW9kZSA9IF9JTygnVicsIG5ld19tb2RlX251bSAtIE1fVkVTQV9CQVNFKTsKKwkJCWVs c2UKKwkJCQltb2RlID0gX0lPKCdTJywgbmV3X21vZGVfbnVtKTsKKwl9CisKKwkJLyoKKwkJICog VHJ5IHNldHRpbmcgdGhlIG5ldyBtb2RlLgorCQkgKi8KKworCQlpZiAoaW9jdGwoMCwgbW9kZSwg TlVMTCkgPT0gLTEpIHsKKwkJCXJldmVydCgpOworCQkJZXJyYygxLCBlcnJubywgInNldHRpbmcg dmlkZW8gbW9kZSIpOworCQl9CisKKwkJLyoKKwkJICogRm9yIHJhc3RlciBtb2RlcyBpdCdzIG5v dCBlbm91Z2ggdG8ganVzdCBzZXQgdGhlIG1vZGUuCisJCSAqIFdlIGFsc28gbmVlZCB0byBleHBs aWNpdGx5IHNldCB0aGUgcmFzdGVyIG1vZGUuCisJCSAqLworCisJCWlmIChuZXdfbW9kZV9pbmZv LnZpX2ZsYWdzICYgVl9JTkZPX0dSQVBISUNTKSB7CisJCQkvKiBmb250IHNpemUgKi8KKworCQkJ aWYgKGZvbnRfaGVpZ2h0ID09IDApCisJCQkJZm9udF9oZWlnaHQgPSBjdXJfaW5mby5jb25zb2xl X2luZm8uZm9udF9zaXplOworCisJCQlzaXplWzJdID0gZm9udF9oZWlnaHQ7CisKKwkJCS8qIGFk anVzdCBjb2x1bW5zICovCisKKwkJCWlmICgodmVzYV9jb2xzICogOCA+IG5ld19tb2RlX2luZm8u dmlfd2lkdGgpIHx8CisJ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SB7 CisJCQkJcmV2ZXJ0KCk7CisJCQkJZXJyeCgxLCAiYmcgY29sb3IgZm9yIHRleHQgbW9kZXMgbXVz dCBiZSA8IDgiKTsKKwkJCX0KKwkJfSBlbHNlIHsKKwkJCXNldF9jb2xvcnMoKTsKKwkJfQorCX0K KwogCWlmICgob3B0aW5kICE9IGFyZ2MpIHx8IChhcmdjID09IDEpKQogCQl1c2FnZSgpOwogCXJl dHVybiByZXRlcnI7CiB9CisKIAo= --------------Boundary-00=_BVNA40MWKGMMYJ0CCJD0--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42B47157.000001.26107>