aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c156
1 files changed, 107 insertions, 49 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 281faca3e37c..3e658d6a6b7d 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1099,60 +1099,118 @@ static int i915_probe_agp(struct drm_device *dev, uint32_t *aperture_size,
1099 else 1099 else
1100 overhead = (*aperture_size / 1024) + 4096; 1100 overhead = (*aperture_size / 1024) + 4096;
1101 1101
1102 switch (tmp & INTEL_GMCH_GMS_MASK) { 1102 if (IS_GEN6(dev)) {
1103 case INTEL_855_GMCH_GMS_DISABLED: 1103 /* SNB has memory control reg at 0x50.w */
1104 /* XXX: This is what my A1 silicon has. */ 1104 pci_read_config_word(dev->pdev, SNB_GMCH_CTRL, &tmp);
1105 if (IS_GEN6(dev)) { 1105
1106 switch (tmp & SNB_GMCH_GMS_STOLEN_MASK) {
1107 case INTEL_855_GMCH_GMS_DISABLED:
1108 DRM_ERROR("video memory is disabled\n");
1109 return -1;
1110 case SNB_GMCH_GMS_STOLEN_32M:
1111 stolen = 32 * 1024 * 1024;
1112 break;
1113 case SNB_GMCH_GMS_STOLEN_64M:
1106 stolen = 64 * 1024 * 1024; 1114 stolen = 64 * 1024 * 1024;
1107 } else { 1115 break;
1116 case SNB_GMCH_GMS_STOLEN_96M:
1117 stolen = 96 * 1024 * 1024;
1118 break;
1119 case SNB_GMCH_GMS_STOLEN_128M:
1120 stolen = 128 * 1024 * 1024;
1121 break;
1122 case SNB_GMCH_GMS_STOLEN_160M:
1123 stolen = 160 * 1024 * 1024;
1124 break;
1125 case SNB_GMCH_GMS_STOLEN_192M:
1126 stolen = 192 * 1024 * 1024;
1127 break;
1128 case SNB_GMCH_GMS_STOLEN_224M:
1129 stolen = 224 * 1024 * 1024;
1130 break;
1131 case SNB_GMCH_GMS_STOLEN_256M:
1132 stolen = 256 * 1024 * 1024;
1133 break;
1134 case SNB_GMCH_GMS_STOLEN_288M:
1135 stolen = 288 * 1024 * 1024;
1136 break;
1137 case SNB_GMCH_GMS_STOLEN_320M:
1138 stolen = 320 * 1024 * 1024;
1139 break;
1140 case SNB_GMCH_GMS_STOLEN_352M:
1141 stolen = 352 * 1024 * 1024;
1142 break;
1143 case SNB_GMCH_GMS_STOLEN_384M:
1144 stolen = 384 * 1024 * 1024;
1145 break;
1146 case SNB_GMCH_GMS_STOLEN_416M:
1147 stolen = 416 * 1024 * 1024;
1148 break;
1149 case SNB_GMCH_GMS_STOLEN_448M:
1150 stolen = 448 * 1024 * 1024;
1151 break;
1152 case SNB_GMCH_GMS_STOLEN_480M:
1153 stolen = 480 * 1024 * 1024;
1154 break;
1155 case SNB_GMCH_GMS_STOLEN_512M:
1156 stolen = 512 * 1024 * 1024;
1157 break;
1158 default:
1159 DRM_ERROR("unexpected GMCH_GMS value: 0x%02x\n",
1160 tmp & SNB_GMCH_GMS_STOLEN_MASK);
1161 return -1;
1162 }
1163 } else {
1164 switch (tmp & INTEL_GMCH_GMS_MASK) {
1165 case INTEL_855_GMCH_GMS_DISABLED:
1108 DRM_ERROR("video memory is disabled\n"); 1166 DRM_ERROR("video memory is disabled\n");
1109 return -1; 1167 return -1;
1168 case INTEL_855_GMCH_GMS_STOLEN_1M:
1169 stolen = 1 * 1024 * 1024;
1170 break;
1171 case INTEL_855_GMCH_GMS_STOLEN_4M:
1172 stolen = 4 * 1024 * 1024;
1173 break;
1174 case INTEL_855_GMCH_GMS_STOLEN_8M:
1175 stolen = 8 * 1024 * 1024;
1176 break;
1177 case INTEL_855_GMCH_GMS_STOLEN_16M:
1178 stolen = 16 * 1024 * 1024;
1179 break;
1180 case INTEL_855_GMCH_GMS_STOLEN_32M:
1181 stolen = 32 * 1024 * 1024;
1182 break;
1183 case INTEL_915G_GMCH_GMS_STOLEN_48M:
1184 stolen = 48 * 1024 * 1024;
1185 break;
1186 case INTEL_915G_GMCH_GMS_STOLEN_64M:
1187 stolen = 64 * 1024 * 1024;
1188 break;
1189 case INTEL_GMCH_GMS_STOLEN_128M:
1190 stolen = 128 * 1024 * 1024;
1191 break;
1192 case INTEL_GMCH_GMS_STOLEN_256M:
1193 stolen = 256 * 1024 * 1024;
1194 break;
1195 case INTEL_GMCH_GMS_STOLEN_96M:
1196 stolen = 96 * 1024 * 1024;
1197 break;
1198 case INTEL_GMCH_GMS_STOLEN_160M:
1199 stolen = 160 * 1024 * 1024;
1200 break;
1201 case INTEL_GMCH_GMS_STOLEN_224M:
1202 stolen = 224 * 1024 * 1024;
1203 break;
1204 case INTEL_GMCH_GMS_STOLEN_352M:
1205 stolen = 352 * 1024 * 1024;
1206 break;
1207 default:
1208 DRM_ERROR("unexpected GMCH_GMS value: 0x%02x\n",
1209 tmp & INTEL_GMCH_GMS_MASK);
1210 return -1;
1110 } 1211 }
1111 break;
1112 case INTEL_855_GMCH_GMS_STOLEN_1M:
1113 stolen = 1 * 1024 * 1024;
1114 break;
1115 case INTEL_855_GMCH_GMS_STOLEN_4M:
1116 stolen = 4 * 1024 * 1024;
1117 break;
1118 case INTEL_855_GMCH_GMS_STOLEN_8M:
1119 stolen = 8 * 1024 * 1024;
1120 break;
1121 case INTEL_855_GMCH_GMS_STOLEN_16M:
1122 stolen = 16 * 1024 * 1024;
1123 break;
1124 case INTEL_855_GMCH_GMS_STOLEN_32M:
1125 stolen = 32 * 1024 * 1024;
1126 break;
1127 case INTEL_915G_GMCH_GMS_STOLEN_48M:
1128 stolen = 48 * 1024 * 1024;
1129 break;
1130 case INTEL_915G_GMCH_GMS_STOLEN_64M:
1131 stolen = 64 * 1024 * 1024;
1132 break;
1133 case INTEL_GMCH_GMS_STOLEN_128M:
1134 stolen = 128 * 1024 * 1024;
1135 break;
1136 case INTEL_GMCH_GMS_STOLEN_256M:
1137 stolen = 256 * 1024 * 1024;
1138 break;
1139 case INTEL_GMCH_GMS_STOLEN_96M:
1140 stolen = 96 * 1024 * 1024;
1141 break;
1142 case INTEL_GMCH_GMS_STOLEN_160M:
1143 stolen = 160 * 1024 * 1024;
1144 break;
1145 case INTEL_GMCH_GMS_STOLEN_224M:
1146 stolen = 224 * 1024 * 1024;
1147 break;
1148 case INTEL_GMCH_GMS_STOLEN_352M:
1149 stolen = 352 * 1024 * 1024;
1150 break;
1151 default:
1152 DRM_ERROR("unexpected GMCH_GMS value: 0x%02x\n",
1153 tmp & INTEL_GMCH_GMS_MASK);
1154 return -1;
1155 } 1212 }
1213
1156 *preallocated_size = stolen - overhead; 1214 *preallocated_size = stolen - overhead;
1157 *start = overhead; 1215 *start = overhead;
1158 1216