27 Jul, 2011
1 commit
-
This allows us to move duplicated code in
(atomic_inc_not_zero() for now) toSigned-off-by: Arun Sharma
Reviewed-by: Eric Dumazet
Cc: Ingo Molnar
Cc: David Miller
Cc: Eric Dumazet
Acked-by: Mike Frysinger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
21 Jun, 2011
1 commit
-
. and some comments to make it easier to understand.
Ackedby: Randy Dunlap
[v2: Added some more updates from Randy Dunlap]
Signed-off-by: Konrad Rzeszutek Wilk
Signed-off-by: Dave Airlie
08 Apr, 2011
1 commit
-
* 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6:
Fix common misspellings
05 Apr, 2011
1 commit
-
Signed-off-by: Jan Engelhardt
Signed-off-by: Dave Airlie
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
23 Feb, 2011
3 commits
-
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
-
…l/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. -
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
28 Jan, 2011
2 commits
-
We pass in the array of ttm pages to be populated in the GART/MM
of the card (or AGP). Patch titled: "ttm: Utilize the DMA API for
pages that have TTM_PAGE_FLAG_DMA32 set." uses the DMA API to make
those pages have a proper DMA addresses (in the situation where
page_to_phys or virt_to_phys do not give use the DMA (bus) address).Since we are using the DMA API on those pages, we should pass in the
DMA address to this function so it can save it in its proper fields
(later patches use it).[v2: Added reviewed-by tag]
Reviewed-by: Thomas Hellstrom
Signed-off-by: Konrad Rzeszutek Wilk
Tested-by: Ian Campbell -
This is right now limited to only non-pool constructs.
[v2: Fixed indentation issues, add review-by tag]
Reviewed-by: Thomas Hellstrom
Signed-off-by: Konrad Rzeszutek Wilk
Tested-by: Ian Campbell
22 Nov, 2010
6 commits
-
This patch attempts to fix up shortcomings with the current calling
sequences.1) There's a fastpath where no locking occurs and only io_mem_reserved is
called to obtain needed info for mapping. The fastpath is set per
memory type manager.
2) If the fastpath is disabled, io_mem_reserve and io_mem_free will be exactly
balanced and not called recursively for the same struct ttm_mem_reg.
3) Optionally the driver can choose to enable a per memory type manager LRU
eviction mechanism that, when io_mem_reserve returns -EAGAIN will attempt
to kill user-space mappings of memory in that manager to free up needed
resourcesSigned-off-by: Thomas Hellstrom
Reviewed-by: Ben Skeggs
Signed-off-by: Dave Airlie -
Rather than having the driver supply the validation sequence, leave that
responsibility to TTM. This saves some confusion and a function argument.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie -
Drastically reduce the number of spin lock / unlock operations by performing
unreserving and fencing under global locks.Signed-off-by: Thomas Hellstrom
Reviewed-by: Jerome Glisse
Signed-off-by: Dave Airlie -
The bo lock used only to protect the bo sync object members, and since it
is a per bo lock, fencing a buffer list will see a lot of locks and unlocks.
Replace it with a per-device lock that protects the sync object members on
*all* bos. Reading and setting these members will always be very quick, so
the risc of heavy lock contention is microscopic. Note that waiting for
sync objects will always take place outside of this lock.The bo device fence lock will eventually be replaced with a seqlock /
rcu mechanism so we can determine that a bo is idle under a
rcu / read seqlock.However this change will allow us to batch fencing and unreserving of
buffers with a minimal amount of locking.Signed-off-by: Thomas Hellstrom
Reviewed-by: Jerome Glisse
Signed-off-by: Dave Airlie -
Add an aid for the driver to detect deadlocks on multi-bo reservations
Update documentation.Signed-off-by: Thomas Hellstrom
Reviewed-by: Jerome Glisse
Signed-off-by: Dave Airlie -
Makes it possible to reserve a list of buffer objects with a single
spin lock / unlock if there is no contention.
Should improve cpu usage on SMP kernels.v2: Initialize private list members on reserve and don't call
ttm_bo_list_ref_sub() with zero put_count.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
10 Nov, 2010
1 commit
-
Call destroy() on _all_ ttm_bo_init() failures, and make sure that
behavior is documented in the function description.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
09 Nov, 2010
1 commit
-
Remove an obsolete comment about mm nodes.
Document the new bo range manager interface.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
21 Oct, 2010
1 commit
-
Release the lru spinlock early.
Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
19 Oct, 2010
2 commits
-
We need the unlocked variant for the new codepath introduced to fix the
race condition in master recently.Signed-off-by: Dave Airlie
-
Conflicts:
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/radeon/r600_blit_kms.c
drivers/gpu/drm/ttm/ttm_bo.c
06 Oct, 2010
1 commit
-
This fixes a race pointed out by Dave Airlie where we don't take a buffer
object about to be destroyed off the LRU lists properly. It also fixes a rare
case where a buffer object could be destroyed in the middle of an
accelerated eviction.The patch also adds a utility function that can be used to prematurely
release GPU memory space usage of an object waiting to be destroyed.
For example during eviction or swapout.The above mentioned commit didn't queue the buffer on the delayed destroy
list under some rare circumstances. It also didn't completely honor the
remove_all parameter.Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=615505
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591061Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
05 Oct, 2010
2 commits
-
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
Acked-by: Thomas Hellström
Signed-off-by: Ben Skeggs -
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
Acked-by: Thomas Hellström
Signed-off-by: Ben Skeggs
04 Aug, 2010
1 commit
-
I wrote this for the prime sharing work, but I also noticed other external
non-upstream drivers from a large company carrying a similiar patch, so I
may as well ship it in master.Signed-off-by: Dave Airlie
07 Jul, 2010
1 commit
-
Repeated ttm_page_alloc_init/fini fails noisily because the pool
manager kobj isn't zeroed out between uses (we could do just that but
statically allocated kobjects are generally considered a bad thing).
Move it to kzalloc'ed memory.Note that this patch drops the refcounting behavior of the pool
allocator init/fini functions: it would have led to a race condition
in its current form, and anyway it was never exploited.This fixes a regression with reloading kms modules at runtime, since
page allocator was introduced.Signed-off-by: Francisco Jerez
Signed-off-by: Dave Airlie
22 May, 2010
1 commit
-
* 'drm-for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (207 commits)
drm/radeon/kms/pm/r600: select the mid clock mode for single head low profile
drm/radeon: fix power supply kconfig interaction.
drm/radeon/kms: record object that have been list reserved
drm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU.
drm/radeon/kms: don't default display priority to high on rs4xx
drm/edid: fix typo in 1600x1200@75 mode
drm/nouveau: fix i2c-related init table handlers
drm/nouveau: support init table i2c device identifier 0x81
drm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers
drm/nouveau: display error message for any failed init table opcode
drm/nouveau: fix init table handlers to return proper error codes
drm/nv50: support fractional feedback divider on newer chips
drm/nv50: fix monitor detection on certain chipsets
drm/nv50: store full dcb i2c entry from vbios
drm/nv50: fix suspend/resume with DP outputs
drm/nv50: output calculated crtc pll when debugging on
drm/nouveau: dump pll limits entries when debugging is on
drm/nouveau: bios parser fixes for eDP boards
drm/nouveau: fix a nouveau_bo dereference after it's been destroyed
drm/nv40: remove some completed ctxprog TODOs
...
18 May, 2010
1 commit
-
We want to be able to prevent the delayed workqueue from changing state
while we're reclocking, so add an API to block and unblock it.Signed-off-by: Matthew Garrett
Signed-off-by: Dave Airlie
07 May, 2010
1 commit
-
It's unused and buggy in its current form, since it can place a bo
in the reserved state without removing it from lru lists.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
20 Apr, 2010
3 commits
-
* drm-ttm-unmappable:
drm/radeon/kms: enable use of unmappable VRAM V2
drm/ttm: remove io_ field from TTM V6
drm/vmwgfx: add support for new TTM fault callback V5
drm/nouveau/kms: add support for new TTM fault callback V5
drm/radeon/kms: add support for new fault callback V7
drm/ttm: ttm_fault callback to allow driver to handle bo placement V6
drm/ttm: split no_wait argument in 2 GPU or reserve waitConflicts:
drivers/gpu/drm/nouveau/nouveau_bo.c -
All TTM driver have been converted to new io_mem_reserve/free
interface which allow driver to choose and return proper io
base, offset to core TTM for ioremapping if necessary. This
patch remove what is now deadcode.V2 adapt to match with change in first patch of the patchset
V3 update after io_mem_reserve/io_mem_free callback balancing
V4 adjust to minor cleanup
V5 remove the needs ioremap flag
V6 keep the ioremapping facility in TTM[airlied- squashed driver removals in here also]
Signed-off-by: Jerome Glisse
Reviewed-by: Thomas Hellstrom
Signed-off-by: Dave Airlie -
On fault the driver is given the opportunity to perform any operation
it sees fit in order to place the buffer into a CPU visible area of
memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon
should keep working properly. Future patch will take advantage of this
infrastructure and remove the old path from TTM once driver are
converted.V2 return VM_FAULT_NOPAGE if callback return -EBUSY or -ERESTARTSYS
V3 balance io_mem_reserve and io_mem_free call, fault_reserve_notify
is responsible to perform any necessary task for mapping to succeed
V4 minor cleanup, atomic_t -> bool as member is protected by reserve
mecanism from concurent access
V5 the callback is now responsible for iomapping the bo and providing
a virtual address this simplify TTM and will allow to get rid of
TTM_MEMTYPE_FLAG_NEEDS_IOREMAP
V6 use the bus addr data to decide to ioremap or this isn't needed
but we don't necesarily need to ioremap in the callback but still
allow driver to use static mappingSigned-off-by: Jerome Glisse
Reviewed-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
08 Apr, 2010
1 commit
-
There is case where we want to be able to wait only for the
GPU while not waiting for other buffer to be unreserved. This
patch split the no_wait argument all the way down in the whole
ttm path so that upper level can decide on what to wait on or
not.[airlied: squashed these 4 for bisectability reasons.]
drm/radeon/kms: update to TTM no_wait splitted argument
drm/nouveau: update to TTM no_wait splitted argument
drm/vmwgfx: update to TTM no_wait splitted argument
[vmwgfx patch: Reviewed-by: Thomas Hellstrom ]Signed-off-by: Jerome Glisse
Acked-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
06 Apr, 2010
3 commits
-
Sysfs interface allows user to configure pool allocator functionality and
change limits for the size of pool.Signed-off-by: Pauli Nieminen
Signed-off-by: Dave Airlie -
ttm_page_alloc_debugfs can be registered to output the state
of pools.Debugfs file will output number of pages freed from the pool,
number of pages in pool now and the lowes number of pages in
pool since previous shrink.Signed-off-by: Pauli Nieminen
Signed-off-by: Dave Airlie -
On AGP system we might allocate/free routinely uncached or wc memory,
changing page from cached (wb) to uc or wc is very expensive and involves
a lot of flushing. To improve performance this allocator use a pool
of uc,wc pages.Pools are protected with spinlocks to allow multiple threads to allocate pages
simultanously. Expensive operations are done outside of spinlock to maximize
concurrency.Pools are linked lists of pages that were recently freed. mm shrink callback
allows kernel to claim back pages when they are required for something else.Fixes:
* set_pages_array_wb handles highmem pages so we don't have to remove them
from pool.
* Add count parameter to ttm_put_pages to avoid looping in free code.
* Change looping from _safe to normal in pool fill error path.
* Initialize sum variable and make the loop prettier in get_num_unused_pages.* Moved pages_freed reseting inside the loop in ttm_page_pool_free.
* Add warning comment about spinlock context in ttm_page_pool_free.Based on Jerome Glisse's and Dave Airlie's pool allocator.
Signed-off-by: Jerome Glisse
Signed-off-by: Dave Airlie
Signed-off-by: Pauli Nieminen
Reviewed-by: Jerome Glisse
Signed-off-by: Dave Airlie
15 Mar, 2010
1 commit
-
Now that the drm core can do this, lets just use it, split the code out
so TTM doesn't have to drag all of drmP.h in.Signed-off-by: Dave Airlie
01 Mar, 2010
1 commit
-
Fix function prototype to match its actual usage and implementation.
drivers/gpu/drm/ttm/ttm_bo_util.c:341:10: error: symbol 'ttm_io_prot' redeclared with different type (originally declared at include/drm/ttm/ttm_bo_driver.h:911) - incompatible argument 1 (different signedness)
Signed-off-by: Randy Dunlap
Cc: David Airlie
Signed-off-by: Dave Airlie
14 Jan, 2010
1 commit
-
This is needed for a bugfix in the vmwgfx driver.
Drivers may have GPU bindings on buffers that core TTM is not aware of,
and TTM may view those buffers as ordinary system memory buffers.
Add a notifier to such drivers when TTM is about to move the buffer
contents out to swappable memory. The driver must then release any
private GPU bindings on those buffers.Signed-off-by: Thomas Hellstrom
Signed-off-by: Dave Airlie
15 Dec, 2009
1 commit
-
Signed-off-by: Jakob Bornecrantz
Signed-off-by: Dave Airlie