summaryrefslogtreecommitdiff
path: root/tools/intel_gtt.c
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2014-03-19 09:22:53 -0700
committerBen Widawsky <benjamin.widawsky@intel.com>2014-03-19 10:14:57 -0700
commitd92c2cf1deafe1cb2404844b52c17817e0e1ba56 (patch)
tree3721a6bce765575a56a4c5164a977c5b482b0024 /tools/intel_gtt.c
parent00bd3eba11de4ce4a7dacc62f131b401f7dfbabc (diff)
intel_gtt: Dump the whole GTT
The tool formerly only dumped the aperture size, which is fine, but not everything interesting. Most of the patch is just the variable rename. The real work happens with using the BAR0 size divided by 2 instead of the BAR2 size. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Diffstat (limited to 'tools/intel_gtt.c')
-rw-r--r--tools/intel_gtt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/intel_gtt.c b/tools/intel_gtt.c
index 1f1b8820..a21c26a7 100644
--- a/tools/intel_gtt.c
+++ b/tools/intel_gtt.c
@@ -93,7 +93,7 @@ static void pte_dump(int size, uint32_t offset) {
int main(int argc, char **argv)
{
struct pci_device *pci_dev;
- int start, aper_size;
+ int start, gtt_size;
int flag[] = {
PCI_DEV_MAP_FLAG_WRITE_COMBINE,
PCI_DEV_MAP_FLAG_WRITABLE,
@@ -136,20 +136,20 @@ int main(int argc, char **argv)
exit(1);
}
- aper_size = pci_dev->regions[2].size;
+ gtt_size = pci_dev->regions[0].size / 2;
if (argc > 1 && !strncmp("-d", argv[1], 2)) {
- pte_dump(aper_size, 0);
+ pte_dump(gtt_size, 0);
return 0;
}
- for (start = 0; start < aper_size; start += KB(4)) {
+ for (start = 0; start < gtt_size; start += KB(4)) {
uint64_t start_phys = get_phys(start);
uint32_t end;
int constant_length = 0;
int linear_length = 0;
/* Check if it's a linear sequence */
- for (end = start + KB(4); end < aper_size; end += KB(4)) {
+ for (end = start + KB(4); end < gtt_size; end += KB(4)) {
uint64_t end_phys = get_phys(end);
if (end_phys == start_phys + (end - start))
linear_length++;
@@ -166,7 +166,7 @@ int main(int argc, char **argv)
}
/* Check if it's a constant sequence */
- for (end = start + KB(4); end < aper_size; end += KB(4)) {
+ for (end = start + KB(4); end < gtt_size; end += KB(4)) {
uint64_t end_phys = get_phys(end);
if (end_phys == start_phys)
constant_length++;