Enable compilation on non-Intel, non-DRM systems.

A few of the tools can be performed post-mortem from a different system,
so it is useful to be able to compile those tools on those foreign
systems. Obviously, any program to interact with the PCI device or talk
to GEM will fail on a non-Intel system.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2010-04-08 11:56:57 +01:00
parent cd64e19329
commit 95374225e8
29 changed files with 309 additions and 246 deletions
+10 -4
View File
@@ -137,8 +137,9 @@ print_clock(char *name, int clock) {
}
static int
print_clock_info(void)
print_clock_info(struct pci_device *pci_dev)
{
uint32_t devid = pci_dev->device_id;
uint16_t gcfgc;
if (IS_GM45(devid)) {
@@ -284,11 +285,16 @@ print_percentage_bar(float percent, int cur_line_len)
int main(int argc, char **argv)
{
intel_get_mmio();
struct pci_device *pci_dev;
uint32_t ring_size;
uint32_t devid;
int i;
init_instdone_definitions();
pci_dev = intel_get_pci_device();
devid = pci_dev->device_id;
intel_get_mmio(pci_dev);
init_instdone_definitions(devid);
for (i = 0; i < num_instdone_bits; i++) {
top_bits[i].bit = &instdone_bits[i];
top_bits[i].count = 0;
@@ -362,7 +368,7 @@ int main(int argc, char **argv)
printf("%s", clear_screen);
print_clock_info();
print_clock_info(pci_dev);
percent = ring_idle / SAMPLES_TO_PERCENT_RATIO;
len = printf("%30s: %3d%%: ", "ring idle", percent);