summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau
AgeCommit message (Collapse)AuthorFilesLines
2014-09-15drm/nouveau/core: pass related object into notify constructorBen Skeggs18-28/+42
The event source types/index might need to be derived from it. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-15drm/nouveau/bar: ioremap only the areas that we're actually usingBen Skeggs2-20/+19
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-11Merge remote-tracking branch 'airlied/drm-next' into topic/vblank-reworkDaniel Vetter265-6166/+12696
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>
2014-09-11drm: Clarify vblank ts/scanoutpos sampling #definesDaniel Vetter1-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>
2014-09-10PCI: Add pci_ignore_hotplug() to ignore hotplug events for a deviceBjorn Helgaas1-0/+1
Powering off a hot-pluggable device, e.g., with pci_set_power_state(D3cold), normally generates a hot-remove event that unbinds the driver. Some drivers expect to remain bound to a device even while they power it off and back on again. This can be dangerous, because if the device is removed or replaced while it is powered off, the driver doesn't know that anything changed. But some drivers accept that risk. Add pci_ignore_hotplug() for use by drivers that know their device cannot be removed. Using pci_ignore_hotplug() tells the PCI core that hot-plug events for the device should be ignored. The radeon and nouveau drivers use this to switch between a low-power, integrated GPU and a higher-power, higher-performance discrete GPU. They power off the unused GPU, but they want to remain bound to it. This is a reimplementation of f244d8b623da ("ACPIPHP / radeon / nouveau: Fix VGA switcheroo problem related to hotplug") but extends it to work with both acpiphp and pciehp. This fixes a problem where systems with dual GPUs using the radeon drivers become unusable, freezing every few seconds (see bugzillas below). The resume of the radeon device may also fail, e.g., This fixes problems on dual GPU systems where the radeon driver becomes unusable because of problems while suspending the device, as in bug 79701: [drm] radeon: finishing device. radeon 0000:01:00.0: Userspace still has active objects ! radeon 0000:01:00.0: ffff8800cb4ec288 ffff8800cb4ec000 16384 4294967297 force free ... WARNING: CPU: 0 PID: 67 at /home/apw/COD/linux/drivers/gpu/drm/radeon/radeon_gart.c:234 radeon_gart_unbind+0xd2/0xe0 [radeon]() trying to unbind memory from uninitialized GART ! or while resuming it, as in bug 77261: radeon 0000:01:00.0: ring 0 stalled for more than 10158msec radeon 0000:01:00.0: GPU lockup ... radeon 0000:01:00.0: GPU pci config reset pciehp 0000:00:01.0:pcie04: Card not present on Slot(1-1) radeon 0000:01:00.0: GPU reset succeeded, trying to resume *ERROR* radeon: dpm resume failed radeon 0000:01:00.0: Wait for MC idle timedout ! Link: https://bugzilla.kernel.org/show_bug.cgi?id=77261 Link: https://bugzilla.kernel.org/show_bug.cgi?id=79701 Reported-by: Shawn Starr <shawn.starr@rogers.com> Reported-by: Jose P. <lbdkmjdf@sharklasers.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Rajat Jain <rajatxjain@gmail.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Dave Airlie <airlied@redhat.com> CC: stable@vger.kernel.org # v3.15+
2014-09-10drm: add driver->set_busid() callbackDavid Herrmann1-6/+13
One step closer to dropping all the drm_bus_* code: Add a driver->set_busid() callback and make all drivers use the generic helpers. Nouveau is the only driver that uses two different bus-types with the same drm_driver. This is totally broken if both buses are available on the same machine (unlikely, but lets be safe). Therefore, we create two different drivers for each platform during module_init() and set the set_busid() callback respectively. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-09-05Merge branch 'linux-3.17' of ↵Dave Airlie1-2/+2
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes single fix for nouveau. * 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/core: don't leak oclass type bits to user
2014-09-05drm/nouveau/core: don't leak oclass type bits to userBen Skeggs1-2/+2
Fixes not being able to init fence subsystem when multiple boards are present. Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-02drm/nouveau: use shared fences for readable objectsMaarten Lankhorst6-47/+68
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>
2014-09-02drm/nouveau: Keep only a single list for validation.Maarten Lankhorst1-62/+34
Maintain the original order to handle VRAM/GART/mixed correctly for <nv50, it's likely not as important on newer cards. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-02drm/nouveau: use rcu in nouveau_gem_ioctl_cpu_prepMaarten Lankhorst1-16/+12
With the conversion to the reservation api this should be safe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-02drm/ttm: flip the switch, and convert to dma_fenceMaarten Lankhorst4-66/+24
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-09-02drm/nouveau: rework to new fence interfaceMaarten Lankhorst10-205/+383
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
2014-09-01drm/ttm: kill fence_lockMaarten Lankhorst3-36/+11
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>
2014-09-01drm/nouveau: require reservations for nouveau_fence_sync and nouveau_bo_fenceMaarten Lankhorst2-4/+15
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>
2014-09-01drm/nouveau: add reservation to nouveau_gem_ioctl_cpu_prepMaarten Lankhorst1-4/+18
Apart from some code inside ttm itself and nouveau_bo_vma_del, this is the only place where ttm_bo_wait is used without a reservation. Fix this so we can remove the fence_lock later on. After the switch to rcu the reservation lock will be removed again. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-27drm/ttm: move fpfn and lpfn into each placement v2Christian König3-23/+42
This allows us to more fine grained specify where to place the buffer object. v2: rebased on drm-next, add bochs changes as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-15Merge branch 'linux-3.17' of ↵Dave Airlie14-27/+57
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes A couple of thinkos from the -next merge, some random fixes from a coverity scan, fix for (at least) GK106 accidentally using non-existent vram on some board configurations, and better behaviour of the instmem allocations if vmalloc space runs out. * 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/platform: fix compilation error drm/nouveau/gk20a: add LTC device drm/nouveau: warn if we fail to re-pin fb on resume drm/nouveau/nvif: fix dac load detect method definition drm/gf100-/gr: fix -ENOSPC detection when allocating zbc table entries drm/nouveau/nvif: return null pointers on failure, in addition to ret != 0 drm/nouveau/ltc: fix tag base address getting truncated if above 4GiB drm/nvc0-/fb/ram: fix use of non-existant ram if partitions aren't uniform drm/nouveau/bar: behave better if ioremap failed drm/nouveau/kms: nouveau_fbcon_accel_fini can be static drm/nouveau: kill unused variable warning if !__OS_HAS_AGP drm/nouveau/nvif: fix a number of notify thinkos
2014-08-15drm/nouveau/platform: fix compilation errorAlexandre Courbot1-1/+2
nouveau_platform.c was still using the old nouveau_dev() macro, triggering a compilation error. Fix this. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/gk20a: add LTC deviceAlexandre Courbot1-0/+1
LTC device is now required for PGRAPH to work, add it. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau: warn if we fail to re-pin fb on resumeBen Skeggs1-1/+3
Spotted by Coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/nvif: fix dac load detect method definitionBen Skeggs1-2/+2
A thinko made me turn this into a u16 when cleaning up. Spotted by coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/gf100-/gr: fix -ENOSPC detection when allocating zbc table entriesBen Skeggs1-0/+6
Spotted by Coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/nvif: return null pointers on failure, in addition to ret != 0Ben Skeggs2-2/+6
Reported by Coverity. The intention is that the return value is checked, but let's be more paranoid and make it extremely obvious if something forgets to. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/ltc: fix tag base address getting truncated if above 4GiBBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nvc0-/fb/ram: fix use of non-existant ram if partitions aren't uniformBen Skeggs1-2/+2
Likely a large part of the GK106 woes.. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/bar: behave better if ioremap failedBen Skeggs1-3/+11
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/kms: nouveau_fbcon_accel_fini can be staticFengguang Wu1-2/+2
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau: kill unused variable warning if !__OS_HAS_AGPBen Skeggs1-2/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-15drm/nouveau/nvif: fix a number of notify thinkosBen Skeggs3-11/+20
Note to self: more sleep Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-09Merge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6Linus Torvalds260-5790/+12130
Pull nouveau drm updates from Ben Skeggs: "Apologies for not getting this done in time for Dave's drm-next merge window. As he mentioned, a pre-existing bug reared its head a lot more obviously after this lot of changes. It took quite a bit of time to track it down. In any case, Dave suggested I try my luck by sending directly to you this time. Overview: - more code for Tegra GK20A from NVIDIA - probing, reclockig - better fix for Kepler GPUs that have the graphics engine powered off on startup, method courtesy of info provided by NVIDIA - unhardcoding of a bunch of graphics engine setup on Fermi/Kepler/Maxwell, will hopefully solve some issues people have noticed on higher-end models - support for "Zero Bandwidth Clear" on Fermi/Kepler/Maxwell, needs userspace support in general, but some lucky apps will benefit automagically - reviewed/exposed the full object APIs to userspace (finally), gives it access to perfctrs, ZBC controls, various events. More to come in the future. - various other fixes" Acked-by: Dave Airlie <airlied@redhat.com> * 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (87 commits) drm/nouveau: expose the full object/event interfaces to userspace drm/nouveau: fix headless mode drm/nouveau: hide sysfs pstate file behind an option again drm/nv50/disp: shhh compiler drm/gf100-/gr: implement the proper SetShaderExceptions method drm/gf100-/gr: remove some broken ltc bashing, for now drm/gf100-/gr: unhardcode attribute cb config drm/gf100-/gr: fetch tpcs-per-ppc info on startup drm/gf100-/gr: unhardcode pagepool config drm/gf100-/gr: unhardcode bundle cb config drm/gf100-/gr: improve initial context patch list helpers drm/gf100-/gr: add support for zero bandwidth clear drm/nouveau/ltc: add zbc drivers drm/nouveau/ltc: s/ltcg/ltc/ + cleanup drm/nouveau: use ram info from nvif_device drm/nouveau/disp: implement nvif event sources for vblank/connector notifiers drm/nouveau/disp: allow user direct access to channel control registers drm/nouveau/disp: audit and version display classes drm/nouveau/disp: audit and version SCANOUTPOS method drm/nv50-/disp: audit and version PIOR_PWR method ...
2014-08-10drm/nouveau: expose the full object/event interfaces to userspaceBen Skeggs8-10/+424
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: fix headless modeBen Skeggs2-2/+3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: hide sysfs pstate file behind an option againBen Skeggs1-1/+8
No-one has yet had time to move this to debugfs as discussed during the last merge window. Until this happens, hide the option to make it clear it's not going to be here forever. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nv50/disp: shhh compilerBen Skeggs1-4/+4
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: implement the proper SetShaderExceptions methodBen Skeggs9-17/+53
We have another version of it implemented in SW, however, that version isn't serialised with normal PGRAPH operation and can possibly clobber the enables for another context. This is the same method that's implemented by the NVIDIA binary driver. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: remove some broken ltc bashing, for nowBen Skeggs13-58/+0
... and hope that the defaults are good enough. This was always supposed to be a read/modify/write thing anyway, so we're writing very wrong stuff for some boards already. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: unhardcode attribute cb configBen Skeggs13-166/+199
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: fetch tpcs-per-ppc info on startupBen Skeggs9-1/+16
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: unhardcode pagepool configBen Skeggs13-41/+75
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: unhardcode bundle cb configBen Skeggs13-41/+100
Should be the same values as before, except: GF117 has smaller buffer allocated, as per register setup. GK20A now uses values from Tegra driver, not GK104's. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: improve initial context patch list helpersBen Skeggs4-20/+51
Removes need for fixed buffer indices, and allows the functions utilising them to also be run outside of context generation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/gf100-/gr: add support for zero bandwidth clearBen Skeggs10-11/+313
Default ZBC table is compatible with binary driver defaults. Userspace will need to be updated to take full advantage of this feature, however, some applications will see a performance boost without updated drivers. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/ltc: add zbc driversBen Skeggs6-1/+108
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/ltc: s/ltcg/ltc/ + cleanupBen Skeggs17-235/+362
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau: use ram info from nvif_deviceBen Skeggs8-32/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/disp: implement nvif event sources for vblank/connector notifiersBen Skeggs11-20/+47
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/disp: allow user direct access to channel control registersBen Skeggs4-1/+24
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2014-08-10drm/nouveau/disp: audit and version display classesBen Skeggs52-423/+323
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>
2014-08-10drm/nouveau/disp: audit and version SCANOUTPOS methodBen Skeggs15-172/+204
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>