History log of /drivers/gpu/drm/nouveau/nouveau_sgdma.c
Revision Date Author Comments
8e7e70522d760c4ccd4cd370ebfa0ba69e006c6e 09-Nov-2011 Jerome Glisse <jglisse@redhat.com> drm/ttm: isolate dma data from ttm_tt V4

Move dma data to a superset ttm_dma_tt structure which herit
from ttm_tt. This allow driver that don't use dma functionalities
to not have to waste memory for it.

V2 Rebase on top of no memory account changes (where/when is my
delorean when i need it ?)
V3 Make sure page list is initialized empty
V4 typo/syntax fixes

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
3230cfc34fca9d17c1628cf0e4ac25199592a69a 17-Oct-2011 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> drm/nouveau: enable the ttm dma pool when swiotlb is active V3

If the card is capable of more than 32-bit, then use the default
TTM page pool code which allocates from anywhere in the memory.

Note: If the 'ttm.no_dma' parameter is set, the override is ignored
and the default TTM pool is used.

V2 use pci_set_consistent_dma_mask
V3 Rebase on top of no memory account changes (where/when is my
delorean when i need it ?)

CC: Ben Skeggs <bskeggs@redhat.com>
CC: Francisco Jerez <currojerez@riseup.net>
CC: Dave Airlie <airlied@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
649bf3ca77343e3be1e0af8e21356fa569b1abd9 02-Nov-2011 Jerome Glisse <jglisse@redhat.com> drm/ttm: merge ttm_backend and ttm_tt V5

ttm_backend will only exist with a ttm_tt, and ttm_tt
will only be of interest when bound to a backend. Merge them
to avoid code and data duplication.

V2 Rebase on top of memory accounting overhaul
V3 Rebase on top of more memory accounting changes
V4 Rebase on top of no memory account changes (where/when is my
delorean when i need it ?)
V5 make sure ttm is unbound before destroying, change commit
message on suggestion from Tormod Volden

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
a10e9e1dbb39970f232b1e2b0e4f738e2d77079f 25-Nov-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: fix oopses caused by clear being called on unpopulated ttms

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a0d9a8feb928465f3cb525a19e5fafd06ef66ced 30-Aug-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove allocations from gart populate() hook

Since some somewhat questionable changes a while back, TTM provides a
completely empty array of struct dma_address that stays around for the
entire lifetime of the TTM object.

Lets use this array, *always*, rather than wasting yet more memory on
another array who's purpose is identical, as well as yet another bool array
of the same size saying *which* of the previous two arrays to use...

This change will also solve the high order allocation failures seen by
some people while using nouveau.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1bf27066017c820b8ab2a1ac8430ea470c2de0c3 22-Aug-2011 Marcin Slusarz <marcin.slusarz@gmail.com> drm/nouveau: fix nv04_sgdma_bind on non-"4kB pages" archs

nv04_sgdma_bind binds the same page multiple times on
architectures where PAGE_SIZE != 4096.
Let's fix it.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
17c8b960930da3599e47801a54ac0ea1070545d2 22-Aug-2011 Marcin Slusarz <marcin.slusarz@gmail.com> drm/nouveau: properly handle allocation failure in nouveau_sgdma_populate

Not cleaning after alloc failure would result in crash on destroy,
because nouveau_sgdma_clear assumes "ttm_alloced" to be not null when
"pages" is not null.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
58b6542b50ded4243c26c251c0507e5f658642f6 27-Jun-2011 Jon Mason <jdmason@kudzu.us> DRM: remove drm_pci_device_is_pcie

drm_pci_device_is_pcie duplicates the funcationality of pci_is_pcie.
Convert callers of the former to the latter. This has the side benefit
of removing an unnecessary search in the PCI configuration space due to
using a saved PCIe capability offset.

[airlied: update for new callsite]

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Dave Airlie <airlied@redhat.com>
4cff3ce5fe5c3c88f103d58c5e7855f9519960e4 01-Jun-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv40: fall back to paged dma object for the moment

