diff options
author | Roy Spliet <r.spliet@student.tudelft.nl> | 2010-10-19 19:09:56 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-11-17 23:39:00 -0500 |
commit | cac8f05b4294d18cfa940511c286ca03aa6590ad (patch) | |
tree | b84940b2958474eb74852950beff09cdb14d1596 /drivers | |
parent | 9d5a6c4353eeac1e0095e731a0a746254f23af83 (diff) |
drm/nouveau/pm: improve memtiming mappings
Improvements:
- Fix bug in switch statement
- Add parts of 0x10022c, 0x10023c
- Clean up 0x100234
- Comment out assumption in 0x100228 until verified
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_mem.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index ac3bec024fd5..fe4a30dc4b42 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
@@ -651,6 +651,7 @@ nouveau_mem_gart_init(struct drm_device *dev) | |||
651 | void | 651 | void |
652 | nouveau_mem_timing_init(struct drm_device *dev) | 652 | nouveau_mem_timing_init(struct drm_device *dev) |
653 | { | 653 | { |
654 | /* cards < NVC0 only */ | ||
654 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 655 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
655 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 656 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
656 | struct nouveau_pm_memtimings *memtimings = &pm->memtimings; | 657 | struct nouveau_pm_memtimings *memtimings = &pm->memtimings; |
@@ -717,14 +718,14 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
717 | tUNK_19 = 1; | 718 | tUNK_19 = 1; |
718 | tUNK_20 = 0; | 719 | tUNK_20 = 0; |
719 | tUNK_21 = 0; | 720 | tUNK_21 = 0; |
720 | switch (min(recordlen, 21)) { | 721 | switch (min(recordlen, 22)) { |
721 | case 21: | 722 | case 22: |
722 | tUNK_21 = entry[21]; | 723 | tUNK_21 = entry[21]; |
723 | case 20: | 724 | case 21: |
724 | tUNK_20 = entry[20]; | 725 | tUNK_20 = entry[20]; |
725 | case 19: | 726 | case 20: |
726 | tUNK_19 = entry[19]; | 727 | tUNK_19 = entry[19]; |
727 | case 18: | 728 | case 19: |
728 | tUNK_18 = entry[18]; | 729 | tUNK_18 = entry[18]; |
729 | default: | 730 | default: |
730 | tUNK_0 = entry[0]; | 731 | tUNK_0 = entry[0]; |
@@ -754,24 +755,30 @@ nouveau_mem_timing_init(struct drm_device *dev) | |||
754 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); | 755 | timing->reg_100228 = (tUNK_12 << 16 | tUNK_11 << 8 | tUNK_10); |
755 | if(recordlen > 19) { | 756 | if(recordlen > 19) { |
756 | timing->reg_100228 += (tUNK_19 - 1) << 24; | 757 | timing->reg_100228 += (tUNK_19 - 1) << 24; |
757 | } else { | 758 | }/* I cannot back-up this else-statement right now |
759 | else { | ||
758 | timing->reg_100228 += tUNK_12 << 24; | 760 | timing->reg_100228 += tUNK_12 << 24; |
759 | } | 761 | }*/ |
760 | 762 | ||
761 | /* XXX: reg_10022c */ | 763 | /* XXX: reg_10022c */ |
764 | timing->reg_10022c = tUNK_2 - 1; | ||
762 | 765 | ||
763 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | | 766 | timing->reg_100230 = (tUNK_20 << 24 | tUNK_21 << 16 | |
764 | tUNK_13 << 8 | tUNK_13); | 767 | tUNK_13 << 8 | tUNK_13); |
765 | 768 | ||
766 | /* XXX: +6? */ | 769 | /* XXX: +6? */ |
767 | timing->reg_100234 = (tRAS << 24 | (tUNK_19 + 6) << 8 | tRC); | 770 | timing->reg_100234 = (tRAS << 24 | (tUNK_19 + 6) << 8 | tRC); |
768 | if(tUNK_10 > tUNK_11) { | 771 | timing->reg_100234 += max(tUNK_10,tUNK_11) << 16; |
769 | timing->reg_100234 += tUNK_10 << 16; | 772 | |
770 | } else { | 773 | /* XXX; reg_100238, reg_10023c |
771 | timing->reg_100234 += tUNK_11 << 16; | 774 | * reg: 0x00?????? |
775 | * reg_10023c: | ||
776 | * 0 for pre-NV50 cards | ||
777 | * 0x????0202 for NV50+ cards (empirical evidence) */ | ||
778 | if(dev_priv->card_type >= NV_50) { | ||
779 | timing->reg_10023c = 0x202; | ||
772 | } | 780 | } |
773 | 781 | ||
774 | /* XXX; reg_100238, reg_10023c */ | ||
775 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, | 782 | NV_DEBUG(dev, "Entry %d: 220: %08x %08x %08x %08x\n", i, |
776 | timing->reg_100220, timing->reg_100224, | 783 | timing->reg_100220, timing->reg_100224, |
777 | timing->reg_100228, timing->reg_10022c); | 784 | timing->reg_100228, timing->reg_10022c); |