summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'topic/drm-misc-2015-04-15' of ↵Dave Airlie2015-04-167-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/drm-intel into drm-next One more drm-misch pull for 4.1 with mostly simple stuff and boring refactoring. Even the cursor fix from Matt is just to make a really anal igt happy. * tag 'topic/drm-misc-2015-04-15' of git://anongit.freedesktop.org/drm-intel: drm: fix trivial typo mistake drm: Make integer overflow checking cover universal cursor updates (v2) drm: make crtc/encoder/connector/plane helper_private a const pointer drm/armada: constify struct drm_encoder_helper_funcs pointer drm/radeon: constify more struct drm_*_helper funcs pointers drm/edid: add #defines for ELD versions drm/atomic: Add for_each_{connector,crtc,plane}_in_state helper macros drm: Use kref_put_mutex in drm_gem_object_unreference_unlocked drm/drm: constify all struct drm_*_helper funcs pointers drm/qxl: constify all struct drm_*_helper funcs pointers drm/nouveau: constify all struct drm_*_helper funcs pointers drm/radeon: constify all struct drm_*_helper funcs pointers drm/gma500: constify all struct drm_*_helper funcs pointers drm/mgag200: constify all struct drm_*_helper funcs pointers drm/exynos: constify all struct drm_*_helper funcs pointers drm: Fix some typos
| * drm/nouveau: constify all struct drm_*_helper funcs pointersJani Nikula2015-04-077-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are not to be modified. Generated using the semantic patch: @@ @@ ( const struct drm_crtc_helper_funcs * | - struct drm_crtc_helper_funcs * + const struct drm_crtc_helper_funcs * ) @@ @@ ( const struct drm_encoder_helper_funcs * | - struct drm_encoder_helper_funcs * + const struct drm_encoder_helper_funcs * ) @@ @@ ( const struct drm_connector_helper_funcs * | - struct drm_connector_helper_funcs * + const struct drm_connector_helper_funcs * ) @@ @@ ( const struct drm_plane_helper_funcs * | - struct drm_plane_helper_funcs * + const struct drm_plane_helper_funcs * ) Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* | drm/nouveau/bios: fix fetching from acpi on certain systemsJan Vesely2015-04-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nvbios_extend() returns 1 to indicate "extended the array" and 0 to indicate the array is already big enough. This is used by the core shadowing code to prevent re-fetching chunks of the image that have already been shadowed. The ACPI fetching code may possibly need to extend this further due to requiring fetches to happen in 4KiB chunks. Under certain circumstances (that happen if the total image size is a multiple of 4KiB), the memory allocated to store the shadow will already be big enough, causing the ACPI code's nvbios_extend() call to return 0, which is misinterpreted as a failure. The fix is simple, accept >= 0 as a successful condition here. The core will have already made sure that we're not re-fetching data we already have. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89047 v2 (Ben Skeggs): - dropped hunk which would cause unnecessary re-fetching - more descriptive explanation Signed-off-by: Jan Vesely <jano.vesely@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gm206: initial init+ctx codeBen Skeggs2015-04-149-16/+162
| | | | | | | | | | | | | | | | Uncertain whether the GPC pack change is due to a newer driver version, or a legitimate difference from GM204. My GM204 has broken vram, so can't currently try a newer binary driver on it to confirm. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/ce/gm206: enable support via gm204 codeBen Skeggs2015-04-141-1/+1
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/fifo/gm206: enable support via gm204 codeBen Skeggs2015-04-141-2/+2
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gm204: initial init+ctx codeBen Skeggs2015-04-1410-18/+1484
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: support for buffer moves via MaxwellDmaCopyABen Skeggs2015-04-141-0/+2
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/ce/gm204: initial supportBen Skeggs2015-04-144-1/+178
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: add support for gm20x fifo channelsBen Skeggs2015-04-142-1/+3
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/fifo/gm204: initial supportBen Skeggs2015-04-147-5/+68
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gk104-: prevent reading non-existent regs in intr handlerBen Skeggs2015-04-141-1/+6
| | | | | | | | | | | | | | | | | | Under certain circumstances the trapped address will contain subc 7, which GK104 GR doesn't have anymore. Notice this case to avoid causing additional priv ring faults. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gm107: very slightly demagic part of attrib cb setupBen Skeggs2015-04-141-1/+1
| | | | | | | | | | | | | | No idea if "3" is a constant or derived from something else, but the value is unchanged in the limited traces of gm107/gm204 I have here. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gk104-: correct crop/zrop num_active_fbps settingBen Skeggs2015-04-143-14/+11
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gf100-: add symbolic names for classesBen Skeggs2015-04-149-17/+24
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gm107: support tpc "strand" ctxsw in gpccs ucodeBen Skeggs2015-04-1410-766/+1025
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gf100-: support mmio access with gpc offset from gpccs ucodeBen Skeggs2015-04-148-709/+726
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr: fix engine name, cosmetic search+replace mistakeBen Skeggs2015-04-141-1/+1
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/pmu/gk20a: add some missing staticsAlexandre Courbot2015-04-141-3/+4
| | | | | | | | | | | | | | Make static a few functions and structures that should be. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/platform: fix probe error pathAlexandre Courbot2015-04-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | A "return 0" found its way in the middle of the error path of nouveau_platform_probe(), remove it as it will make the kernel crash if we try to unload the module afterwards. While we are at it, also remove the IOMMU domain if it has been created, as we should. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/platform: release IOMMU's mm upon exitAlexandre Courbot2015-04-141-0/+1
| | | | | | | | | | | | | | | | nvkm_mm_fini() was not called when exiting the driver, resulting in a memory leak. Fix this. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gk104-gk20a: call pmu to disable any power-gating before ctor()Ben Skeggs2015-04-145-4/+18
| | | | | | | | | | | | | | | | On some of these chipsets, reading NV_PGRAPH_GPC_GPM_PD_PES_TPC_ID_MASK can trigger a PRI fault and return an error code instead of a TPC mask, unless PGOB has been disabled first. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/pmu/gk208: implement gr power-up magic with gk110_pmu_pgob()Ben Skeggs2015-04-144-39/+5
| | | | | | | | | | | | | | | | Before we moved gk110's implementation of this to pmu, the functions were identical. This commit just switches GK208 to use the new (more complete) implementation of the power-up sequence. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/pmu/gk110: implement gr power-up magic like PGOB on earlier chipsBen Skeggs2015-04-147-44/+101
| | | | | | | | | | | | | | Turns out the PTHERM part of this dance is bracketed by the same PMU fiddling that occurs on GK104/6, let's assume it's also PGOB. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/pbus/hwsq: Make code size u16Roy Spliet2015-04-141-1/+1
| | | | | | | | | | | | | | So we can actually use the full 512 byte code space Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/pbus/hwsq: Support strided register writesRoy Spliet2015-04-141-7/+37
| | | | | | | | | | Signed-off-by: Roy Spliet <rspliet@eclipso.eu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/instmem/gk20a: fix crash during error pathAlexandre Courbot2015-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If a memory allocation fails when using the DMA allocator, gk20a_instobj_dtor_dma() will be called on the failed instmem object. At this time, node->handle might not be NULL despite the call to dma_alloc_attrs() having failed. node->cpuaddr is the right member to check for such a failure, so use it instead. Reported-by: Vince Hsu <vinceh@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/disp/gf110-: fix base channel update debug/error outputBen Skeggs2015-04-141-2/+2
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/disp/nv50-: fix push buffers in vramBen Skeggs2015-04-141-1/+1
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: bump driver patchlevel for coherent flagBen Skeggs2015-04-141-1/+3
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gem: allow user-space to specify an object should be coherentAlexandre Courbot2015-04-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User-space use mappable BOs notably for fences, and expects that a value update by the GPU will be immediatly visible through the user-space mapping. ARM has a property that may prevent this from happening though: memory can be mapped multiple times only if the different mappings share the same caching properties. However all the lowmem memory is already identity-mapped into the kernel with cache enabled, so when user-space requests an uncached mapping, we actually get an "undefined caching policy" one and this has strange side-effects described on Freedesktop bug 86690. To prevent this from happening, allow user-space to explicitly specify which objects should be coherent, and create such objects with the TTM_PL_FLAG_UNCACHED flag. This will make TTM allocate memory using the DMA API, which will fix the identify mapping and allow us to safely map the objects to user-space uncached. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/instmem/gk20a: add IOMMU supportAlexandre Courbot2015-04-141-39/+252
| | | | | | | | | | | | | | | | | | | | Let GK20A's instmem take advantage of the IOMMU if it is present. Having an IOMMU means that instmem is no longer allocated using the DMA API, but instead obtained through page_alloc and made contiguous to the GPU by IOMMU mappings. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/platform: probe IOMMU if presentAlexandre Courbot2015-04-142-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | Tegra SoCs have an IOMMU that can be used to present non-contiguous physical memory as contiguous to the GPU and maximize the use of large pages in the GPU MMU, leading to performance gains. This patch adds support for probing such a IOMMU if present and make its properties available in the nouveau_platform_gpu structure so subsystems can take advantage of it. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/instmem/gk20a: use DMA attributesAlexandre Courbot2015-04-141-4/+20
| | | | | | | | | | | | | | | | | | | | | | instmem for GK20A is allocated using dma_alloc_coherent(), which provides us with a coherent CPU mapping that we never use because instmem objects are accessed through PRAMIN. Switch to dma_alloc_attrs() which gives us the option to dismiss that CPU mapping and free up some CPU virtual space. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gk20a: remove RAM deviceAlexandre Courbot2015-04-144-70/+0
| | | | | | | | | | | | | | | | Now that Nouveau can operate even when there is no RAM device, remove the dummy one used by GK20A. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/instmem/gk20a: move memory allocation to instmemAlexandre Courbot2015-04-145-85/+216
| | | | | | | | | | | | | | | | | | GK20A does not have dedicated RAM, thus having a RAM device for it does not make sense. Move the contiguous physical memory allocation to instmem. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | make RAM device optionalAlexandre Courbot2015-04-147-17/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a RAM device does not make sense for chips like GK20A which have no dedicated video memory. The dummy RAM device that we used so far works as a temporary band-aid, but in the longer term it is desirable for the driver to be able to work without any kind of VRAM. This patch adds a few conditionals in places where a RAM device was assumed to be present and allows some more objects to be allocated from the TT domain, allowing Nouveau to handle GPUs for which pfb->ram == NULL. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/gr/gf100: Clear notify interruptLauri Peltonen2015-04-141-0/+9
| | | | | | | | | | | | | | | | | | Notify interrupt is only used for cyclestats. We can just clear it and avoid an "unknown stat" error that gets printed to dmesg otherwise. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/graph/nvc0: Fix engine pointer retrievalLauri Peltonen2015-04-141-1/+1
| | | | | | | | | | | | | | | | | | Other methods in this file suggest this is the correct way to retrieve the engine pointer. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/devinit/nv04: change owner to intBen Skeggs2015-04-141-1/+1
| | | | | | | | | | | | | | We use -1 to mean "not read from hw yet" Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/mxm: indent an if statementDan Carpenter2015-04-141-1/+1
| | | | | | | | | | | | | | | | This if statement is correct but it wasn't indented, so it looked like some code was missing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/fuse/gm107: simplify the return logicMartin Peres2015-04-141-3/+1
|/ | | | | | | | | Spotted by coccinelle: drivers/gpu/drm/nouveau/core/subdev/fuse/gm107.c:50:5-8: WARNING: end returns can be simpified Signed-off-by: Martin Peres <martin.peres@free.fr> Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bios: fix i2c table parsing for dcb 4.1Stefan Huehner2015-03-171-1/+5
| | | | | | | | | Code before looked only at bit 31 to decide if a port is unused. However dcb 4.1 spec says 0x1F in bits 31-27 and 26-22 means unused. This fixed hdmi monitor detection on GM206. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/device/gm100: Basic GM206 bring up (as copy of GM204)Stefan Huehner2015-03-171-0/+43
| | | | | | | Enough to get VGA monitor on DVI-I output have output. HDMI output not yet working Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/device: post write to NV_PMC_BOOT_1 when flipping endian switchBen Skeggs2015-03-171-2/+4
| | | | | | fdo#88868 Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gr/gf100: fix some accidental or'ing of buffer addressesBen Skeggs2015-03-173-6/+6
| | | | | | fdo#83992 Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo/nv04: remove the loop from the interrupt handlerBen Skeggs2015-03-171-50/+35
| | | | | | | | | | | | | | | Complete bong hit (and not the last...), the hardware will reassert the interrupt to PMC if it's necessary. Also potentially harmful in the face of interrupts such as the non-stall interrupt, which remain active in NV_PFIFO_INTR even when we don't care about servicing it. It appears (hopefully, fdo#87244), that under certain loads, the methods may pass quickly enough to hit the "100 spins and kill PFIFO" thing that we had going on. Not ideal ;) Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/ttm: device address space != CPU address spaceAlex Deucher2015-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | We need to store device offsets in 64 bit as the device address space may be larger than the CPU's. Fixes GPU init failures on radeons with 4GB or more of vram on 32 bit kernels. We put vram at the start of the GPU's address space so the gart aperture starts at 4 GB causing all GPU addresses in the gart aperture to get truncated. bug: https://bugs.freedesktop.org/show_bug.cgi?id=89072 [airlied: fix warning on nouveau build] Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: thellstrom@vmware.com Acked-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge tag 'topic/core-stuff-2015-01-23' of ↵Dave Airlie2015-01-271-6/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/drm-intel into drm-next Just flushing out my drm-misc branch, nothing major. Well too old patches I've dug out from years since a patch from Rob look eerily familiar ;-) * tag 'topic/core-stuff-2015-01-23' of git://anongit.freedesktop.org/drm-intel: drm/probe-helper: clamp unknown connector status in the poll work drm/probe-helper: don't lose hotplug event next: drm/atomic: Use copy_from_user to copy 64 bit data from user space drm: Make drm_read() more robust against multithreaded races drm/fb-helper: Propagate errors from initial config failure drm: Drop superfluous "select VT_HW_CONSOLE_BINDING"
| * drm/fb-helper: Propagate errors from initial config failureThierry Reding2015-01-211-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make drm_fb_helper_initial_config() return an int rather than a bool so that the error can be properly propagated. While at it, update drivers to propagate errors further rather than just ignore them. v2: - cirrus: No cleanup is required, the top-level cirrus_driver_load() will do it as part of cirrus_driver_unload() in its cleanup path. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> [danvet: Squash in simplification patch from kbuild.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
OpenPOWER on IntegriCloud