PCI(E)GART isn't quite stable it seems, fall back to old method until I get
the time to sort it out properly.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
03a80665341bbb9a57064c2ddeca13b554d56893 09-May-2011 Dave Airlie <airlied@redhat.com> drm/radeon/nouveau: fix build regression on alpha due to Xen changes.

The Xen changes were using DMA_ERROR_CODE which isn't defined on a few
platforms, however we reverted the Xen patch that caused use to try and
use this code path earlier in 2.6.39 cycle, so for now lets just force
the code to never take this path and allow it to build again on alpha.

The proper long term answer is probably to store if the dma_addr has
been assigned to alongside the dma_addr in the higher level code,
though I think Thomas wanted to rewrite most of this anyways properly.

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8706398bf8841868d4e56fc924a5edcd3f156243 11-Apr-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: populate ttm_alloced with false, when it's not

Caught with kmemcheck on unrelated business.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
01d153326ecd81ed77395f1699a30af416cf77ab 08-Apr-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: fix nv30 pcie boards

Wasn't aware they even existed, apparently they do! They're actually
AGP chips with a bridge as far as I can tell, which puts them in the
same boat as nv40/nv45.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
459ca7e5283914845d7139905ff58824d2b0cc85 08-Mar-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv40: attempt to reserve just enough vram for all 32 channels

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>
26c0c9e33a2eb44b345d22d5928d5c8b7b261226 09-Feb-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv50-nvc0: delay GART binding until move_notify time

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>
7948758d27be1b69b6a79ed4f3f22e36a3b95965 11-Jan-2011 Ben Skeggs <bskeggs@redhat.com> drm/nv40: implement support for on-chip PCIEGART

v2. moved nv44 pciegart table back to instmem, where it's not
accessible by userspace clients.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
58e6c7a9183071b89b0ac94862f369ed55775a7a 11-Jan-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: introduce new gart type, and name _SGDMA more appropriately

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>
efa58db3de82ab0fdc0774aef69e2dd8a27cc98f 10-Jan-2011 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: move + rename some stuff in nouveau_sgdma.c

In preparation for the addition of a new nv40 pcie backend.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
e0138c26cdeee8c033256ccd9e07d66db3c998be 02-Dec-2010 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> nouveau/ttm/PCIe: Use dma_addr if TTM has set it.

