aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorRoy Spliet <r.spliet@student.tudelft.nl>2011-07-14 14:40:10 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 02:08:28 -0400
commit2228c6fe04ddc303e90c05dd9430539fbcd8fa18 (patch)
tree8baa1b74c082de0cf7b81906c499fcb99b4cf3e0 /drivers/gpu/drm
parent9a7824887690836448eb73ccf0d8232da2e5bee3 (diff)
drm/nouveau/pm: Document and expose CL and WR for 0x1002Cx
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h7
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c28
2 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 7991c1b3b911..c5993aad2aec 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -438,6 +438,9 @@ struct nouveau_pm_memtiming {
438 u32 reg_6; 438 u32 reg_6;
439 u32 reg_7; 439 u32 reg_7;
440 u32 reg_8; 440 u32 reg_8;
441 /* To be written to 0x1002c0 */
442 u8 CL;
443 u8 WR;
441}; 444};
442 445
443struct nouveau_pm_tbl_header{ 446struct nouveau_pm_tbl_header{
@@ -448,7 +451,9 @@ struct nouveau_pm_tbl_header{
448}; 451};
449 452
450struct nouveau_pm_tbl_entry{ 453struct nouveau_pm_tbl_entry{
451 u8 tUNK_0, tUNK_1, tUNK_2; 454 u8 tWR;
455 u8 tUNK_1;
456 u8 tCL;
452 u8 tRP; /* Byte 3 */ 457 u8 tRP; /* Byte 3 */
453 u8 empty_4; 458 u8 empty_4;
454 u8 tRAS; /* Byte 5 */ 459 u8 tRAS; /* Byte 5 */
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 65c12ed14257..36bec4807701 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -519,10 +519,10 @@ void nv40_mem_timing_entry(struct drm_device *dev, struct nouveau_pm_tbl_header
519 519
520 /* XXX: I don't trust the -1's and +1's... they must come 520 /* XXX: I don't trust the -1's and +1's... they must come
521 * from somewhere! */ 521 * from somewhere! */
522 timing->reg_1 = (e->tUNK_0 + 2 + magic_number) << 24 | 522 timing->reg_1 = (e->tWR + 2 + magic_number) << 24 |
523 1 << 16 | 523 1 << 16 |
524 (e->tUNK_1 + 2 + magic_number) << 8 | 524 (e->tUNK_1 + 2 + magic_number) << 8 |
525 (e->tUNK_2 + 2 - magic_number); 525 (e->tCL + 2 - magic_number);
526 timing->reg_2 = (magic_number << 24 | e->tUNK_12 << 16 | e->tUNK_11 << 8 | e->tUNK_10); 526 timing->reg_2 = (magic_number << 24 | e->tUNK_12 << 16 | e->tUNK_11 << 8 | e->tUNK_10);
527 timing->reg_2 |= 0x20200000; 527 timing->reg_2 |= 0x20200000;
528 528
@@ -555,13 +555,13 @@ void nv50_mem_timing_entry(struct drm_device *dev, struct bit_entry *P, struct n
555 555
556 /* XXX: I don't trust the -1's and +1's... they must come 556 /* XXX: I don't trust the -1's and +1's... they must come
557 * from somewhere! */ 557 * from somewhere! */
558 timing->reg_1 = (e->tUNK_0 + unk19 + 1 + magic_number) << 24 | 558 timing->reg_1 = (e->tWR + unk19 + 1 + magic_number) << 24 |
559 max(unk18, (u8) 1) << 16 | 559 max(unk18, (u8) 1) << 16 |
560 (e->tUNK_1 + unk19 + 1 + magic_number) << 8; 560 (e->tUNK_1 + unk19 + 1 + magic_number) << 8;
561 if (dev_priv->chipset == 0xa8) { 561 if (dev_priv->chipset == 0xa8) {
562 timing->reg_1 |= (e->tUNK_2 - 1); 562 timing->reg_1 |= (e->tCL - 1);
563 } else { 563 } else {
564 timing->reg_1 |= (e->tUNK_2 + 2 - magic_number); 564 timing->reg_1 |= (e->tCL + 2 - magic_number);
565 } 565 }
566 timing->reg_2 = (e->tUNK_12 << 16 | e->tUNK_11 << 8 | e->tUNK_10); 566 timing->reg_2 = (e->tUNK_12 << 16 | e->tUNK_11 << 8 | e->tUNK_10);
567 567
@@ -570,17 +570,17 @@ void nv50_mem_timing_entry(struct drm_device *dev, struct bit_entry *P, struct n
570 570
571 if (P->version == 1) { 571 if (P->version == 1) {
572 timing->reg_2 |= magic_number << 24; 572 timing->reg_2 |= magic_number << 24;
573 timing->reg_3 = (0x14 + e->tUNK_2) << 24 | 573 timing->reg_3 = (0x14 + e->tCL) << 24 |
574 0x16 << 16 | 574 0x16 << 16 |
575 (e->tUNK_2 - 1) << 8 | 575 (e->tCL - 1) << 8 |
576 (e->tUNK_2 - 1); 576 (e->tCL - 1);
577 timing->reg_4 = (nv_rd32(dev,0x10022c) & 0xffff0000) | e->tUNK_13 << 8 | e->tUNK_13; 577 timing->reg_4 = (nv_rd32(dev,0x10022c) & 0xffff0000) | e->tUNK_13 << 8 | e->tUNK_13;
578 timing->reg_5 |= (e->tUNK_2 + 2) << 8; 578 timing->reg_5 |= (e->tCL + 2) << 8;
579 timing->reg_7 = 0x4000202 | (e->tUNK_2 - 1) << 16; 579 timing->reg_7 = 0x4000202 | (e->tCL - 1) << 16;
580 } else { 580 } else {
581 timing->reg_2 |= (unk19 - 1) << 24; 581 timing->reg_2 |= (unk19 - 1) << 24;
582 /* XXX: reg_10022c for recentish cards pretty much unknown*/ 582 /* XXX: reg_10022c for recentish cards pretty much unknown*/
583 timing->reg_3 = e->tUNK_2 - 1; 583 timing->reg_3 = e->tCL - 1;
584 timing->reg_4 = (unk20 << 24 | unk21 << 16 | 584 timing->reg_4 = (unk20 << 24 | unk21 << 16 |
585 e->tUNK_13 << 8 | e->tUNK_13); 585 e->tUNK_13 << 8 | e->tUNK_13);
586 /* XXX: +6? */ 586 /* XXX: +6? */
@@ -603,8 +603,8 @@ void nv50_mem_timing_entry(struct drm_device *dev, struct bit_entry *P, struct n
603void nvc0_mem_timing_entry(struct drm_device *dev, struct nouveau_pm_tbl_header *hdr, 603void nvc0_mem_timing_entry(struct drm_device *dev, struct nouveau_pm_tbl_header *hdr,
604 struct nouveau_pm_tbl_entry *e, struct nouveau_pm_memtiming *timing) { 604 struct nouveau_pm_tbl_entry *e, struct nouveau_pm_memtiming *timing) {
605 timing->reg_0 = (e->tRC << 24 | (e->tRFC & 0x7f) << 17 | e->tRAS << 8 | e->tRP); 605 timing->reg_0 = (e->tRC << 24 | (e->tRFC & 0x7f) << 17 | e->tRAS << 8 | e->tRP);
606 timing->reg_1 = (nv_rd32(dev,0x10f294) & 0xff000000) | (e->tUNK_11&0x0f) << 20 | (e->tUNK_19 << 7) | (e->tUNK_2 & 0x0f); 606 timing->reg_1 = (nv_rd32(dev,0x10f294) & 0xff000000) | (e->tUNK_11&0x0f) << 20 | (e->tUNK_19 << 7) | (e->tCL & 0x0f);
607 timing->reg_2 = (nv_rd32(dev,0x10f298) & 0xff0000ff) | e->tUNK_0 << 16 | e->tUNK_1 << 8; 607 timing->reg_2 = (nv_rd32(dev,0x10f298) & 0xff0000ff) | e->tWR << 16 | e->tUNK_1 << 8;
608 timing->reg_3 = e->tUNK_20 << 9 | e->tUNK_13; 608 timing->reg_3 = e->tUNK_20 << 9 | e->tUNK_13;
609 timing->reg_4 = (nv_rd32(dev,0x10f2a0) & 0xfff000ff) | e->tUNK_12 << 15; 609 timing->reg_4 = (nv_rd32(dev,0x10f2a0) & 0xfff000ff) | e->tUNK_12 << 15;
610 NV_DEBUG(dev, "Entry %d: 290: %08x %08x %08x %08x\n", timing->id, 610 NV_DEBUG(dev, "Entry %d: 290: %08x %08x %08x %08x\n", timing->id,
@@ -686,6 +686,8 @@ nouveau_mem_timing_init(struct drm_device *dev)
686 continue; 686 continue;
687 687
688 timing->id = i; 688 timing->id = i;
689 timing->WR = entry[0];
690 timing->CL = entry[2];
689 691
690 if(dev_priv->card_type <= NV_40) { 692 if(dev_priv->card_type <= NV_40) {
691 nv40_mem_timing_entry(dev,hdr,(struct nouveau_pm_tbl_entry*) entry,magic_number,&pm->memtimings.timing[i]); 693 nv40_mem_timing_entry(dev,hdr,(struct nouveau_pm_tbl_entry*) entry,magic_number,&pm->memtimings.timing[i]);