summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_backlight.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/nouveau: allocate device object for every clientBen Skeggs2017-02-171-12/+12
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bl: Do not register interface if Apple GMUX detectedPierre Moreau2016-12-131-0/+6
| | | | | | | | | | | | | | The Apple GMUX is the one managing the backlight, so there is no need for Nouveau to register its own backlight interface. v2: Do not split information message on two lines as it prevents from grepping it, as pointed out by Lukas Wunner v3: Add a missing end-of-line character to the printed message Signed-off-by: Pierre Moreau <pierre.morrow@free.fr> Reviewed-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/bl: Assign different names to interfacesPierre Moreau2016-12-131-4/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/kms: add Maxwell to backlight initializationFaris Alsalama2016-10-121-0/+1
| | | | | | Signed-off-by: Faris Alsalama <farisbenbrahem@gmail.com> Acked-by: Acked-by: Pierre Moreau <pierre.morrow@free.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: rename nouveau_drm.h to nouveau_drv.hBen Skeggs2016-05-201-1/+1
| | | | | | | 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/nvif: simplify and tidy library interfacesBen Skeggs2015-08-281-11/+11
| | | | | | | | | | | | | | | | | | A variety of tweaks to the NVIF library interfaces, mostly ripping out things that turned out to be not so useful. - Removed refcounting from nvif_object, callers are expected to not be stupid instead. - nvif_client is directly reachable from anything derived from nvif_object, removing the need for heuristics to locate it - _new() versions of interfaces, that allocate memory for the object they construct, have been removed. The vast majority of callers used the embedded _init() interfaces. - No longer storing constructor arguments (and the data returned from nvkm) inside nvif_object, it's more or less unused and just wastes memory. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: initial pass at moving to struct nvif_deviceBen Skeggs2014-08-101-17/+17
| | | | | | | 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-24/+24
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/core: remove NV_D0 familyBen Skeggs2014-08-101-1/+0
| | | | | | | 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>
* nouveau: Don't check acpi_video_backlight_support() before registering backlightHans de Goede2014-05-271-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_video_backlight_support() is supposed to be called by other (vendor specific) firmware backlight controls, not by native / raw backlight controls like nv_backlight. Userspace will normally prefer firmware interfaces over raw interfaces, so if acpi_video backlight support is present it will use that even if nv_backlight is registered as well. Except when video.use_native_backlight is present on the kernel cmdline (or enabled through a dmi based quirk). As the name indicates the goal here is to make only the raw interface available to userspace so that it will use that (it only does this when it sees a win8 compliant bios). This is done by: 1) Not registering any acpi_video# backlight devices; and 2) Making acpi_video_backlight_support() return true so that other firmware drivers, ie acer_wmi, thinkpad_acpi, dell_laptop, etc. Don't register their own vender specific interfaces. Currently nouveau breaks this setup, as when acpi_video_backlight_support() returns true, it does not register itself, resulting in no backlight control at all. This is esp. going to be a problem with 3.16 which will default to video.use_native_backlight=1, and thus nouveau based laptops with a win8 bios will get no backlight control at all. This also likely explains why the previous attempt to make video.use_native_backlight=1 the default was not a success, as without this patch having a default of video.use_native_backlight=1 will cause regressions. Note this effectively reverts commit 5bead799d3f8 (drm/nouveau: don't expose backlight control when available through ACPI). References: https://bugzilla.redhat.com/show_bug.cgi?id=1093171 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* drm/sysfs: sort out minor and connector device object lifetimes.Dave Airlie2013-10-221-2/+2
| | | | | | | | | | | | | | | | | So drm was abusing device lifetimes, by having embedded device structures in the minor and connector it meant that the lifetime of the internal drm objects (drm_minor and drm_connector) were tied to the lifetime of the device files in sysfs, so if something kept those files opened the current code would kfree the objects and things would go downhill from there. Now in reality there is no need for these lifetimes to be so intertwined, especailly with hotplugging of devices where we wish to remove the sysfs and userspace facing pieces before we can unwind the internal objects due to open userspace files or mmaps, so split the objects out so the struct device is no longer embedded and do what fbdev does and just allocate and remove the sysfs inodes separately. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/nouveau/drm: adding support for backlight control of GT525M (NVC0)Florian Scholz2013-04-261-0/+3
| | | | | | | | | This patch adds support for the backlight control of the NVIDIA GT 525M, which identifies itself as a member of the NVC0 family. v2. Extended to handle Kepler too Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: handle backlight_device_register failureMarcin Slusarz2013-02-201-0/+2
| | | | | | | Found by smatch. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: port remainder of drm code, and rip out compat layerBen Skeggs2012-10-031-8/+8
| | | | | | | | 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-44/+46
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: implement devinit subdev, and new init table parserBen Skeggs2012-10-031-2/+2
| | | | | | | v2: - make sure not to execute display scripts unless resuming Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau: implement module init functions in nouveau_drm.cBen Skeggs2012-10-031-1/+1
| | | | | | | | 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/nva3/backlight: add suppport for newer style backlight regsBen Skeggs2011-09-201-9/+58
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/backlight: express brightness level in percentBen Skeggs2011-09-201-3/+7
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/backlight: take the sor into account when bashing regsBen Skeggs2011-09-201-18/+40
| | | | | | | I'm sure that out there somewhere, someone will need this. We currently haven't seen an example of LVDS being on a non-0 SOR so far though. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/backlight: make more consistent with rest of driver styleBen Skeggs2011-09-201-31/+39
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* nouveau: change the backlight parent device to the connector, not the PCI devMatthew Garrett2011-03-221-10/+14
| | | | | | | | | | | | | | | | | | | We may eventually end up with per-connector backlights, especially with ddcci devices. Make sure that the parent node for the backlight device is the connector rather than the PCI device. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexdeucher@gmail.com> Acked-by: Ben Skeggs <bskeggs@redhat.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* backlight: add backlight typeMatthew Garrett2011-03-221-0/+2
| | | | | | | | | | | | | | | | | | | There may be multiple ways of controlling the backlight on a given machine. Allow drivers to expose the type of interface they are providing, making it possible for userspace to make appropriate policy decisions. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'master' into for-nextJiri Kosina2010-12-221-0/+9
|\ | | | | | | | | | | | | | | | | | | Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
| * drm/nouveau: don't expose backlight control when available through ACPIBen Skeggs2010-11-181-0/+9
| | | | | | | | | | | | | | | | Avoid confusing userspace by not publishing backlight controls if ACPI equivalents are available. Reported-by: Aaron Sowry <aaron@aeneby.se> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | backlight: constify backlight_opsLionel Debroux2010-11-161-2/+2
|/ | | | | | | | | | | | backlight_device_register has been expecting a const "ops" argument, and using it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the remaining backlight_ops instances const. Inspired by hunks of the grsecurity patch, updated for newer kernels. Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* backlight: Allow properties to be passed at registrationMatthew Garrett2010-03-161-4/+8
| | | | | | | | | | Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* drm/nouveau: Add DRM driver for NVIDIA GPUsBen Skeggs2009-12-111-0/+155
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>
OpenPOWER on IntegriCloud