If the TTM layer has used the DMA API to setup pages that are
TTM_PAGE_FLAG_DMA32 (look at patch titled: "ttm: Utilize the
DMA API for pages that have TTM_PAGE_FLAG_DMA32 set"), lets
use it when programming the GART in the PCIe type cards.

This patch skips doing the pci_map_page (and pci_unmap_page) if
there is a DMA addresses passed in for that page. If the dma_address
is zero (or DMA_ERROR_CODE), then we continue on with our old
behaviour.

[v2: Added a review-by tag]

Reviewed-by: Thomas Hellstrom <thomas@shipmail.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
27e8b237944af967e0a808580278d432cb028455 02-Dec-2010 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> ttm: Expand (*populate) to support an array of DMA addresses.

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 <thellstrom@shipmail.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
fd70b6cd780742b97f525415bf5e4fb24a4bb6d8 08-Dec-2010 Francisco Jerez <currojerez@riseup.net> drm/nv04-nv40: Fix up PCI(E) GART DMA object bus address calculation.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b571fe21f5c24760368b3fb927af5a7384d7721b 16-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: tidy up PCIEGART implementation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
ca130c2267d0719c92ed188e15082d6baad6c046 20-Nov-2010 Francisco Jerez <currojerez@riseup.net> drm/nv04-nv40: Give "gpuobj->cinst" the same meaning as on nv50.

No functional changes, just simplify some code paths a bit.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7f4a195fcbd8b16f25f1de7f1419414d7505daa5 16-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: tidy up and extend dma object creation interfaces

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
7b4808bb6ee63c9cc9c9be5a52f0c7babfc50659 14-Nov-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove dummy page use from PCI(E)GART, use PTE present instead

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9d5a6c4353eeac1e0095e731a0a746254f23af83 01-Nov-2010 Francisco Jerez <currojerez@riseup.net> drm/nouveau: Make PCIE GART size depend on the available RAMIN space.

Reported-by: Tomas Miljenovic <tomasmiljenovic@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
56ac7475350ee646f5f7316abcdf65d3be94da1c 22-Oct-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: implement possible workaround for NV86 PGRAPH TLB flush hang

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
3c29f9e74591d2f365b159cf59193b19a2f65640 15-Oct-2010 Lucas Stach <dev@lynxeye.de> drm/nouveau: fix nv40 pcie gart size

Nouveau sets the PCIE GART size to 64MiB for all cards before nv50,
but nv40 has enough RAMIN space to support 512MiB GART size. This
patch fixes this value to make use of this hardware capability.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
d961db75ce86a84f1f04e91ad1014653ed7d9f46 05-Aug-2010 Ben Skeggs <bskeggs@redhat.com> drm/ttm: restructure to allow driver to plug in alternate memory manager

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>
b6fd780791e9189b781e27a443d47bd21ce5145f 13-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: zero dummy page

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
17b20348ea94a92a54898c518b514c564d12e4c3 13-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: mark PCIEGART pages non-present rather than using dummy page

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
a8eaebc6c52bb0cd243b4cb421068f42d378be9c 01-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: remove nouveau_gpuobj_ref completely, replace with sanity

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
b3beb167af0de6d7cb03aed0687eca645cfd06a6 01-Sep-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: modify object accessors, offset in bytes rather than dwords

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
bd6aaea89318bd3aede9e219d6a003afd9978d5b 12-Aug-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: check for error when allocating/mapping dummy page

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
631872155f35b907ae3950016d9e72a308449d69 08-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: move tlb flushing to a helper function

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
f56cb86f9abd229418f894a8ffedfb9ff465c181 08-Jul-2010 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: add instmem flush() hook

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>
40b2a687bd92827ca144d3623cf48377d8f7680d 15-Mar-2010 Ben Skeggs <bskeggs@redhat.com> drm/nv50: add more 0x100c80 flushy magic

Fixes the !vbo_fifo path in the 3D driver on certain chipsets. Still not
really any good idea of what exactly the magic achieves, but it makes
things work.

While we're at it, in the PCIEGART path, flush on unbinding also.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
dd19e44b28b12f7ea59ebb54d8ea18054da7f9d1 30-Jan-2010 Marcin Slusarz <marcin.slusarz@gmail.com> drm/nouveau: move dereferences after null checks

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
6ee738610f41b59733f63718f0bdbcba7d3a3f12 11-Dec-2009 Ben Skeggs <bskeggs@redhat.com> drm/nouveau: Add DRM driver for NVIDIA GPUs

This adds a drm/kms staging non-API stable driver for GPUs from NVIDIA.

This driver is a KMS-based driver and requires a compatible nouveau
userspace libdrm and nouveau X.org driver.

This driver requires firmware files not available in this kernel tree,
interested parties can find them via the nouveau project git archive.

This driver is reverse engineered, and is in no way supported by nVidia.

Support for nearly the complete range of nvidia hw from nv04->g80 (nv50)
is available, and the kms driver should support driving nearly all
output types (displayport is under development still) along with supporting
suspend/resume.

This work is all from the upstream nouveau project found at
nouveau.freedesktop.org.

The original authors list from nouveau git tree is:
Anssi Hannula <anssi.hannula@iki.fi>
Ben Skeggs <bskeggs@redhat.com>
Francisco Jerez <currojerez@riseup.net>
Maarten Maathuis <madman2003@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
Matthew Garrett <mjg@redhat.com>
Matt Parnell <mparnell@gmail.com>
Patrice Mandin <patmandin@gmail.com>
Pekka Paalanen <pq@iki.fi>
Xavier Chantry <shiningxc@gmail.com>
along with project founder Stephane Marchesin <marchesin@icps.u-strasbg.fr>

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>