summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v4.10-rc8' into drm-nextDave Airlie2017-02-231-0/+2
|\ | | | | | | | | | | | | Linux 4.10-rc8 Backmerge Linus rc8 to fix some conflicts, but also to avoid pulling it in via a fixes pull from someone.
| * drm/nouveau: Handle fbcon suspend/resume in seperate workerLyude Paul2017-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resuming from RPM can happen while already holding dev->mode_config.mutex. This means we can't actually handle fbcon in any RPM resume workers, since restoring fbcon requires grabbing dev->mode_config.mutex again. So move the fbcon suspend/resume code into it's own worker, and rely on that instead to avoid deadlocking. This fixes more deadlocks for runtime suspending the GPU on the ThinkPad W541. Reproduction recipe: - Get a machine with both optimus and a nvidia card with connectors attached to it - Wait for the nvidia GPU to suspend - Attempt to manually reprobe any of the connectors on the nvidia GPU using sysfs - *deadlock* [airlied: use READ_ONCE to address Hans's comment] Signed-off-by: Lyude <lyude@redhat.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Kilian Singer <kilian.singer@quantumtechnology.info> Cc: Lukas Wunner <lukas@wunner.de> Cc: David Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/nouveau: allocate device object for every clientBen Skeggs2017-02-171-1/+2
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm/nouveau: tidy up the client init/fini interfacesBen Skeggs2017-02-171-2/+3
|/ | | | | | These were a little insane. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bl: Assign different names to interfacesPierre Moreau2016-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, every backlight interface created by Nouveau uses the same name, nv_backlight. This leads to a sysfs warning as it tries to create an already existing folder. This patch adds a incremented number to the name, but keeps the initial name as nv_backlight, to avoid possibly breaking userspace; the second interface will be named nv_backlight1, and so on. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86539 v2: * Switch to using ida for generating unique IDs, as suggested by Ilia Mirkin; * Allocate backlight name on the stack, as suggested by Ilia Mirkin; * Move `nouveau_get_backlight_name()` to avoid forward declaration, as suggested by Ilia Mirkin; * Fix reference to bug report formatting, as reported by Nick Tenney. v3: * Define a macro for the size of the backlight name, to avoid defining it multiple times; * Use snprintf in place of sprintf. v4: * Do not create similarly named interfaces when reaching the maximum amount of unique names, but fail instead, as pointed out by Lukas Wunner Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Rename acpi_work to hpd_workHans de Goede2016-11-281-1/+1
| | | | | | | | | | | | | We need to call drm_helper_hpd_irq_event() on resume to properly detect monitor connection / disconnection on some laptops. For runtime-resume (which gets called on resume from normal suspend too) we must call drm_helper_hpd_irq_event() from a workqueue to avoid a deadlock. Rename acpi_work to hpd_work, and move it out of the #ifdef CONFIG_ACPI blocks to make it suitable for generic work. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: Intercept ACPI_VIDEO_NOTIFY_PROBEHans de Goede2016-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various notebooks with nvidia GPUs generate an ACPI_VIDEO_NOTIFY_PROBE acpi-video event when an external device gets plugged in (and again on modesets on that connector), the default behavior in the acpi-video driver for this is to send a KEY_SWITCHVIDEOMODE evdev event, which causes e.g. gnome-settings-daemon to ask us to rescan the connectors (good), but also causes g-s-d to switch to mirror mode on a newly plugged monitor rather then using the monitor to extend the desktop (bad) as KEY_SWITCHVIDEOMODE is supposed to switch between extend the desktop vs mirror mode. More troublesome are the repeated ACPI_VIDEO_NOTIFY_PROBE events on changing the mode on the connector, which cause g-s-d to switch between mirror/extend mode, which causes a new ACPI_VIDEO_NOTIFY_PROBE event and we end up with an endless loop. This commit fixes this by adding an acpi notifier block handler to nouveau_display.c to intercept ACPI_VIDEO_NOTIFY_PROBE and: 1) Wake-up runtime suspended GPUs and call drm_helper_hpd_irq_event() on them, this is necessary in some cases for the GPU to detect connector hotplug events while runtime suspended 2) Return NOTIFY_BAD to stop acpi-video from emitting a bogus KEY_SWITCHVIDEOMODE key-press event There already is another acpi notifier block handler registered in drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.c, but that is not suitable since that one gets unregistered on runtime suspend, and we also want to intercept ACPI_VIDEO_NOTIFY_PROBE when runtime suspended. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* drm/nouveau/kms/nv50: separate out mode commitBen Skeggs2016-11-071-0/+4
| | | | | | | | | This commit separates the calculation of EVO state from the commit, in order to make the same code useful for atomic modesetting. The legacy interfaces have been wrapped on top of them. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/drm/nouveau: add a LED driver for the NVIDIA logoMartin Peres2016-10-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | We received a donation of a Titan which has this useless feature allowing users to control the brightness of the LED behind the logo of NVIDIA. In the true spirit of open source, let's expose that to the users of very expensive cards! This patch hooks up this LED/PWM to the LED subsystem which allows blinking it in sync with cpu/disk/network/whatever activity (heartbeat is quite nice!). Users may also implement some breathing effect or morse code support in the userspace if they feel like it. v2: - surround the use of the LED framework with ifdef CONFIG_LEDS_CLASS v3: - avoid using ifdefs everywhere, follow the recommendations of /doc/Documentation/CodingStyle. Suggested by Emil Velikov. v4 (Ben): - squashed series of fixes from ml Signed-off-by: Martin Peres <martin.peres@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: rename nouveau_drm.h to nouveau_drv.hBen Skeggs2016-05-201-0/+207
| | | | | | | Fixes out-of-tree build issue where uapi/drm/nouveau_drm.h gets picked up instead. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: port remainder of drm code, and rip out compat layerBen Skeggs2012-10-031-551/+0
| | | | | | | | v2: Ben Skeggs <bskeggs@redhat.com> - fill in nouveau_pm.dev to prevent oops - fix ppc issues (build + OF shadow) Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/backlight: remove dependence on nouveau_drv.hBen Skeggs2012-10-031-3/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: move compat ioctl out of nouveau_drv.hBen Skeggs2012-10-031-3/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/acpi: move definitions out of nouveau_drv.hBen Skeggs2012-10-031-18/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/mxm: split up into bios code and a subdev moduleBen Skeggs2012-10-031-4/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: start culling unused codeBen Skeggs2012-10-031-135/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: port all engines to new engine module formatBen Skeggs2012-10-031-396/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a HUGE commit, but it's not nearly as bad as it looks - any problems can be isolated to a particular chipset and engine combination. It was simply too difficult to port each one at a time, the compat layers are *already* ridiculous. Most of the changes here are simply to the glue, the process for each of the engine modules was to start with a standard skeleton and copy+paste the old code into the appropriate places, fixing up variable names etc as needed. v2: Marcin Slusarz <marcin.slusarz@gmail.com> - fix find/replace bug in license header v3: Ben Skeggs <bskeggs@redhat.com> - bump indirect pushbuf size to 8KiB, 4KiB barely enough for userspace and left no space for kernel's requirements during GEM pushbuf submission. - fix duplicate assignments noticed by clang v4: Marcin Slusarz <marcin.slusarz@gmail.com> - add sparse annotations to nv04_fifo_pause/nv04_fifo_start - use ioread32_native/iowrite32_native for fifo control registers v5: Ben Skeggs <bskeggs@redhat.com> - rebase on v3.6-rc4, modified to keep copy engine fix intact - nv10/fence: unmap fence bo before destroying - fixed fermi regression when using nvidia gr fuc - fixed typo in supported dma_mask checking Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: move some more code around to more appropriate placesBen Skeggs2012-10-031-6/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fence: un-port from nouveau_exec_engine interfacesBen Skeggs2012-10-031-1/+3
| | | | | | | | Still the same code, but not an "engine" anymore. The fence code is more of a policy decision rather than exposing mechanisms, so it's not appropriate to port it to the new engine subsystem. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: pull nouveau_gem definitions into their own headerBen Skeggs2012-10-031-33/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: pull nouveau_bo definitions into their own headerBen Skeggs2012-10-031-86/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv04/disp: kick all private state out to own headerBen Skeggs2012-10-031-109/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/instmem: completely new implementation, as a subdev moduleBen Skeggs2012-10-031-141/+15
| | | | | | | | v2 (Ben Skeggs): - some fixes for 64KiB PAGE_SIZE - fix porting issues in (currently unused) nv41/nv44 pciegart code Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: remove last use of nouveau_gpuobj_new_fake()Ben Skeggs2012-10-031-3/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gpuobj: remove flags for vm-mappingsBen Skeggs2012-10-031-3/+0
| | | | | | | | | | Having GPUOBJ and VM intertwined like this makes it *really* hard to continue porting to the new driver architecture, split it out in favour of requiring explit maps be the caller. It's more flexible and obvious this way anyway... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gpuobj: create wrapper functions for mapping gpuobj into vm/barBen Skeggs2012-10-031-0/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv04-nv40/instmem: remove use of nouveau_gpuobj_new_fake()Ben Skeggs2012-10-031-2/+0
| | | | | | These type of fake objects will not be supported for much longer. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv04-nv40/instmem: duplicate nv04 code as nv40, remove alternate pathsBen Skeggs2012-10-031-0/+12
| | | | | | A ton of duplication for the moment, will go away when they become subdevs. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fb: merge fb/vram and port to subdev interfacesBen Skeggs2012-10-031-129/+17
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/timer: port to subdev interfacesBen Skeggs2012-10-031-18/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/mc: port to subdev interfacesBen Skeggs2012-10-031-18/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: implement devinit subdev, and new init table parserBen Skeggs2012-10-031-13/+10
| | | | | | | v2: - make sure not to execute display scripts unless resuming Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/clock: pull in the implementation from all over the placeBen Skeggs2012-10-031-28/+3
| | | | | | | Still missing the main bits we use to change performance levels, I'll get to it after all the hard yakka has been finished. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gpio: port gpio to subdev interfacesBen Skeggs2012-10-031-27/+0
| | | | | | | v2: Ben Skeggs <bskeggs@redhat.com> - rebase on top of v3.6-rc6 with gpio reset patch integrated already Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/oldbios: remove shadowing support, use bios subdev's imageBen Skeggs2012-10-031-1/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: have non-core mmio accesses go through device objectBen Skeggs2012-10-031-32/+6
| | | | | | | Adds an extra layer of indirection to each register access, but it's not too bad, and will also go away as pieces are ported. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: implement module init functions in nouveau_drm.cBen Skeggs2012-10-031-1/+3
| | | | | | | | These currently just call the existing ones in nouveau_drv.c, but will be extended in upcoming commits. This needed to be separated from the current code as there will be some header clashes until things are ported. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/agp: move all agp stuff into its own source fileBen Skeggs2012-10-031-3/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: restructure source tree, split core from drm implementationBen Skeggs2012-10-031-2/+14
| | | | | | | | | | | | | | Future work will be headed in the way of separating the policy supplied by the nouveau drm module from the mechanisms provided by the driver core. There will be a couple of major classes (subdev, engine) of driver modules that have clearly defined tasks, and the further directory structure change is to reflect this. No code changes here whatsoever, aside from fixing up a couple of include file pathnames. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: init vblank requests listMarcin Slusarz2012-07-261-2/+0
| | | | | | | | | | | | Fixes kernel panic when vblank interrupt triggers before first sync to vblank request. (Besides init, remove some relevant leftovers from vblank rework) Reported-by: Ortwin Glück <odi@odi.ch> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: stable@vger.kernel.org [3.5] Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50: extend vblank semaphore to generic dmaobj + offset pairBen Skeggs2012-07-261-1/+0
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: mark most of our ioctls as deprecated, move to compat layerBen Skeggs2012-07-261-14/+0
| | | | | | | These will be replaced in the near future, the code isn't yet stable enough for this merge window however. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: move current gpuobj code out of nouveau_object.cBen Skeggs2012-07-261-1/+1
| | | | | | I want this file for the new interfaces... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* nouveau: add vmap support to nouveau prime supportDave Airlie2012-05-311-0/+3
| | | | | | Tested sharing to udl. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nouveau/ttm: untangle code to support accelerated buffer movesBen Skeggs2012-05-241-1/+5
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: turn all fifo modules into engine modulesBen Skeggs2012-05-241-70/+3
| | | | | | | | | | | | | Been tested on each major revision that's relevant here, but I'm sure there are still bugs waiting to be ironed out. This is a *very* invasive change. There's a couple of pieces left that I don't like much (eg. other engines using fifo_priv for the channel count), but that's an artefact of there being a master channel list still. This is changing, slowly. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fifo: remove all the "special" engine hooksBen Skeggs2012-05-241-20/+1
| | | | | | | | | | | All the places this stuff is actually needed tends to be chipset-specific anyway, so we're able to just inline the register bashing instead. The parts of the common code that still directly touch PFIFO temporarily have conditionals, these will be removed in subsequent commits that will refactor the fifo modules into engine modules like graph/mpeg etc. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fence: convert to exec engine, and improve channel syncBen Skeggs2012-05-241-18/+2
| | | | | | | | Now have a somewhat simpler semaphore sync implementation for nv17:nv84, and a switched to using semaphores as fences on nv84+ and making use of the hardware's >= acquire operation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fence: minor api changes for an upcoming reworkBen Skeggs2012-05-241-20/+6
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/fence: make ttm interfaces wrap ours, not the other way aroundBen Skeggs2012-05-241-27/+4
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
OpenPOWER on IntegriCloud