aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/gtt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 15:42:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 15:42:54 -0400
commitf2fde3a65e88330017b816faf2ef75f141d21375 (patch)
tree57152ab5756e7ed1c58742e7e16f13a45ff11f21 /drivers/gpu/drm/gma500/gtt.c
parent28f3d717618156c0dcd2f497d791b578a7931d87 (diff)
parent8c914028f5ddaa417b7d0f4b7fdc24caceaa8043 (diff)
Merge branch 'drm-core-next' of git://people.freedesktop.org/~airlied/linux
Pull main drm updates from Dave Airlie: "This is the main merge window request for the drm. It's big, but jam packed will lots of features and of course 0 regressions. (okay maybe there'll be one). Highlights: - new KMS drivers for server GPU chipsets: ast, mgag200 and cirrus (qemu only). These drivers use the generic modesetting drivers. - initial prime/dma-buf support for i915, nouveau, radeon, udl and exynos - switcheroo audio support: so GPUs with HDMI can turn off the sound driver without crashing stuff. - There are some patches drifting outside drivers/gpu into x86 and EFI for better handling of multiple video adapters in Apple Macs, they've got correct acks except one trivial fixup. - Core: edid parser has better DMT and reduced blanking support, crtc properties, plane properties, - Drivers: exynos: add 2D core accel support, prime support, hdmi features intel: more Haswell support, initial Valleyview support, more hdmi infoframe fixes, update MAINTAINERS for Daniel, lots of cleanups and fixes radeon: more HDMI audio support, improved GPU lockup recovery support, remove nested mutexes, less memory copying on PCIE, fix bus master enable race (kexec), improved fence handling gma500: cleanups, 1080p support, acpi fixes nouveau: better nva3 memory reclocking, kepler accel (needs external firmware rip), async buffer moves on nv84+ hw. I've some more dma-buf patches that rely on the dma-buf merge for vmap stuff, and I've a few fixes building up, but I'd decided I'd better get rid of the main pull sooner rather than later, so the audio guys are also unblocked." Fix up trivial conflict due to some duplicated changes in drivers/gpu/drm/i915/intel_ringbuffer.c * 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (605 commits) drm/nouveau/nvd9: Fix GPIO initialisation sequence. drm/nouveau: Unregister switcheroo client on exit drm/nouveau: Check dsm on switcheroo unregister drm/nouveau: fix a minor annoyance in an output string drm/nouveau: turn a BUG into a WARN drm/nv50: decode PGRAPH DATA_ERROR = 0x24 drm/nouveau/disp: fix dithering not being enabled on some eDP macbooks drm/nvd9/copy: initialise copy engine, seems to work like nvc0 drm/nvc0/ttm: use copy engines for async buffer moves drm/nva3/ttm: use copy engine for async buffer moves drm/nv98/ttm: add in a (disabled) crypto engine buffer copy method drm/nv84/ttm: use crypto engine for async buffer copies drm/nouveau/ttm: untangle code to support accelerated buffer moves drm/nouveau/fbcon: use fence for sync, rather than notifier drm/nv98/crypt: non-stub implementation of the engine hooks drm/nouveau/fifo: turn all fifo modules into engine modules drm/nv50/graph: remove ability to do interrupt-driven context switching drm/nv50: remove manual context unload on context destruction drm/nv50: remove execution engine context saves on suspend drm/nv50/fifo: use hardware channel kickoff functionality ...
Diffstat (limited to 'drivers/gpu/drm/gma500/gtt.c')
-rw-r--r--drivers/gpu/drm/gma500/gtt.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index c6465b40090f..04a371aceb34 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -39,6 +39,10 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
39{ 39{
40 uint32_t mask = PSB_PTE_VALID; 40 uint32_t mask = PSB_PTE_VALID;
41 41
42 /* Ensure we explode rather than put an invalid low mapping of
43 a high mapping page into the gtt */
44 BUG_ON(pfn & ~(0xFFFFFFFF >> PAGE_SHIFT));
45
42 if (type & PSB_MMU_CACHED_MEMORY) 46 if (type & PSB_MMU_CACHED_MEMORY)
43 mask |= PSB_PTE_CACHED; 47 mask |= PSB_PTE_CACHED;
44 if (type & PSB_MMU_RO_MEMORY) 48 if (type & PSB_MMU_RO_MEMORY)
@@ -57,7 +61,7 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
57 * Given a gtt_range object return the GTT offset of the page table 61 * Given a gtt_range object return the GTT offset of the page table
58 * entries for this gtt_range 62 * entries for this gtt_range
59 */ 63 */
60static u32 *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r) 64static u32 __iomem *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r)
61{ 65{
62 struct drm_psb_private *dev_priv = dev->dev_private; 66 struct drm_psb_private *dev_priv = dev->dev_private;
63 unsigned long offset; 67 unsigned long offset;
@@ -78,7 +82,8 @@ static u32 *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r)
78 */ 82 */
79static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r) 83static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
80{ 84{
81 u32 *gtt_slot, pte; 85 u32 __iomem *gtt_slot;
86 u32 pte;
82 struct page **pages; 87 struct page **pages;
83 int i; 88 int i;
84 89
@@ -93,7 +98,7 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
93 pages = r->pages; 98 pages = r->pages;
94 99
95 /* Make sure changes are visible to the GPU */ 100 /* Make sure changes are visible to the GPU */
96 set_pages_array_uc(pages, r->npage); 101 set_pages_array_wc(pages, r->npage);
97 102
98 /* Write our page entries into the GTT itself */ 103 /* Write our page entries into the GTT itself */
99 for (i = r->roll; i < r->npage; i++) { 104 for (i = r->roll; i < r->npage; i++) {
@@ -122,7 +127,8 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
122static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r) 127static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
123{ 128{
124 struct drm_psb_private *dev_priv = dev->dev_private; 129 struct drm_psb_private *dev_priv = dev->dev_private;
125 u32 *gtt_slot, pte; 130 u32 __iomem *gtt_slot;
131 u32 pte;
126 int i; 132 int i;
127 133
128 WARN_ON(r->stolen); 134 WARN_ON(r->stolen);
@@ -148,7 +154,8 @@ static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
148 */ 154 */
149void psb_gtt_roll(struct drm_device *dev, struct gtt_range *r, int roll) 155void psb_gtt_roll(struct drm_device *dev, struct gtt_range *r, int roll)
150{ 156{
151 u32 *gtt_slot, pte; 157 u32 __iomem *gtt_slot;
158 u32 pte;
152 int i; 159 int i;
153 160
154 if (roll >= r->npage) { 161 if (roll >= r->npage) {
@@ -409,8 +416,6 @@ int psb_gtt_init(struct drm_device *dev, int resume)
409 unsigned long stolen_size, vram_stolen_size; 416 unsigned long stolen_size, vram_stolen_size;
410 unsigned i, num_pages; 417 unsigned i, num_pages;
411 unsigned pfn_base; 418 unsigned pfn_base;
412 uint32_t vram_pages;
413 uint32_t dvmt_mode = 0;
414 struct psb_gtt *pg; 419 struct psb_gtt *pg;
415 420
416 int ret = 0; 421 int ret = 0;
@@ -483,13 +488,8 @@ int psb_gtt_init(struct drm_device *dev, int resume)
483 488
484 stolen_size = vram_stolen_size; 489 stolen_size = vram_stolen_size;
485 490
486 printk(KERN_INFO "Stolen memory information\n"); 491 dev_dbg(dev->dev, "Stolen memory base 0x%x, size %luK\n",
487 printk(KERN_INFO " base in RAM: 0x%x\n", dev_priv->stolen_base); 492 dev_priv->stolen_base, vram_stolen_size / 1024);
488 printk(KERN_INFO " size: %luK, calculated by (GTT RAM base) - (Stolen base), seems wrong\n",
489 vram_stolen_size/1024);
490 dvmt_mode = (dev_priv->gmch_ctrl >> 4) & 0x7;
491 printk(KERN_INFO " the correct size should be: %dM(dvmt mode=%d)\n",
492 (dvmt_mode == 1) ? 1 : (2 << (dvmt_mode - 1)), dvmt_mode);
493 493
494 if (resume && (gtt_pages != pg->gtt_pages) && 494 if (resume && (gtt_pages != pg->gtt_pages) &&
495 (stolen_size != pg->stolen_size)) { 495 (stolen_size != pg->stolen_size)) {
@@ -525,8 +525,8 @@ int psb_gtt_init(struct drm_device *dev, int resume)
525 */ 525 */
526 526
527 pfn_base = dev_priv->stolen_base >> PAGE_SHIFT; 527 pfn_base = dev_priv->stolen_base >> PAGE_SHIFT;
528 vram_pages = num_pages = vram_stolen_size >> PAGE_SHIFT; 528 num_pages = vram_stolen_size >> PAGE_SHIFT;
529 printk(KERN_INFO"Set up %d stolen pages starting at 0x%08x, GTT offset %dK\n", 529 dev_dbg(dev->dev, "Set up %d stolen pages starting at 0x%08x, GTT offset %dK\n",
530 num_pages, pfn_base << PAGE_SHIFT, 0); 530 num_pages, pfn_base << PAGE_SHIFT, 0);
531 for (i = 0; i < num_pages; ++i) { 531 for (i = 0; i < num_pages; ++i) {
532 pte = psb_gtt_mask_pte(pfn_base + i, 0); 532 pte = psb_gtt_mask_pte(pfn_base + i, 0);