lkml.org 
[lkml]   [2010]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 17/23] agp: Make agp_generic_[create|free]_gatt_table be aware of PCI API.
Date
In case the platform does not use the PCI API, we want to
still use the old mechanism of saving the gatt_bus_addr.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/char/agp/generic.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index b21eebb..534dccb 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -911,6 +911,7 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
temp = bridge->current_size;
size = page_order = num_entries = 0;

+ bridge->gatt_bus_addr = DMA_ERROR_CODE;
if (bridge->driver->size_type != FIXED_APER_SIZE) {
do {
switch (bridge->driver->size_type) {
@@ -999,10 +1000,12 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
ClearPageReserved(page);

free_gatt_pages(bridge, page_order);
-
+ bridge->gatt_bus_addr = DMA_ERROR_CODE;
return -ENOMEM;
}
- bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
+ /* If using PCI API, alloc_gatt_pages would fill in gatt_bus_addr. */
+ if (bridge->gatt_bus_addr == DMA_ERROR_CODE)
+ bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);

/* AK: bogus, should encode addresses > 4GB */
for (i = 0; i < num_entries; i++) {
--
1.7.1


\
 
 \ /
  Last update: 2010-12-07 00:33    [W:0.083 / U:2.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site