Subject: Color Video LKM update (fwd)
To: None <port-mac68k@NetBSD.ORG>
From: Adrian Rollett <acrollet+@andrew.cmu.edu>
List: port-mac68k
Date: 12/02/1997 12:35:36
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-684387517-881084136=:604
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
Content-ID: <Pine.SOL.3.95L.971202123433.604H@unix20.andrew.cmu.edu>

---------- Forwarded message ----------
Date: Sat, 2 Aug 1997 20:40:56 -0700 (PDT)
From: Colin Wood <cwood@ichips.intel.com>
To: port-mac68k@netbsd.org
Subject: Color Video LKM update

Well, after two days of sweat, toil, and frequent panics, I've finally
managed to update Taras Ivanenko's color video LKM to support -current
kernels (i.e. I bus_space-ified it somewhat).  It required a somewhat
gross hack in order to get the MRG glue to work with the bus_space code,
and as a result, I'm pretty sure that it won't work with more than one
monitor (if it did before, that is).  If I have time, I may work on this
as well.  A patch is included for the modified files below.

Anyway, my work on this turned up a small bug in grf_subr.c, and I'm
pretty sure that my LKM update won't work without a fix, so, I've included
a patch for that as well below.  I've submitted a PR on this part, so
hopefully it will be fixed in -current fairly soon.

So, all I can say is that this works for me.  YMMV.  Please let me know if
you have any questions.

Later.

--
Colin Wood                                 cwood@ichips.intel.com
Component Design Engineer - MD6                 Intel Corporation
-----------------------------------------------------------------
I speak only for myself, not for my employer.


---559023410-684387517-881084136=:604
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="grf_subr.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.A32.3.93.970802204056.47766B@pdxcs151>
Content-Description: grf_subr.c patch

KioqIGdyZl9zdWJyLmMJVGh1IEp1bCAzMSAyMTo0MToxNyAxOTk3DQotLS0g
Li4vaXRlZml4L2dyZl9zdWJyLmMJU2F0IEF1ZyAgMiAxNTo1MToyNiAxOTk3
DQoqKioqKioqKioqKioqKioNCioqKiA2OCw3NCAqKioqDQogIAlnYS5nYV9n
cmZtb2RlID0gZ207DQogIAlnYS5nYV9zbG90ID0gc3A7DQogIAlnYS5nYV90
YWcgPSBzYy0+c2NfdGFnOw0KISAJZ2EuZ2FfaGFuZGxlID0gc2MtPnNjX3Rh
ZzsNCiAgCWdhLmdhX21vZGUgPSBnX21vZGU7DQogIAlnYS5nYV9waHlzID0g
Z19waHlzOw0KICAJKHZvaWQpY29uZmlnX2ZvdW5kKCZzYy0+c2NfZGV2LCAm
Z2EsIGdyZmJ1c3ByaW50KTsNCi0tLSA2OCw3NCAtLS0tDQogIAlnYS5nYV9n
cmZtb2RlID0gZ207DQogIAlnYS5nYV9zbG90ID0gc3A7DQogIAlnYS5nYV90
YWcgPSBzYy0+c2NfdGFnOw0KISAJZ2EuZ2FfaGFuZGxlID0gc2MtPnNjX2hh
bmRsZTsNCiAgCWdhLmdhX21vZGUgPSBnX21vZGU7DQogIAlnYS5nYV9waHlz
ID0gZ19waHlzOw0KICAJKHZvaWQpY29uZmlnX2ZvdW5kKCZzYy0+c2NfZGV2
LCAmZ2EsIGdyZmJ1c3ByaW50KTsNCg==
---559023410-684387517-881084136=:604
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="video_lkm.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.A32.3.93.970802204056.47766C@pdxcs151>
Content-Description: video_lkm patch

KioqIHZpZGVvX2xrbS5jCVNhdCBGZWIgMTUgMTc6NDc6MzcgMTk5Nw0KLS0t
IC4uL3ZpZGVvX2xrbS5uZXcvdmlkZW9fbGttLmMJTW9uIEZlYiAyNCAxMjox
NTozNyAxOTk3DQoqKioqKioqKioqKioqKioNCioqKiAxOSwyNCAqKioqDQot
LS0gMTksMjUgLS0tLQ0KICAjaW5jbHVkZSA8dm0vdm1fcGFnZXIuaD4NCiAg
DQogICNpbmNsdWRlIDxtYWM2OGsvbWFjNjhrL21hY3JvbS5oPg0KKyAjaW5j
bHVkZSA8bWFjNjhrL2luY2x1ZGUvYnVzLm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