mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
intel_gpu_top: Print GPU clock information, which seems interesting.
This commit is contained in:
parent
5e13b98da1
commit
114763f419
@ -86,6 +86,98 @@ add_instdone_bit(uint32_t bit, char *name)
|
|||||||
num_top_bits++;
|
num_top_bits++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_clock(char *name, int clock) {
|
||||||
|
if (clock == -1)
|
||||||
|
printf("%s clock: unknown", name);
|
||||||
|
else
|
||||||
|
printf("%s clock: %d Mhz", name, clock);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
print_clock_info(void)
|
||||||
|
{
|
||||||
|
uint16_t gcfgc;
|
||||||
|
|
||||||
|
if (IS_GM45(devid)) {
|
||||||
|
int core_clock = -1;
|
||||||
|
|
||||||
|
pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC);
|
||||||
|
|
||||||
|
switch (gcfgc & 0xf) {
|
||||||
|
case 8: core_clock = 266;
|
||||||
|
case 9: core_clock = 320;
|
||||||
|
case 11: core_clock = 400;
|
||||||
|
case 13: core_clock = 533;
|
||||||
|
}
|
||||||
|
print_clock("core", core_clock);
|
||||||
|
} else if (IS_965(devid) && IS_MOBILE(devid)) {
|
||||||
|
int render_clock = -1, sampler_clock = -1;
|
||||||
|
|
||||||
|
pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC);
|
||||||
|
|
||||||
|
switch (gcfgc & 0xf) {
|
||||||
|
case 2: render_clock = 250; sampler_clock = 267;
|
||||||
|
case 3: render_clock = 320; sampler_clock = 333;
|
||||||
|
case 4: render_clock = 400; sampler_clock = 444;
|
||||||
|
case 5: render_clock = 500; sampler_clock = 533;
|
||||||
|
}
|
||||||
|
|
||||||
|
print_clock("render", render_clock);
|
||||||
|
printf(" ");
|
||||||
|
print_clock("sampler", sampler_clock);
|
||||||
|
} else if (IS_945(devid) && IS_MOBILE(devid)) {
|
||||||
|
int render_clock = -1, display_clock = -1;
|
||||||
|
|
||||||
|
pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC);
|
||||||
|
|
||||||
|
switch (gcfgc & 0x7) {
|
||||||
|
case 0: render_clock = 166;
|
||||||
|
case 1: render_clock = 200;
|
||||||
|
case 3: render_clock = 250;
|
||||||
|
case 5: render_clock = 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (gcfgc & 0x70) {
|
||||||
|
case 0: display_clock = 200;
|
||||||
|
case 4: display_clock = 320;
|
||||||
|
}
|
||||||
|
if (gcfgc & (1 << 7))
|
||||||
|
display_clock = 133;
|
||||||
|
|
||||||
|
print_clock("render", render_clock);
|
||||||
|
printf(" ");
|
||||||
|
print_clock("display", display_clock);
|
||||||
|
} else if (IS_915(devid) && IS_MOBILE(devid)) {
|
||||||
|
int render_clock = -1, display_clock = -1;
|
||||||
|
|
||||||
|
pci_device_cfg_read_u16(pci_dev, &gcfgc, I915_GCFGC);
|
||||||
|
|
||||||
|
switch (gcfgc & 0x7) {
|
||||||
|
case 0: render_clock = 160;
|
||||||
|
case 1: render_clock = 190;
|
||||||
|
case 4: render_clock = 333;
|
||||||
|
}
|
||||||
|
if (gcfgc & (1 << 13))
|
||||||
|
render_clock = 133;
|
||||||
|
|
||||||
|
switch (gcfgc & 0x70) {
|
||||||
|
case 0: display_clock = 190;
|
||||||
|
case 4: display_clock = 333;
|
||||||
|
}
|
||||||
|
if (gcfgc & (1 << 7))
|
||||||
|
display_clock = 133;
|
||||||
|
|
||||||
|
print_clock("render", render_clock);
|
||||||
|
printf(" ");
|
||||||
|
print_clock("display", display_clock);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
intel_get_mmio();
|
intel_get_mmio();
|
||||||
@ -194,6 +286,9 @@ int main(int argc, char **argv)
|
|||||||
top_bits_sort);
|
top_bits_sort);
|
||||||
|
|
||||||
printf(clear_screen);
|
printf(clear_screen);
|
||||||
|
|
||||||
|
print_clock_info();
|
||||||
|
|
||||||
printf("ring idle: %3d%% ring space: %d/%d (%d%%)\n",
|
printf("ring idle: %3d%% ring space: %d/%d (%d%%)\n",
|
||||||
ring_idle,
|
ring_idle,
|
||||||
total_ring_full / 100, ring_size,
|
total_ring_full / 100, ring_size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user