diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2010-09-11 18:27:24 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-21 06:37:31 -0400 |
commit | 1b263f246639c4777fbf6cfda932ecd1ea4bebb9 (patch) | |
tree | a93dfc23657a830015b61daffb9d1d77bfb0bb8a /drivers/char/agp/intel-gtt.c | |
parent | bdd30729b68d708c970125aab363931134698f2d (diff) |
intel-gtt: move chipset flush to the gtt driver struct
This is the last differentiator between the different fake agp drivers.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/char/agp/intel-gtt.c')
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index bb222d5f322b..abd422c806c5 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -81,6 +81,7 @@ struct intel_gtt_driver { | |||
81 | * For chipsets that need to support old ums (non-gem) code, this | 81 | * For chipsets that need to support old ums (non-gem) code, this |
82 | * needs to be identical to the various supported agp memory types! */ | 82 | * needs to be identical to the various supported agp memory types! */ |
83 | bool (*check_flags)(unsigned int flags); | 83 | bool (*check_flags)(unsigned int flags); |
84 | void (*chipset_flush)(void); | ||
84 | }; | 85 | }; |
85 | 86 | ||
86 | static struct _intel_private { | 87 | static struct _intel_private { |
@@ -838,7 +839,7 @@ static void intel_i830_setup_flush(void) | |||
838 | * that buffer out, we just fill 1KB and clflush it out, on the assumption | 839 | * that buffer out, we just fill 1KB and clflush it out, on the assumption |
839 | * that it'll push whatever was in there out. It appears to work. | 840 | * that it'll push whatever was in there out. It appears to work. |
840 | */ | 841 | */ |
841 | static void intel_i830_chipset_flush(struct agp_bridge_data *bridge) | 842 | static void i830_chipset_flush(void) |
842 | { | 843 | { |
843 | unsigned int *pg = intel_private.i8xx_flush_page; | 844 | unsigned int *pg = intel_private.i8xx_flush_page; |
844 | 845 | ||
@@ -1062,6 +1063,11 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem, | |||
1062 | return 0; | 1063 | return 0; |
1063 | } | 1064 | } |
1064 | 1065 | ||
1066 | static void intel_fake_agp_chipset_flush(struct agp_bridge_data *bridge) | ||
1067 | { | ||
1068 | intel_private.driver->chipset_flush(); | ||
1069 | } | ||
1070 | |||
1065 | static struct agp_memory *intel_fake_agp_alloc_by_type(size_t pg_count, | 1071 | static struct agp_memory *intel_fake_agp_alloc_by_type(size_t pg_count, |
1066 | int type) | 1072 | int type) |
1067 | { | 1073 | { |
@@ -1163,7 +1169,7 @@ static void intel_i9xx_setup_flush(void) | |||
1163 | "can't ioremap flush page - no chipset flushing\n"); | 1169 | "can't ioremap flush page - no chipset flushing\n"); |
1164 | } | 1170 | } |
1165 | 1171 | ||
1166 | static void intel_i915_chipset_flush(struct agp_bridge_data *bridge) | 1172 | static void i9xx_chipset_flush(void) |
1167 | { | 1173 | { |
1168 | if (intel_private.i9xx_flush_page) | 1174 | if (intel_private.i9xx_flush_page) |
1169 | writel(1, intel_private.i9xx_flush_page); | 1175 | writel(1, intel_private.i9xx_flush_page); |
@@ -1294,7 +1300,7 @@ static const struct agp_bridge_driver intel_830_driver = { | |||
1294 | .agp_alloc_pages = agp_generic_alloc_pages, | 1300 | .agp_alloc_pages = agp_generic_alloc_pages, |
1295 | .agp_destroy_page = agp_generic_destroy_page, | 1301 | .agp_destroy_page = agp_generic_destroy_page, |
1296 | .agp_destroy_pages = agp_generic_destroy_pages, | 1302 | .agp_destroy_pages = agp_generic_destroy_pages, |
1297 | .chipset_flush = intel_i830_chipset_flush, | 1303 | .chipset_flush = intel_fake_agp_chipset_flush, |
1298 | }; | 1304 | }; |
1299 | 1305 | ||
1300 | static const struct agp_bridge_driver intel_915_driver = { | 1306 | static const struct agp_bridge_driver intel_915_driver = { |
@@ -1317,7 +1323,7 @@ static const struct agp_bridge_driver intel_915_driver = { | |||
1317 | .agp_alloc_pages = agp_generic_alloc_pages, | 1323 | .agp_alloc_pages = agp_generic_alloc_pages, |
1318 | .agp_destroy_page = agp_generic_destroy_page, | 1324 | .agp_destroy_page = agp_generic_destroy_page, |
1319 | .agp_destroy_pages = agp_generic_destroy_pages, | 1325 | .agp_destroy_pages = agp_generic_destroy_pages, |
1320 | .chipset_flush = intel_i915_chipset_flush, | 1326 | .chipset_flush = intel_fake_agp_chipset_flush, |
1321 | }; | 1327 | }; |
1322 | 1328 | ||
1323 | static const struct agp_bridge_driver intel_i965_driver = { | 1329 | static const struct agp_bridge_driver intel_i965_driver = { |
@@ -1340,7 +1346,7 @@ static const struct agp_bridge_driver intel_i965_driver = { | |||
1340 | .agp_alloc_pages = agp_generic_alloc_pages, | 1346 | .agp_alloc_pages = agp_generic_alloc_pages, |
1341 | .agp_destroy_page = agp_generic_destroy_page, | 1347 | .agp_destroy_page = agp_generic_destroy_page, |
1342 | .agp_destroy_pages = agp_generic_destroy_pages, | 1348 | .agp_destroy_pages = agp_generic_destroy_pages, |
1343 | .chipset_flush = intel_i915_chipset_flush, | 1349 | .chipset_flush = intel_fake_agp_chipset_flush, |
1344 | }; | 1350 | }; |
1345 | 1351 | ||
1346 | static const struct agp_bridge_driver intel_gen6_driver = { | 1352 | static const struct agp_bridge_driver intel_gen6_driver = { |
@@ -1363,7 +1369,7 @@ static const struct agp_bridge_driver intel_gen6_driver = { | |||
1363 | .agp_alloc_pages = agp_generic_alloc_pages, | 1369 | .agp_alloc_pages = agp_generic_alloc_pages, |
1364 | .agp_destroy_page = agp_generic_destroy_page, | 1370 | .agp_destroy_page = agp_generic_destroy_page, |
1365 | .agp_destroy_pages = agp_generic_destroy_pages, | 1371 | .agp_destroy_pages = agp_generic_destroy_pages, |
1366 | .chipset_flush = intel_i915_chipset_flush, | 1372 | .chipset_flush = intel_fake_agp_chipset_flush, |
1367 | }; | 1373 | }; |
1368 | 1374 | ||
1369 | static const struct agp_bridge_driver intel_g33_driver = { | 1375 | static const struct agp_bridge_driver intel_g33_driver = { |
@@ -1386,7 +1392,7 @@ static const struct agp_bridge_driver intel_g33_driver = { | |||
1386 | .agp_alloc_pages = agp_generic_alloc_pages, | 1392 | .agp_alloc_pages = agp_generic_alloc_pages, |
1387 | .agp_destroy_page = agp_generic_destroy_page, | 1393 | .agp_destroy_page = agp_generic_destroy_page, |
1388 | .agp_destroy_pages = agp_generic_destroy_pages, | 1394 | .agp_destroy_pages = agp_generic_destroy_pages, |
1389 | .chipset_flush = intel_i915_chipset_flush, | 1395 | .chipset_flush = intel_fake_agp_chipset_flush, |
1390 | }; | 1396 | }; |
1391 | 1397 | ||
1392 | static const struct intel_gtt_driver i81x_gtt_driver = { | 1398 | static const struct intel_gtt_driver i81x_gtt_driver = { |
@@ -1397,6 +1403,7 @@ static const struct intel_gtt_driver i8xx_gtt_driver = { | |||
1397 | .setup = i830_setup, | 1403 | .setup = i830_setup, |
1398 | .write_entry = i830_write_entry, | 1404 | .write_entry = i830_write_entry, |
1399 | .check_flags = i830_check_flags, | 1405 | .check_flags = i830_check_flags, |
1406 | .chipset_flush = i830_chipset_flush, | ||
1400 | }; | 1407 | }; |
1401 | static const struct intel_gtt_driver i915_gtt_driver = { | 1408 | static const struct intel_gtt_driver i915_gtt_driver = { |
1402 | .gen = 3, | 1409 | .gen = 3, |
@@ -1404,6 +1411,7 @@ static const struct intel_gtt_driver i915_gtt_driver = { | |||
1404 | /* i945 is the last gpu to need phys mem (for overlay and cursors). */ | 1411 | /* i945 is the last gpu to need phys mem (for overlay and cursors). */ |
1405 | .write_entry = i830_write_entry, | 1412 | .write_entry = i830_write_entry, |
1406 | .check_flags = i830_check_flags, | 1413 | .check_flags = i830_check_flags, |
1414 | .chipset_flush = i9xx_chipset_flush, | ||
1407 | }; | 1415 | }; |
1408 | static const struct intel_gtt_driver g33_gtt_driver = { | 1416 | static const struct intel_gtt_driver g33_gtt_driver = { |
1409 | .gen = 3, | 1417 | .gen = 3, |
@@ -1411,6 +1419,7 @@ static const struct intel_gtt_driver g33_gtt_driver = { | |||
1411 | .setup = i9xx_setup, | 1419 | .setup = i9xx_setup, |
1412 | .write_entry = i965_write_entry, | 1420 | .write_entry = i965_write_entry, |
1413 | .check_flags = i830_check_flags, | 1421 | .check_flags = i830_check_flags, |
1422 | .chipset_flush = i9xx_chipset_flush, | ||
1414 | }; | 1423 | }; |
1415 | static const struct intel_gtt_driver pineview_gtt_driver = { | 1424 | static const struct intel_gtt_driver pineview_gtt_driver = { |
1416 | .gen = 3, | 1425 | .gen = 3, |
@@ -1418,18 +1427,21 @@ static const struct intel_gtt_driver pineview_gtt_driver = { | |||
1418 | .setup = i9xx_setup, | 1427 | .setup = i9xx_setup, |
1419 | .write_entry = i965_write_entry, | 1428 | .write_entry = i965_write_entry, |
1420 | .check_flags = i830_check_flags, | 1429 | .check_flags = i830_check_flags, |
1430 | .chipset_flush = i9xx_chipset_flush, | ||
1421 | }; | 1431 | }; |
1422 | static const struct intel_gtt_driver i965_gtt_driver = { | 1432 | static const struct intel_gtt_driver i965_gtt_driver = { |
1423 | .gen = 4, | 1433 | .gen = 4, |
1424 | .setup = i9xx_setup, | 1434 | .setup = i9xx_setup, |
1425 | .write_entry = i965_write_entry, | 1435 | .write_entry = i965_write_entry, |
1426 | .check_flags = i830_check_flags, | 1436 | .check_flags = i830_check_flags, |
1437 | .chipset_flush = i9xx_chipset_flush, | ||
1427 | }; | 1438 | }; |
1428 | static const struct intel_gtt_driver g4x_gtt_driver = { | 1439 | static const struct intel_gtt_driver g4x_gtt_driver = { |
1429 | .gen = 5, | 1440 | .gen = 5, |
1430 | .setup = i9xx_setup, | 1441 | .setup = i9xx_setup, |
1431 | .write_entry = i965_write_entry, | 1442 | .write_entry = i965_write_entry, |
1432 | .check_flags = i830_check_flags, | 1443 | .check_flags = i830_check_flags, |
1444 | .chipset_flush = i9xx_chipset_flush, | ||
1433 | }; | 1445 | }; |
1434 | static const struct intel_gtt_driver ironlake_gtt_driver = { | 1446 | static const struct intel_gtt_driver ironlake_gtt_driver = { |
1435 | .gen = 5, | 1447 | .gen = 5, |
@@ -1437,12 +1449,14 @@ static const struct intel_gtt_driver ironlake_gtt_driver = { | |||
1437 | .setup = i9xx_setup, | 1449 | .setup = i9xx_setup, |
1438 | .write_entry = i965_write_entry, | 1450 | .write_entry = i965_write_entry, |
1439 | .check_flags = i830_check_flags, | 1451 | .check_flags = i830_check_flags, |
1452 | .chipset_flush = i9xx_chipset_flush, | ||
1440 | }; | 1453 | }; |
1441 | static const struct intel_gtt_driver sandybridge_gtt_driver = { | 1454 | static const struct intel_gtt_driver sandybridge_gtt_driver = { |
1442 | .gen = 6, | 1455 | .gen = 6, |
1443 | .setup = i9xx_setup, | 1456 | .setup = i9xx_setup, |
1444 | .write_entry = gen6_write_entry, | 1457 | .write_entry = gen6_write_entry, |
1445 | .check_flags = gen6_check_flags, | 1458 | .check_flags = gen6_check_flags, |
1459 | .chipset_flush = i9xx_chipset_flush, | ||
1446 | }; | 1460 | }; |
1447 | 1461 | ||
1448 | /* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of | 1462 | /* Table to describe Intel GMCH and AGP/PCIE GART drivers. At least one of |