Subject: kern/34747: Support for 64MB shared memory Intel AGP parts
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <seebs@seebs.net>
List: netbsd-bugs
Date: 10/07/2006 21:00:00
>Number:         34747
>Category:       kern
>Synopsis:       agp doesn't recognize new 950 chip with 64MB stolen memory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 07 21:00:00 +0000 2006
>Originator:     Seebs
>Release:        NetBSD-current, 2006/10/06
>Organization:
>Environment:
Architecture: i386
Machine: i386
>Description:
	On the Mac Mini (intel core duo), the AGP driver doesn't configure.
>How-To-Repeat:
	Boot.
>Fix:
This patch adds debugging information (useful in an error message like this),
and adds a setting based on Apple's claims that this machine has "64MB" of
shared video memory.  It may be incorrect!  The available memory detected by
the kernel, and by X.org, suggests that this may really be 32MB, and Apple's
just wrong, or it may be that the amount of video memory is configurable
during boot-time initialization, and it's been set to 32MB.

But nothing seems to be crashing...

Index: agp_i810.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/agp_i810.c,v
retrieving revision 1.33
diff -c -r1.33 agp_i810.c
*** agp_i810.c	24 Sep 2006 03:53:09 -0000	1.33
--- agp_i810.c	7 Oct 2006 19:50:41 -0000
***************
*** 301,307 ****
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown memory configuration, disabling\n");
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
--- 301,308 ----
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown memory configuration 0x%x, disabling\n",
! 			    gcc1 & AGP_I830_GCC1_GMS);
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
***************
*** 343,349 ****
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown memory configuration, disabling\n");
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
--- 344,351 ----
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown 855 memory configuration %d, disabling\n",
! 			    gcc1 & AGP_I855_GCC1_GMS);
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
***************
*** 376,385 ****
  		case AGP_I915_GCC1_GMS_STOLEN_8M:
  			isc->stolen = (8192 - 260) * 1024 / 4096;
  			break;
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown memory configuration, disabling\n");
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
--- 378,391 ----
  		case AGP_I915_GCC1_GMS_STOLEN_8M:
  			isc->stolen = (8192 - 260) * 1024 / 4096;
  			break;
+ 		case AGP_I915_GCC1_GMS_STOLEN_64M:
+ 			isc->stolen = (65536 - 260) * 1024 / 4096;
+ 			break;
  		default:
  			isc->stolen = 0;
  			aprint_error(
! 			    ": unknown 915 memory configuration 0x%x, disabling\n",
! 			    gcc1 & AGP_I915_GCC1_GMS);
  			agp_generic_detach(sc);
  			return EINVAL;
  		}
Index: agpreg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/agpreg.h,v
retrieving revision 1.10
diff -c -r1.10 agpreg.h
*** agpreg.h	16 Jan 2006 22:59:36 -0000	1.10
--- agpreg.h	7 Oct 2006 19:50:42 -0000
***************
*** 216,221 ****
--- 216,222 ----
  #define 	AGP_I915_GCC1_GMS_STOLEN_0M	0x00
  #define 	AGP_I915_GCC1_GMS_STOLEN_1M	0x10
  #define 	AGP_I915_GCC1_GMS_STOLEN_8M	0x30
+ #define 	AGP_I915_GCC1_GMS_STOLEN_64M	0x40
  #define AGP_I915_MSAC			0x62
  #define 	AGP_I915_MSAC_APER_128M		0x02