]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/x86_agpgart-g33-stoeln-fix-2.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / x86_agpgart-g33-stoeln-fix-2.patch
CommitLineData
2cb7cef9
BS
1From: Brandon Philips <bphilips@suse.de>
2Subject: Avoid oops on G33 in 1MB stolen Mem case
3References: bnc#391261
4Patch-Mainline: soon (see bug for ref)
5
6This is similar to f443675affe3f16dd428e46f0f7fd3f4d703eeab which was
7reverted because it broke with older XOrg driver. This patch only fixes
8the 1MB stolen case since it causes an oops due to a calculation
9problem.
10
11This will not work with older X drivers without the accompanying patch
12but I think avoiding an oops and making it possible to work with an
13up-to-date xorg driver is reasonable.
14
15Explanation of the oops:
16
17> static void intel_i830_init_gtt_entries(void)
18...
19> } else if (IS_G33) {
20> /* G33's GTT size defined in gmch_ctrl */
21> switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
22> case G33_PGETBL_SIZE_1M:
23> size = 1024;
24> break;
25...
26> size += 4;
27
28size = 1028
29
30Then since we have the BIOS setting 1MB for the device in the GMCH
31control we get to here:
32
33> } else {
34> switch (gmch_ctrl & I855_GMCH_GMS_MASK) {
35> case I855_GMCH_GMS_STOLEN_1M:
36> gtt_entries = MB(1) - KB(size);
37> break;
38
39MB(1) = 1 * 1024 * 1024
40KB(1028) = 1028 * 1024
41
42MB(1) - KB(1028) = -4096
43
44> gtt_entries /= KB(4);
45> intel_private.gtt_entries = gtt_entries;
46
47We end up with -1 in gtt_entries.
48
49This leads to intel_i915_configure reading/writing to areas outside of
50mapped memory and the oops.
51
52Signed-off-by: Brandon Philips <bphilips@suse.de>
53Acked-by: Thomas Renninger <trenn@suse.de>
54
55---
56 drivers/char/agp/intel-agp.c | 7 +++++++
57 1 file changed, 7 insertions(+)
58
59--- a/drivers/char/agp/intel-agp.c
60+++ b/drivers/char/agp/intel-agp.c
61@@ -564,6 +564,13 @@ static void intel_i830_init_gtt_entries(
62 } else {
63 switch (gmch_ctrl & I855_GMCH_GMS_MASK) {
64 case I855_GMCH_GMS_STOLEN_1M:
65+ if (IS_G33) {
66+ size = 0;
67+ printk(KERN_WARNING PFX
68+ "Warning: G33 chipset with 1MB"
69+ " allocated. Older X.org Intel drivers"
70+ " will not work.\n");
71+ }
72 gtt_entries = MB(1) - KB(size);
73 break;
74 case I855_GMCH_GMS_STOLEN_4M: