diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 04:38:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 04:38:28 -0500 |
commit | 8b6f08eaef16dfcfebc32fa9a017bf70336ad9ec (patch) | |
tree | 9f29f39de67b85baad5eca7d7165549a166c4367 /drivers/char | |
parent | 4ae26f46c98f58ef19ad34f475617b40740d2faa (diff) | |
parent | 8a453cac94803910305f7e95cbd157b6bbd88811 (diff) |
Merge branch 'sh/alphaproject' into sh-latest
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-agp.h | 2 | ||||
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index 010e3defd6c3..c195bfeade11 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
@@ -94,6 +94,8 @@ | |||
94 | #define G4x_GMCH_SIZE_VT_1_5M (0xa << 8) | 94 | #define G4x_GMCH_SIZE_VT_1_5M (0xa << 8) |
95 | #define G4x_GMCH_SIZE_VT_2M (0xc << 8) | 95 | #define G4x_GMCH_SIZE_VT_2M (0xc << 8) |
96 | 96 | ||
97 | #define GFX_FLSH_CNTL 0x2170 /* 915+ */ | ||
98 | |||
97 | #define I810_DRAM_CTL 0x3000 | 99 | #define I810_DRAM_CTL 0x3000 |
98 | #define I810_DRAM_ROW_0 0x00000001 | 100 | #define I810_DRAM_ROW_0 0x00000001 |
99 | #define I810_DRAM_ROW_0_SDRAM 0x00000001 | 101 | #define I810_DRAM_ROW_0_SDRAM 0x00000001 |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 356f73e0d17e..e921b693412b 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -688,14 +688,14 @@ static int intel_gtt_init(void) | |||
688 | 688 | ||
689 | intel_private.base.stolen_size = intel_gtt_stolen_size(); | 689 | intel_private.base.stolen_size = intel_gtt_stolen_size(); |
690 | 690 | ||
691 | intel_private.base.needs_dmar = USE_PCI_DMA_API && INTEL_GTT_GEN > 2; | ||
692 | |||
691 | ret = intel_gtt_setup_scratch_page(); | 693 | ret = intel_gtt_setup_scratch_page(); |
692 | if (ret != 0) { | 694 | if (ret != 0) { |
693 | intel_gtt_cleanup(); | 695 | intel_gtt_cleanup(); |
694 | return ret; | 696 | return ret; |
695 | } | 697 | } |
696 | 698 | ||
697 | intel_private.base.needs_dmar = USE_PCI_DMA_API && INTEL_GTT_GEN > 2; | ||
698 | |||
699 | return 0; | 699 | return 0; |
700 | } | 700 | } |
701 | 701 | ||
@@ -814,6 +814,12 @@ static bool intel_enable_gtt(void) | |||
814 | } | 814 | } |
815 | } | 815 | } |
816 | 816 | ||
817 | /* On the resume path we may be adjusting the PGTBL value, so | ||
818 | * be paranoid and flush all chipset write buffers... | ||
819 | */ | ||
820 | if (INTEL_GTT_GEN >= 3) | ||
821 | writel(0, intel_private.registers+GFX_FLSH_CNTL); | ||
822 | |||
817 | reg = intel_private.registers+I810_PGETBL_CTL; | 823 | reg = intel_private.registers+I810_PGETBL_CTL; |
818 | writel(intel_private.PGETBL_save, reg); | 824 | writel(intel_private.PGETBL_save, reg); |
819 | if (HAS_PGTBL_EN && (readl(reg) & I810_PGETBL_ENABLED) == 0) { | 825 | if (HAS_PGTBL_EN && (readl(reg) & I810_PGETBL_ENABLED) == 0) { |
@@ -823,6 +829,9 @@ static bool intel_enable_gtt(void) | |||
823 | return false; | 829 | return false; |
824 | } | 830 | } |
825 | 831 | ||
832 | if (INTEL_GTT_GEN >= 3) | ||
833 | writel(0, intel_private.registers+GFX_FLSH_CNTL); | ||
834 | |||
826 | return true; | 835 | return true; |
827 | } | 836 | } |
828 | 837 | ||
@@ -991,14 +1000,14 @@ static int intel_fake_agp_remove_entries(struct agp_memory *mem, | |||
991 | if (mem->page_count == 0) | 1000 | if (mem->page_count == 0) |
992 | return 0; | 1001 | return 0; |
993 | 1002 | ||
1003 | intel_gtt_clear_range(pg_start, mem->page_count); | ||
1004 | |||
994 | if (intel_private.base.needs_dmar) { | 1005 | if (intel_private.base.needs_dmar) { |
995 | intel_gtt_unmap_memory(mem->sg_list, mem->num_sg); | 1006 | intel_gtt_unmap_memory(mem->sg_list, mem->num_sg); |
996 | mem->sg_list = NULL; | 1007 | mem->sg_list = NULL; |
997 | mem->num_sg = 0; | 1008 | mem->num_sg = 0; |
998 | } | 1009 | } |
999 | 1010 | ||
1000 | intel_gtt_clear_range(pg_start, mem->page_count); | ||
1001 | |||
1002 | return 0; | 1011 | return 0; |
1003 | } | 1012 | } |
1004 | 1013 | ||