summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_mem.c
AgeCommit message (Collapse)Author
2011-03-16Merge commit '5359533801e3dd3abca5b7d3d985b0b33fd9fe8b' into drm-core-nextDave Airlie
This commit changed an internal radeon structure, that meant a new driver in -next had to be fixed up, merge in the commit and fix up the driver. Also fixes a trivial nouveau merge. Conflicts: drivers/gpu/drm/nouveau/nouveau_mem.c
2011-03-14drm/nv40: attempt to reserve just enough vram for all 32 channelsBen Skeggs
This also makes the fact we're giving 512MiB of GART space to all PCIE boards explicit, although the vast majority (if not all) of them will now have a ramin_rsvd_vram larger than 2MiB anyway. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-03-07drm/nouveau: fix regression causing ttm to not be able to evict vramBen Skeggs
TTM assumes an error condition from man->func->get_node() means that something went horribly wrong, and causes it to bail. The driver is supposed to return 0, and leave mm_node == NULL to signal that it couldn't allocate any memory. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-24drm/nv50: support for compressionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-24drm/nv50-nvc0: delay GART binding until move_notify timeBen Skeggs
The immediate benefit of doing this is that on NV50 and up, the GPU virtual address of any buffer is now constant, regardless of what memtype they're placed in. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-24drm/nouveau: rename nouveau_vram to nouveau_memBen Skeggs
This structure will also be used for GART in the near future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-24drm/nv50-nvc0: unmap buffers from the vm when they're evictedBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-24drm/nouveau: remove no_vm/mappable flags from nouveau_boBen Skeggs
'mappable' isn't really used at all, nor is it necessary anymore as the bo code is capable of moving buffers to mappable vram as required. 'no_vm' isn't necessary anymore either, any places that don't want to be mapped into a GPU address space should allocate the VRAM directly instead. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-24drm/nv40: support for 39-bit dma addresses on native PCIE chipsetsBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-02-23Revert "ttm: Include the 'struct dev' when using the DMA API."Dave Airlie
This reverts commit 5a893fc28f0393adb7c885a871b8c59e623fd528. This causes a use after free in the ttm free alloc pages path, when it tries to get the be after the be has been destroyed. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-02-23Merge branch 'stable/ttm.pci-api.v5' of ↵Dave Airlie
git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into drm-next * 'stable/ttm.pci-api.v5' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: ttm: Include the 'struct dev' when using the DMA API. nouveau/ttm/PCIe: Use dma_addr if TTM has set it. radeon/ttm/PCIe: Use dma_addr if TTM has set it. ttm: Expand (*populate) to support an array of DMA addresses. ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set. ttm: Introduce a placeholder for DMA (bus) addresses.
2011-02-22ttm: Include the 'struct dev' when using the DMA API.Konrad Rzeszutek Wilk
This makes the accounting when using 'debug_dma_dump_mappings()' and CONFIG_DMA_API_DEBUG=y be assigned to the correct device instead of 'fallback'. No functional change - just cosmetic. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-02-07drm: rework PCI/platform driver interface.Dave Airlie
This abstracts the pci/platform interface out a step further, we can go further but this is far enough for now to allow USB to be plugged in. The drivers now just call the init code directly for their device type. Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-01-17drm/nouveau: greatly simplify mm, killing some bugs in the processBen Skeggs
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21drm/nvc0: initial vm implementation, use for bar1/bar3 managementBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-21drm/nvc0: import initial vm backendBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nouveau: kick vram functions out into an "engine"Ben Skeggs
NVC0 will be able to share some of nv50's paths this way. This also makes it the card-specific vram code responsible for deciding if a given set of tile_flags is valid, rather than duplicating the allowed types in nv50_vram.c and nouveau_gem.c Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nv50: enable non-contig vram allocations where requestedBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nv50: enable 4KiB pages for small vram allocationsBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nv50: implement global channel address space on new VM codeBen Skeggs
As of this commit, it's guaranteed that if an object is in VRAM that its GPU virtual address will be constant. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nv50: import new vm codeBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-08drm/nv50: implement custom vram mmBen Skeggs
This is required on nv50 as we need to be able to have more precise control over physical VRAM allocations to avoid buffer corruption when using buffers of mixed memory types. This removes some nasty overallocation/alignment that we were previously using to "control" this problem. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03drm/nouveau: Rework tile region handling.Francisco Jerez
The point is to share more code between the PFB/PGRAPH tile region hooks, and give the hardware specific functions a chance to allocate per-region resources. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-12-03drm/nouveau: fix annoying nouveau_fence type issueMarcin Slusarz
nouveau_fence_* functions are not type safe, which could lead to bugs. Additionally every use of nouveau_fence_unref had to cast struct nouveau_fence to void **. Fix it by renaming old functions and creating static inline functions with new prototypes. We still need old functions, because we pass function pointers to ttm. As we are wrapping functions, drop unused "void *arg" parameter where possible. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-11-18drm/nouveau/pm: improve memtiming mappingsRoy Spliet
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>
2010-11-18drm/nv50: implement possible workaround for NV86 PGRAPH TLB flush hangBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-11-18drm/nouveau: Some random cleanups.Francisco Jerez
Remove some unused/duplicated definitions and make sparse happy again. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-10-04drm/nouveau: fix thinkos in mem timing table recordlen checkRoy Spliet
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-10-04drm/nouveau: Import initial memory timing workRoy Spliet
This isn't correct everywhere yet, but since we don't use the data yet it's perfectly safe to push in, and the information we gain from logs will help to fix the remaining issues. v2 (Ben Skeggs <bskeggs@redhat.com>): - fixed up formatting - free parsed timing info on takedown - switched timing table printout to debug loglevel Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: Simplify tile region handling.Francisco Jerez
Instead of emptying the caches to avoid a race with the PFIFO puller, go straight ahead and try to recover from it when it happens. Also, kill pfifo->cache_flush and tile->lock, we don't need them anymore. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: Add module parameter to override the default AGP rate.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: Don't enable AGP FW on nv18.Francisco Jerez
FW seems to be broken on nv18, it causes random lockups and breaks suspend/resume even with the blob. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: rework init ordering so nv50_instmem.c can be less badBen Skeggs
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nv50: calculate vram reordering block sizeBen Skeggs
Will be used at a later point when we plug in an alternative VRAM memory manager for GeForce 8+ boards. Based on pscnv code to do the same. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: modify object accessors, offset in bytes rather than dwordsBen Skeggs
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-09-24drm/nouveau: Fix suspend on some nv4x AGP cards.Francisco Jerez
On some nv4x cards (specifically, the ones that use an internal PCIE->AGP bridge) the AGP controller state isn't preserved after a suspend/resume cycle, and the AGP control registers have moved from 0x18xx to 0x100xx, so the FW check in nouveau_mem_reset_agp() doesn't quite work. Check "dev->agp->mode" instead. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-05drm/nvc0: implement memory detectionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-05drm/nouveau: Fix AGP reset when AGP FW is already enabled on init.Francisco Jerez
Previously nouveau_mem_reset_agp() was only disabling AGP fast writes when coming back from suspend. However, the "locked out of the card because of FW" problem can also be reproduced on init if you unload/reload nouveau.ko several times. This patch makes the AGP code reset FW on init. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-08-05drm/nouveau: remove unused ttm bo listBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-26drm/nouveau: Reset AGP before running the init scripts.Francisco Jerez
BIOS scripts usually make an attempt to reset the AGP controller, however on some nv4x cards doing it properly involves switching FW off and on: if we do that without updating the AGP bridge settings accordingly (e.g. with the corresponding calls to agp_enable()) we will be locking ourselves out of the card MMIO space. Do it from nouveau_mem_reset_agp() before the init scripts are executed. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-26drm/nouveau: Add some PFB register defines.Francisco Jerez
Also collect all the PFB registers in a single place and remove some duplicated definitions. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: fix mtrr cleanup pathBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nv50: move tlb flushing to a helper functionBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: add instmem flush() hookBen Skeggs
This removes the previous prepare_access() and finish_access() hooks, and replaces it with a much simpler flush() hook. All the chipset-specific code before nv50 has its use removed completely, as it's not required there at all. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: Fix a couple of sparse warnings.Francisco Jerez
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nv50: fix memory detection for cards with >=4GiB VRAMBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: missed some bracesBen Skeggs
Luckily this had absolutely no effect whatsoever :) Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: remove left-over !DRIVER_MODESET pathsBen Skeggs
It's far preferable to have the driver do nothing at all for "nomodeset". Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-13drm/nouveau: use drm_mm in preference to custom code doing the same thingBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2010-07-07Merge branch 'drm-platform' into drm-testingDave Airlie
* drm-platform: drm: Make sure the DRM offset matches the CPU drm: Add __arm defines to DRM drm: Add support for platform devices to register as DRM devices drm: Remove drm_resource wrappers