summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_display.c
Commit message (Collapse)AuthorAgeFilesLines
* make RAM device optionalAlexandre Courbot2015-04-141-1/+8
| | | | | | | | | | | | | | | 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/nvif: namespace of nvkm accessors (no binary change)Ben Skeggs2015-01-221-1/+1
| | | | | | | | | | NVKM is having it's namespace switched to nvkm_, which will conflict with these functions (which are workarounds for the fact that as of yet, we still aren't able to split DRM and NVKM completely). A comparison of objdump disassemblies proves no code changes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: dont switch vt on suspendMaarten Lankhorst2015-01-221-3/+6
| | | | | | | | | | Restore the nv50 cursor bo on resume, and load the lut in nv50_display_display_init so it gets set on resume too. Tested on a fermi and a curie. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Revert "drm/gem: Warn on illegal use of the dumb buffer interface v2"Dave Airlie2014-12-241-9/+0
| | | | | | | | | This reverts commit 355a70183848f21198e9f6296bd646df3478a26d. This had some bad side effects under normal operation, and should have been dropped earlier. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nv50/kms: directly use cursor image from userspace bufferBen Skeggs2014-12-021-6/+8
| | | | | | | | | Preparation for transition to planes, which use framebuffers for the cursor image. We've always done copies from the userspace buffer up until now for legacy reasons, there's no good reason to do so on the chipsets this code covers. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/kms: when pinning display-related buffers, force contig vramBen Skeggs2014-12-021-3/+3
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: teach nouveau_bo_pin() how to force a contig vram allocationBen Skeggs2014-12-021-3/+3
| | | | | | | | | | | We have the ability to move buffers around in the kernel if necessary, and should probably use it rather than failing if userspace passes us a non-contig buffer for a plane. The NOUVEAU_GEM_TILE_NONCONTIG flag from userspace will become a mere initial placement hint once all the relevant paths have been updated. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/kms: remove a couple of cursor-related stub functionsBen Skeggs2014-12-021-0/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: add support for gm204Ben Skeggs2014-12-021-0/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/gem: Warn on illegal use of the dumb buffer interface v2Thomas Hellstrom2014-11-211-0/+9
| | | | | | | | | | | | | | | | | | | It happens on occasion that developers of generic user-space applications abuse the dumb buffer API to get hold of drm buffers that they can both mmap() and use for GPU acceleration, using the assumptions that dumb buffers and buffers available for GPU are a) The same type and can be aribtrarily type-casted. b) fully coherent. This patch makes the most widely used drivers warn nicely when that happens, the next step will be to fail. v2: Move drmP.h changes to drm_gem.h. Fix Radeon dumb mmap breakage. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds2014-10-141-12/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull drm updates from Dave Airlie: "This is the main git pull for the drm, I pretty much froze major pulls at -rc5/6 time, and haven't had much fallout, so will probably continue doing that. Lots of changes all over, big internal header cleanup to make it clear drm features are legacy things and what are things that modern KMS drivers should be using. Also big move to use the new generic fences in all the TTM drivers. core: atomic prep work, vblank rework changes, allows immediate vblank disables major header reworking and cleanups to better delinate legacy interfaces from what KMS drivers should be using. cursor planes locking fixes ttm: move to generic fences (affects all TTM drivers) ppc64 caching fixes radeon: userptr support, uvd for old asics, reset rework for fence changes better buffer placement changes, dpm feature enablement hdmi audio support fixes intel: Cherryview work, 180 degree rotation, skylake prep work, execlist command submission full ppgtt prep work cursor improvements edid caching, vdd handling improvements nouveau: fence reworking kepler memory clock work gt21x clock work fan control improvements hdmi infoframe fixes DP audio ast: ppc64 fixes caching fix rcar: rcar-du DT support ipuv3: prep work for capture support msm: LVDS support for mdp4, new panel, gpu refactoring exynos: exynos3250 SoC support, drop bad mmap interface, mipi dsi changes, and component match support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (640 commits) drm/mst: rework payload table allocation to conform better. drm/ast: Fix HW cursor image drm/radeon/kv: add uvd/vce info to dpm debugfs output drm/radeon/ci: add uvd/vce info to dpm debugfs output drm/radeon: export reservation_object from dmabuf to ttm drm/radeon: cope with foreign fences inside the reservation object drm/radeon: cope with foreign fences inside display drm/core: use helper to check driver features drm/radeon/cik: write gfx ucode version to ucode addr reg drm/radeon/si: print full CS when we hit a packet 0 drm/radeon: remove unecessary includes drm/radeon/combios: declare legacy_connector_convert as static drm/radeon/atombios: declare connector convert tables as static drm/radeon: drop btc_get_max_clock_from_voltage_dependency_table drm/radeon/dpm: drop clk/voltage dependency filters for BTC drm/radeon/dpm: drop clk/voltage dependency filters for CI drm/radeon/dpm: drop clk/voltage dependency filters for SI drm/radeon/dpm: drop clk/voltage dependency filters for NI drm/radeon: disable audio when we disable hdmi (v2) drm/radeon: split audio enable between eg and r600 (v2) ...
| * drm/nouveau: specify if interruptible wait is desired in nouveau_fence_syncMaarten Lankhorst2014-09-301-2/+2
| | | | | | | | Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
| * Merge remote-tracking branch 'airlied/drm-next' into topic/vblank-reworkDaniel Vetter2014-09-111-157/+163
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dave asked me to do the backmerge before sending him the revised pull request, so here we go. Nothing fancy in the conflicts, just a few things changed right next to each another. Conflicts: drivers/gpu/drm/drm_irq.c Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
| | * drm/nouveau: use shared fences for readable objectsMaarten Lankhorst2014-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nouveau keeps track in userspace whether a buffer is being written to or being read, but it doesn't use that information. Change this to allow multiple readers on the same bo. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
| | * drm/nouveau: rework to new fence interfaceMaarten Lankhorst2014-09-021-2/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
| | * drm/ttm: kill fence_lockMaarten Lankhorst2014-09-011-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | No users are left, kill it off! :D Conversion to the reservation api is next on the list, after that the functionality can be restored with rcu. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
| | * drm/nouveau: require reservations for nouveau_fence_sync and nouveau_bo_fenceMaarten Lankhorst2014-09-011-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | This will ensure we always hold the required lock when calling those functions. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
| * | drm: Clarify vblank ts/scanoutpos sampling #definesDaniel Vetter2014-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've read INVBL as "invalid backlight" and got mightly confused. The #defines are already fairly long and we can afford to extend them a bit more without resulting in ugly code all over. I'm not sure how useful the complicated bitmask return value of these functions really are since no one checks them. But for now let's keep things as is. Cc: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* | | drm/nouveau: make sure display hardware is reinitialised on runtime resumeBen Skeggs2014-10-021-12/+11
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Linus commit 05c63c2ff23a80b654d6c088ac3ba21628db0173 modified the runtime suspend/resume paths to skip over display-related tasks to avoid locking issues on resume. Unfortunately, this resulted in the display hardware being left in a partially initialised state, preventing subsequent modesets from completing. This commit unifies the (many) suspend/resume paths, bringing back display (and fbcon) handling in the runtime paths. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: warn if we fail to re-pin fb on resumeBen Skeggs2014-08-151-1/+3
| | | | | | | | | | | | Spotted by Coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: fix headless modeBen Skeggs2014-08-101-1/+1
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/disp: implement nvif event sources for vblank/connector notifiersBen Skeggs2014-08-101-10/+10
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/disp: audit and version display classesBen Skeggs2014-08-101-13/+13
| | | | | | | | | | | | | | | | The full object interfaces are about to be exposed to userspace, so we need to check for any security-related issues and version the structs to make it easier to handle any changes we may need in the future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/disp: audit and version SCANOUTPOS methodBen Skeggs2014-08-101-8/+14
| | | | | | | | | | | | | | | | The full object interfaces are about to be exposed to userspace, so we need to check for any security-related issues and version the structs to make it easier to handle any changes we may need in the future. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: remove as much direct use of core headers as possibleBen Skeggs2014-08-101-1/+2
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: port to nvif client/device/objectsBen Skeggs2014-08-101-16/+16
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: initial pass at moving to struct nvif_deviceBen Skeggs2014-08-101-9/+9
| | | | | | | | | | | | | | This is an attempt at isolating some of the changes necessary to port to NVIF in a separate commit. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: kill nouveau_dev() + wrap register macrosBen Skeggs2014-08-101-2/+1
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/core: remove NV_D0 familyBen Skeggs2014-08-101-24/+33
| | | | | | | | | | | | | | The one place where it mattered has been replaced with a class check, which is more appropriate anyway. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau/core: rework event interfaceBen Skeggs2014-08-101-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a lot of prep-work for being able to send event notifications back to userspace. Events now contain data, rather than a "something just happened" signal. Handler data is now embedded into a containing structure, rather than being kmalloc()'d, and can optionally have the notify routine handled in a workqueue. Various races between suspend/unload with display HPD/DP IRQ handlers automagically solved as a result. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: store vblank event handler data in nv_crtcBen Skeggs2014-08-101-27/+28
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nv50/kms: move framebuffer wrangling out of common codeBen Skeggs2014-08-101-47/+12
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: Dis/Enable vblank irqs during suspend/resume.Mario Kleiner2014-08-101-0/+11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vblank irqs don't get disabled during suspend or driver unload, which causes irq delivery after "suspend" or driver unload, at least until the gpu is powered off. This could race with drm_vblank_cleanup() in the case of nouveau and cause a use-after-free bug if the driver is unloaded. More annoyingly during everyday use, at least on nv50 display engine (likely also others), vblank irqs are off after a resume from suspend, but the drm doesn't know this, so all vblank related functionality is dead after a resume. E.g., all windowed OpenGL clients will hang at swapbuffers time, as well as many fullscreen clients in many cases. This makes suspend/resume useless if one wants to use any OpenGL apps after the resume. In Linux 3.16, drm_vblank_on() was added, complementing the older drm_vblank_off() to solve these problems elegantly, so use those calls in nouveaus suspend/resume code. For kernels 3.8 - 3.15, we need to cherry-pick the drm_vblank_on() patch to support this patch. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: <stable@vger.kernel.org> #v3.16 Cc: <stable@vger.kernel.org> #v3.8+: f275228: drm: Add drm_vblank_on() Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/kms: reference vblank for crtc during pageflip.Mario Kleiner2014-06-171-0/+7
| | | | | | | | | | | Need to drm_vblank_get/put() the crtc involved in a pending pageflip, or we might not get vblank irqs and updates of vblank counts and timestamps for pageflip events and flip completion. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: stable@vger.kernel.org
* drm/nouveau: use connector events for HPD instead of GPIO watchingBen Skeggs2014-06-111-2/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: allow event source to handle multiple event types per indexBen Skeggs2014-06-111-2/+2
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/kms/nv04-nv40: fix pageflip events via special case.Mario Kleiner2014-06-101-2/+8
| | | | | | | | | | | | | | Cards with nv04 display engine can't reliably use vblank counts and timestamps computed via drm_handle_vblank(), as the function gets invoked after sending the pageflip events. Fix this by defaulting to the old crtcid = -1 fallback path on <= NV-50 cards, and only using the precise path on NV-50 and later. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Cc: <stable@vger.kernel.org> # 3.13+
* Merge branch 'drm-nouveau-next' of ↵Dave Airlie2014-05-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes nouveau fixes. * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/gm107/gr: bump attrib cb size quite a bit drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip drm/nouveau/bios: fix shadowing from PROM on big-endian systems drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi
| * drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flipMaarten Lankhorst2014-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes a regression introduced by 060810d7abaabca "drm/nouveau: fix locking issues in page flipping paths". chan->cli->mutex is unlocked a second time in the fail_unreserve path, fix this by moving mutex_unlock down. Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm: Replace crtc fb with primary plane fb (v3)Matt Roper2014-04-011-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Now that CRTC's have a primary plane, there's no need to track the framebuffer in the CRTC. Replace all references to the CRTC fb with the primary plane's fb. This patch was generated by the Coccinelle semantic patching tool using the following rules: @@ struct drm_crtc C; @@ - (C).fb + C.primary->fb @@ struct drm_crtc *C; @@ - (C)->fb + C->primary->fb v3: Generate patch via coccinelle. Actual removal of crtc->fb has been moved to a subsequent patch. v2: Fixup several lingering crtc->fb instances that were missed in the first patch iteration. [Rob Clark] Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
* drm/nouveau: fix small thinko in vblank timestamping.Mario Kleiner2014-03-261-1/+1
| | | | | | | | | | | | | | | | | *hpos horizontal scanout position doesn't need to be corrected to count the pixels between hactive end and htotal negative. That is only needed for *vpos to count lines until end of vblank for the vblank timestamping. Use hpos as is without correction. Removes occassional spikes in timestamps of up to 1 scanline duration, thereby improves accuracy to about +/- 2 usecs instead of +/- 12 usecs, wrt. true onset time as measured with high precision equipment on NV-A5. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* support for platform devicesAlexandre Courbot2014-03-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Upcoming mobile Kepler GPUs (such as GK20A) use the platform bus instead of PCI to which Nouveau is tightly dependent. This patch allows Nouveau to handle platform devices by: - abstracting PCI-dependent functions that were typically used for resource querying and page mapping, - introducing a nv_device_is_pci() function that allows to make PCI-dependent code conditional, - providing a nouveau_drm_platform_probe() function that takes a GPU platform device to be probed. Core code as well as engine/subdev drivers are updated wherever possible to make use of these functions. Some older drivers are too dependent on PCI to be properly updated, but all newer code on which future chips may depend should at least be runnable with platform devices. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: support modesetting on GM107Ben Skeggs2014-03-261-0/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: fix lock unbalance in nouveau_crtc_page_flipMaarten Lankhorst2014-01-301-1/+1
| | | | | | | | | | Fixes a regression introduced by d5c1e84b3a130f0 "drm/nouveau: hold mutex while syncing to kernel channel". Cc: stable@vger.kernel.org #3.13 Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: implement hooks for needed for drm vblank timestamping supportBen Skeggs2014-01-301-0/+80
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: call drm_vblank_cleanup() earlierBen Skeggs2014-01-231-2/+2
| | | | | | Fixes a NULL-ptr deref seen on module unload sometimes. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: create base display from common codeBen Skeggs2014-01-231-4/+28
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: hold mutex while syncing to kernel channelMaarten Lankhorst2014-01-231-7/+8
| | | | | | | | | Not holding the mutex potentially causes corruption of the kernel channel when page flipping. Cc: stable@vger.kernel.org #3.13 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/nouveau: fix memory leak in nouveau_crtc_page_flip()Christian Engelmayer2014-01-081-1/+1
| | | | | | | Fix a memory leak in the nouveau_crtc_page_flip() error handling path. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: unreference fence after syncingBen Skeggs2013-12-031-0/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
OpenPOWER on IntegriCloud