summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau: remove implicit mapping of every bo into chan_vmBen Skeggs2011-06-231-9/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove 'chan' argument from nouveau_bo_newBen Skeggs2011-06-231-5/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: initial changes to support multiple VMAs per buffer objectBen Skeggs2011-06-231-26/+72
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: convert bo.mem.start usage to bo.offsetBen Skeggs2011-06-231-1/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: convert some bo.offset use to vma.offsetBen Skeggs2011-06-231-2/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: create temp vmas for both src and dst of bo movesBen Skeggs2011-06-231-71/+45
| | | | | | | | | Greatly simplifies a number of things, particularly once per-client GPU address spaces are involved. May add this back later once I know what things'll look like. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: store bo's page size in nouveau_boBen Skeggs2011-06-231-15/+12
| | | | | | | | Was previously assuming a page size of 4KiB unless a VMA was present to override it. Eventually, a buffer won't necessarily have a VMA at all at some stages of its life, so we need to store this info elsewhere. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: skip move_notify() if bo does not have a vma attachedBen Skeggs2011-06-231-4/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: no need to update bo.offset from vma after validateBen Skeggs2011-06-231-2/+0
| | | | | | | On chipsets using nouveau_vm, the virtual address stays constant, so the value set at bo creation time is fine. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Merge remote branch 'intel/drm-intel-next' of ../drm-next into drm-core-nextDave Airlie2011-03-141-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'intel/drm-intel-next' of ../drm-next: (755 commits) drm/i915: Only wait on a pending flip if we intend to write to the buffer drm/i915/dp: Sanity check eDP existence drm/i915: Rebind the buffer if its alignment constraints changes with tiling drm/i915: Disable GPU semaphores by default drm/i915: Do not overflow the MMADDR write FIFO Revert "drm/i915: fix corruptions on i8xx due to relaxed fencing" drm/i915: Don't save/restore hardware status page address register drm/i915: don't store the reg value for HWS_PGA drm/i915: fix memory corruption with GM965 and >4GB RAM Linux 2.6.38-rc7 Revert "TPM: Long default timeout fix" drm/i915: Re-enable GPU semaphores for SandyBridge mobile drm/i915: Replace vblank PM QoS with "Interrupt-Based AGPBUSY#" Revert "drm/i915: Use PM QoS to prevent C-State starvation of gen3 GPU" drm/i915: Allow relocation deltas outside of target bo drm/i915: Silence an innocuous compiler warning for an unused variable fs/block_dev.c: fix new kernel-doc warning ACPI: Fix build for CONFIG_NET unset mm: <asm-generic/pgtable.h> must include <linux/mm_types.h> x86: Use u32 instead of long to set reset vector back to 0 ... Conflicts: drivers/gpu/drm/i915/i915_gem.c
| * drm/nv50-nvc0: make sure vma is definitely unmapped when destroying boBen Skeggs2011-02-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | Somehow fixes a misrendering + hang at GDM startup on my NVA8... My first guess would have been stale TLB entries laying around that a new bo then accidentally inherits. That doesn't make a great deal of sense however, as when we mapped the pages for the new bo the TLBs would've gotten flushed anyway. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50-nvc0: delay GART binding until move_notify timeBen Skeggs2011-02-251-46/+68
| | | | | | | | | | | | | | | | 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>
* | drm/nouveau: rename nouveau_vram to nouveau_memBen Skeggs2011-02-251-13/+13
| | | | | | | | | | | | This structure will also be used for GART in the near future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50-nvc0: unmap buffers from the vm when they're evictedBen Skeggs2011-02-251-7/+29
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50-nvc0: move vm bind/unbind to move_notify hookBen Skeggs2011-02-251-22/+37
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50-nvc0: restrict memtype to those specified at creation timeBen Skeggs2011-02-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upcoming patches are going to enable full support for buffers that keep a constant GPU virtual address whenever they're validated for use by the GPU. In order for this to work properly while keeping support for large pages, we need to know if it's ever going to be possible for a buffer to end up in GART, and if so, disable large pages for the buffer's VMA. This is a new restriction that's not present in earlier kernel's, but should not break userspace as the current code never attempts to validate buffers into a memtype other than it was created with. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50: simplify bo moves now that they're all through the vmBen Skeggs2011-02-251-17/+9
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: remove no_vm/mappable flags from nouveau_boBen Skeggs2011-02-251-38/+24
| | | | | | | | | | | | | | | | | | | | '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>
* | drm/nouveau: introduce new gart type, and name _SGDMA more appropriatelyBen Skeggs2011-02-251-2/+4
|/ | | | | | | In preparation for the addition of a new nv40 backend, we'll need to be able to distinguish between a paged dma object and the on-chip GART. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: flips/flipd need to always set 'evict' for move_accel_cleanup()Ben Skeggs2011-02-171-3/+3
| | | | | | | We free the temporary binding before leaving this function, so we also have to wait for the move to actually complete. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv10: Fix crash when allocating a BO larger than half the available VRAM.Francisco Jerez2011-02-171-3/+4
| | | | | | Reported-by: Alex Buell <alex.buell@munted.org.uk> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: accelerate ttm buffer movesBen Skeggs2010-12-211-1/+56
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: initial support for tiled buffer objectsBen Skeggs2010-12-211-3/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: implement pgraph engine hooksBen Skeggs2010-12-211-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: initial vm implementation, use for bar1/bar3 managementBen Skeggs2010-12-211-4/+14
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nvc0: import initial vm backendBen Skeggs2010-12-211-2/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: tidy up PCIEGART implementationBen Skeggs2010-12-081-4/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: enable 4KiB pages for small vram allocationsBen Skeggs2010-12-081-18/+23
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: implement global channel address space on new VM codeBen Skeggs2010-12-081-16/+25
| | | | | | | 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>
* drm/nv50: implement BAR1/BAR3 management on top of new VM codeBen Skeggs2010-12-081-3/+43
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: implement custom vram mmBen Skeggs2010-12-081-38/+5
| | | | | | | | | | | 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>
* drm/nouveau: wrap calls to ttm_bo_validate()Ben Skeggs2010-12-081-3/+17
| | | | | | | This will be used later to fixup bo.offset with a buffer's fixed GPU virtual address. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Use WC memory on the AGP GART.Francisco Jerez2010-12-081-2/+3
| | | | | Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Fix sleep while atomic in nouveau_bo_fence().Francisco Jerez2010-12-031-3/+7
| | | | | | Reported-by: Pekka Paalanen <pq@iki.fi> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Rework tile region handling.Francisco Jerez2010-12-031-7/+4
| | | | | | | | | 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>
* drm/nouveau: Add a separate class for the kernel channel mutex.Francisco Jerez2010-12-031-1/+1
| | | | | | | | | | nouveau_bo_move_m2mf() needs to lock the kernel channel, and it may be called from the pushbuf IOCTL with an user channel already locked. Use a separate subclass for the kernel channel mutex because this is legitimate mutex nesting. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Implement the pageflip ioctl.Francisco Jerez2010-12-031-0/+12
| | | | | | | nv0x-nv4x should be mostly fine, nv50 doesn't work yet. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: fix annoying nouveau_fence type issueMarcin Slusarz2010-12-031-6/+6
| | | | | | | | | | | | | | 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>
* drm/nouveau: Leave BO eviction synchronization for later.Francisco Jerez2010-12-031-7/+0
| | | | | | | The pushbuf ioctl syncs after validation, no need for this anymore. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: add per-channel mutex, use to lock access to drm's channelBen Skeggs2010-12-031-4/+11
| | | | | | | | | | | | | | | This fixes a race condition between fbcon acceleration and TTM buffer moves. To reproduce: - start X - switch to vt and "while (true); do dmesg; done" - switch to another vt and "sleep 2 && cat /path/to/debugfs/dri/0/evict_vram" - switch back to vt running dmesg We don't make use of this on any other channel yet, they're currently protected by drm_global_mutex. This will change in the near future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv10: Balance RTs expected to be accessed simultaneously by the 3d engine.Francisco Jerez2010-11-181-0/+28
| | | | | Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Expose some BO usage flags to userspace.Francisco Jerez2010-11-181-5/+10
| | | | | | | | | This will be needed for Z compression and to take smarter placement decisions. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/ttm: restructure to allow driver to plug in alternate memory managerBen Skeggs2010-10-051-8/+10
| | | | | | | | | Nouveau will need this on GeForce 8 and up to account for the GPU reordering physical VRAM for some memory types. Reviewed-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Thomas Hellström <thellstrom@vmware.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/ttm: introduce utility function to free an allocated memory nodeBen Skeggs2010-10-051-12/+2
| | | | | | | | | | Existing core code/drivers call drm_mm_put_block on ttm_mem_reg.mm_node directly. Future patches will modify TTM behaviour in such a way that ttm_mem_reg.mm_node doesn't necessarily belong to drm_mm. Reviewed-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Thomas Hellström <thellstrom@vmware.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Synchronize buffer object moves in hardware.Francisco Jerez2010-10-051-3/+8
| | | | | Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Minor refactoring/cleanup of the fence code.Francisco Jerez2010-10-051-15/+0
| | | | | | | Mainly to make room for inter-channel sync. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: fix chipset vs card_type thinkoBen Skeggs2010-09-241-1/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: assume smaller tiles for bo movesBen Skeggs2010-09-241-4/+4
| | | | | | Somehow fixes some corruption seen in KDE.. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: better handling of unmappable vramBen Skeggs2010-09-241-3/+20
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: rework init ordering so nv50_instmem.c can be less badBen Skeggs2010-09-241-1/+4
| | | | | Reviewed-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
OpenPOWER on IntegriCloud