diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-01-29 14:27:07 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-02-22 11:46:54 -0500 |
commit | f97108d1d0facc7902134ebc453b226bbd4d1cdb (patch) | |
tree | 563d14cb7c65b80e16df9246da25cade22f22fdd /drivers/gpu/drm/i915/i915_debugfs.c | |
parent | ee980b8003a25fbfed50c3367f2b426c870eaf90 (diff) |
drm/i915: add dynamic performance control support for Ironlake
Ironlake (and 965GM, which this patch doesn't support) supports a
hardware performance and power management feature that allows it to
adjust to changes in GPU load over time with software help. The goal
if this is to maximize performance/power for a given workload.
This patch enables that feature, which is also a requirement for
supporting Intelligent Power Sharing, a feature which allows for
dynamic budgeting of power between the CPU and GPU in Arrandale
platforms.
Tested-by: ykzhao <yakui.zhao@intel.com>
[anholt: Resolved against the irq handler loop removal]
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index a894ade03093..55340de618ea 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -386,6 +386,97 @@ out: | |||
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | 388 | ||
389 | static int i915_rstdby_delays(struct seq_file *m, void *unused) | ||
390 | { | ||
391 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
392 | struct drm_device *dev = node->minor->dev; | ||
393 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
394 | u16 crstanddelay = I915_READ16(CRSTANDVID); | ||
395 | |||
396 | seq_printf(m, "w/ctx: %d, w/o ctx: %d\n", (crstanddelay >> 8) & 0x3f, (crstanddelay & 0x3f)); | ||
397 | |||
398 | return 0; | ||
399 | } | ||
400 | |||
401 | static int i915_cur_delayinfo(struct seq_file *m, void *unused) | ||
402 | { | ||
403 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
404 | struct drm_device *dev = node->minor->dev; | ||
405 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
406 | u16 rgvswctl = I915_READ16(MEMSWCTL); | ||
407 | |||
408 | seq_printf(m, "Last command: 0x%01x\n", (rgvswctl >> 13) & 0x3); | ||
409 | seq_printf(m, "Command status: %d\n", (rgvswctl >> 12) & 1); | ||
410 | seq_printf(m, "P%d DELAY 0x%02x\n", (rgvswctl >> 8) & 0xf, | ||
411 | rgvswctl & 0x3f); | ||
412 | |||
413 | return 0; | ||
414 | } | ||
415 | |||
416 | static int i915_delayfreq_table(struct seq_file *m, void *unused) | ||
417 | { | ||
418 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
419 | struct drm_device *dev = node->minor->dev; | ||
420 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
421 | u32 delayfreq; | ||
422 | int i; | ||
423 | |||
424 | for (i = 0; i < 16; i++) { | ||
425 | delayfreq = I915_READ(PXVFREQ_BASE + i * 4); | ||
426 | seq_printf(m, "P%02dVIDFREQ: 0x%08x\n", i, delayfreq); | ||
427 | } | ||
428 | |||
429 | return 0; | ||
430 | } | ||
431 | |||
432 | static inline int MAP_TO_MV(int map) | ||
433 | { | ||
434 | return 1250 - (map * 25); | ||
435 | } | ||
436 | |||
437 | static int i915_inttoext_table(struct seq_file *m, void *unused) | ||
438 | { | ||
439 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
440 | struct drm_device *dev = node->minor->dev; | ||
441 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
442 | u32 inttoext; | ||
443 | int i; | ||
444 | |||
445 | for (i = 1; i <= 32; i++) { | ||
446 | inttoext = I915_READ(INTTOEXT_BASE_ILK + i * 4); | ||
447 | seq_printf(m, "INTTOEXT%02d: 0x%08x\n", i, inttoext); | ||
448 | } | ||
449 | |||
450 | return 0; | ||
451 | } | ||
452 | |||
453 | static int i915_drpc_info(struct seq_file *m, void *unused) | ||
454 | { | ||
455 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
456 | struct drm_device *dev = node->minor->dev; | ||
457 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
458 | u32 rgvmodectl = I915_READ(MEMMODECTL); | ||
459 | |||
460 | seq_printf(m, "HD boost: %s\n", (rgvmodectl & MEMMODE_BOOST_EN) ? | ||
461 | "yes" : "no"); | ||
462 | seq_printf(m, "Boost freq: %d\n", | ||
463 | (rgvmodectl & MEMMODE_BOOST_FREQ_MASK) >> | ||
464 | MEMMODE_BOOST_FREQ_SHIFT); | ||
465 | seq_printf(m, "HW control enabled: %s\n", | ||
466 | rgvmodectl & MEMMODE_HWIDLE_EN ? "yes" : "no"); | ||
467 | seq_printf(m, "SW control enabled: %s\n", | ||
468 | rgvmodectl & MEMMODE_SWMODE_EN ? "yes" : "no"); | ||
469 | seq_printf(m, "Gated voltage change: %s\n", | ||
470 | rgvmodectl & MEMMODE_RCLK_GATE ? "yes" : "no"); | ||
471 | seq_printf(m, "Starting frequency: P%d\n", | ||
472 | (rgvmodectl & MEMMODE_FSTART_MASK) >> MEMMODE_FSTART_SHIFT); | ||
473 | seq_printf(m, "Max frequency: P%d\n", | ||
474 | (rgvmodectl & MEMMODE_FMAX_MASK) >> MEMMODE_FMAX_SHIFT); | ||
475 | seq_printf(m, "Min frequency: P%d\n", (rgvmodectl & MEMMODE_FMIN_MASK)); | ||
476 | |||
477 | return 0; | ||
478 | } | ||
479 | |||
389 | static int | 480 | static int |
390 | i915_wedged_open(struct inode *inode, | 481 | i915_wedged_open(struct inode *inode, |
391 | struct file *filp) | 482 | struct file *filp) |
@@ -503,6 +594,11 @@ static struct drm_info_list i915_debugfs_list[] = { | |||
503 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, | 594 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, |
504 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, | 595 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, |
505 | {"i915_error_state", i915_error_state, 0}, | 596 | {"i915_error_state", i915_error_state, 0}, |
597 | {"i915_rstdby_delays", i915_rstdby_delays, 0}, | ||
598 | {"i915_cur_delayinfo", i915_cur_delayinfo, 0}, | ||
599 | {"i915_delayfreq_table", i915_delayfreq_table, 0}, | ||
600 | {"i915_inttoext_table", i915_inttoext_table, 0}, | ||
601 | {"i915_drpc_info", i915_drpc_info, 0}, | ||
506 | }; | 602 | }; |
507 | #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) | 603 | #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) |
508 | 604 | ||