aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
Commit message (Collapse)AuthorAge
* drm/nouveau/pm: introduce generic handler for on-chip fan controllerBen Skeggs2011-12-21
| | | | | | | | | | The handling of the internal pwm fan controller is similar enough between current chipsets that it makes sense to share the logic, and bugfixes :) No hw backends converted yet, will automatically fall-through to the "old" per-chipset fanspeed hooks for now. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/gpio: remove invert flag, use state[] everywhereBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv50/pm: mostly nailed down fan pwm frequency selectionBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: manual pwm fanspeed management for nv40+ boardsMartin Peres2011-12-21
| | | | | | | | | | | | | | | | | | | | | Exposes the following sysfs entries: - fan0_input: read the rotational speed of the fan (poll a bit during 250ms) - pwm0: set the pwm duty cycle - pwm0_min/max: set the minimum/maximum pwm value v2 (Ben Skeggs): - nv50 pwm controller code removed in favour of other more complete code - FAN_RPM -> FAN_SENSE - merged FAN_SENSE readout into common code, not at all nv50-specific - protected fanspeed changes with perflvl_wr - formatting tidying - added some comments where things are shaky v3 (Martin Peres) - ensure duty min/max from thermal table are sane Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
* drm/nv50/pm: add support for pwm fan controlBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/vdec: implement stub modules for the known enginesBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nouveau/pm: hook up fanspeed get/set if they're presentBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv41/pm: implement a second type of fanspeed pwmBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv40/pm: implement first type of pwm fanspeed funcsBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* drm/nv40/pm: parse fan pwm divisor from vbios tablesBen Skeggs2011-12-21
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Merge tag 'v3.2-rc6' of /home/airlied/devel/kernel/linux-2.6 into drm-core-nextDave Airlie2011-12-20
|\ | | | | | | | | | | | | | | Merge in the upstream tree to bring in the mainline fixes. Conflicts: drivers/gpu/drm/exynos/exynos_drm_fbdev.c drivers/gpu/drm/nouveau/nouveau_sgdma.c
| * drm/nv50/disp: silence compiler warningBen Skeggs2011-11-30
| | | | | | | | | | | | | | NFI why this only started appearing now. The use of the uninitialised var can't actually happen, so perhaps my compiler just got stupider. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: fix oopses caused by clear being called on unpopulated ttmsBen Skeggs2011-11-30
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: Keep RAMIN heap within the channel.Younes Manton2011-11-30
| | | | | | | | | | | | | | | | | | | | The entire RAMIN is allocated to be 'size', but the heap is specified as 'base' + 'size' inside RAMIN, so it will overflow past RAMIN by 'base' bytes on NV50+ and clobber other allocatons unless it's size is adjusted. Signed-off-by: Younes Manton <younes.m@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvd0/disp: fix sor dpms typo, preventing dpms on in some situationsBen Skeggs2011-11-30
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/gr: fix TP init for transform feedback offset queriesChristoph Bumiller2011-11-30
| | | | | | | | | | | | | | | | | | Without this, they return bytes written since the last update of the offset, but we want the full offset. Trace shows setting this on GPC[0]/TP[0] is enough. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: add dumb ioctl supportBen Skeggs2011-11-30
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: Fix bandwidth calculation for DisplayPortAdam Jackson2011-11-09
| | | | | | | | | | | | | | | | | | Ported from the equivalent fix in drm-intel-next: http://cgit.freedesktop.org/~keithp/linux/commit/?h=drm-intel-next&id=cd9dde44f47501394b9f0715b6a36a92aa74c0d0 Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: by default use low bpp framebuffer on low memory cardsMarcin Slusarz2011-11-09
| | | | | | | | | | | | | | | | | | Framebuffer's BPP is not that important but can waste significant part of memory on low-VRAM cards. Lower it to 8bpp on < 32MB cards and to 16bpp on 64MB cards. It can still be overridden by video= option. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv10: Change the BO size threshold determining the memory placement range.Francisco Jerez2011-11-09
| | | | | | | | | | | | | | | | | | | | | | Fixes the framebuffer memory allocation failure seen on some low-memory cards, followed by X refusing to start. https://bugs.freedesktop.org/show_bug.cgi?id=42384 Reported-by: Chris Paulson-Ellis <chris@edesix.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0: enable acceleration for nvc1 by defaultBen Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/gr: fixup the mmio list register writes for 0xc1Ben Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc1: hacky workaround to fix accel issuesBen Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/gr: fix some bugs in grctx generationBen Skeggs2011-11-09
| | | | | | | | | | | | | | | | | | Most serious is for chips with only 1 TPC, we'd get stuck in an infinite loop. The fix here will slightly change the setup for all other chipsets too, but, it shouldn't matter too much, and this all needs figuring out and likely redone anyway. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0: enable acceleration on 0xc8 by defaultBen Skeggs2011-11-09
| | | | | | | | | | | | | | Worked well enough for glxgears and gnome-shell at least, no reason to have this off anymore. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/vram: skip disabled PBFB subunitsBen Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv40/pm: fix issues on igp chipsets, which don't have memoryBen Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: testing the wrong variableDan Carpenter2011-11-09
| | | | | | | | | | | | | | | | memtimings is a valid pointer here, the intent was to test for kcalloc() failure. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/vram: storage type 0xc3 is not compressedChristoph Bumiller2011-11-09
| | | | | | | | | | Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv50: fix stability issue on NV86.Maxim Levitsky2011-11-09
| | | | | | | | | | | | | | Confirmed to fix random hangs while running all Unegine demos on NV86. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: initialize chan->fence.lock before useMarcin Slusarz2011-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fence lock needs to be initialized before any call to nouveau_channel_put because it calls nouveau_channel_idle->nouveau_fence_update which uses fence lock. BUG: spinlock bad magic on CPU#0, test/24134 lock: ffff88019f90dba8, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 Pid: 24134, comm: test Not tainted 3.0.0-nv+ #800 Call Trace: spin_bug+0x9c/0xa3 do_raw_spin_lock+0x29/0x13c _raw_spin_lock+0x1e/0x22 nouveau_fence_update+0x2d/0xf1 nouveau_channel_idle+0x22/0xa0 nouveau_channel_put_unlocked+0x84/0x1bd nouveau_channel_put+0x20/0x24 nouveau_channel_alloc+0x4ec/0x585 nouveau_ioctl_fifo_alloc+0x50/0x130 drm_ioctl+0x289/0x361 do_vfs_ioctl+0x4dd/0x52c sys_ioctl+0x42/0x65 system_call_fastpath+0x16/0x1b It's easily triggerable from userspace. Additionally remove double initialization of chan->fence.pending. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: stable@kernel.org Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv50/vram: fix incorrect detection of bank count on newer chipsetsBen Skeggs2011-11-09
| | | | | | | | | | | | NVA3+ has an extra bit here compared to NV50:NVA3 chipsets. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv50/gr: typo fix, how about we not reset fifo during graph init?Ben Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nv50/bios: fixup mpll programming from the init table parserBen Skeggs2011-11-09
| | | | | | | | | | | | | | Reportedly this has been causing stability and corruption issues after resuming from suspend for a few people. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nouveau: fix oops if i2c bus not found in nouveau_i2c_identify()Ben Skeggs2011-11-09
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* | drm: Replace pitch with pitches[] in drm_framebufferVille Syrjälä2011-12-20
| | | | | | | | | | | | | | | | | | | | Otherwise each driver would need to keep the information inside their own framebuffer object structure. Also add offsets[]. BOs on the other hand are driver specific, so those can be kept in driver specific structures. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/ttm: callback move_notify any time bo placement change v4Jerome Glisse2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were calling back move_notify in error path when the bo is returned to it's original position or when destroy the bo. When destroying the bo set the new mem placement as NULL when calling back in the driver. Updating nouveau to deal with NULL placement properly. v2: reserve the object before calling move_notify in bo destroy path at that point ttm should be the only piece of code interacting with the object so atomic_set is safe here. v3: callback move notify only once the bo is in its new position call move notify want swaping out the buffer v4:- don't call move_notify when swapin out bo, assume driver should do what is appropriate in swap notify - move move_notify call back to ttm_bo_cleanup_memtype_use for destroy path Reviewed-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm/ttm: simplify memory accounting for ttm user v2Jerome Glisse2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | Provide helper function to compute the kernel memory size needed for each buffer object. Move all the accounting inside ttm, simplifying driver and avoiding code duplication accross them. v2 fix accounting of ghost object, one would have thought that i would have run into the issue since a longtime but it seems ghost object are rare when you have plenty of vram ;) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm/ttm: isolate dma data from ttm_tt V4Jerome Glisse2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. V2 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) V3 Make sure page list is initialized empty V4 typo/syntax fixes Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm/nouveau: enable the ttm dma pool when swiotlb is active V3Konrad Rzeszutek Wilk2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask V3 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) CC: Ben Skeggs <bskeggs@redhat.com> CC: Francisco Jerez <currojerez@riseup.net> CC: Dave Airlie <airlied@redhat.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* | drm/ttm: introduce callback for ttm_tt populate & unpopulate V4Jerome Glisse2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory accounting overhaul V3 New rebase on top of more memory accouting changes V4 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm/ttm: merge ttm_backend and ttm_tt V5Jerome Glisse2011-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ttm_backend will only exist with a ttm_tt, and ttm_tt will only be of interest when bound to a backend. Merge them to avoid code and data duplication. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting changes V4 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) V5 make sure ttm is unbound before destroying, change commit message on suggestion from Tormod Volden Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
* | drm: add an fb creation ioctl that takes a pixel format v5Jesse Barnes2011-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To properly support the various plane formats supported by different hardware, the kernel must know the pixel format of a framebuffer object. So add a new ioctl taking a format argument corresponding to a fourcc name from the new drm_fourcc.h header file. Implement the fb creation hooks in terms of the new mode_fb_cmd2 using helpers where the old bpp/depth values are needed. v2: create DRM specific fourcc header file for sharing with libdrm etc v3: fix rebase failure and use DRM fourcc codes in intel_display.c and update commit message v4: make fb_cmd2 handle field into an array for multi-object formats pull in Ville's fix for the memcpy in drm_plane_init apply Ville's cleanup to zero out fb_cmd2 arg in drm_mode_addfb v5: add 'flags' field for interlaced support (from Ville) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Reviewed-by: Rob Clark <rob.clark@linaro.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm: Make the per-driver file_operations struct constArjan van de Ven2011-11-11
|/ | | | | | | | | | | | | | | | | | | | From fdf1fdebaa00f81de18c227f32f8074c8b352d50 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven <arjan@linux.intel.com> Date: Sun, 30 Oct 2011 19:06:07 -0700 Subject: [PATCH] drm: Make the per-driver file_operations struct const The DRM layer keeps a copy of struct file_operations inside its big driver struct... which prevents it from being consistent and static. For consistency (and the general security objective of having such things static), it's desirable to get this fixed. This patch splits out the file_operations field to its own struct, which is then "static const", and just stick a pointer to this into the driver struct, making it more consistent with how the rest of the kernel does this. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* gpu: add module.h to drivers/gpu files as required.Paul Gortmaker2011-10-31
| | | | | | | So that we don't get build failures once the implicit module.h presence is removed. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* Revert "drm/ttm: add a way to bo_wait for either the last read or last write"Dave Airlie2011-10-27
| | | | | | | | | This reverts commit dfadbbdb57b3f2bb33e14f129a43047c6f0caefa. Further upstream discussion between Marek and Thomas decided this wasn't fully baked and needed further work, so revert it before it hits mainline. Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge branch 'drm-nouveau-next' of ↵Dave Airlie2011-09-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-next * 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6: (353 commits) drm/nouveau: remove allocations from gart populate() hook drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c drm/nvc0/fifo: avoid touching missing subfifos drm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc drm/nvd9/disp: stub some more api hooks so we don't oops on resume drm/nouveau: fix printk typo in ioremap failure path drm/nvc0/pm: minor clock readback fixes drm/nv40/pm: execute memory reset script from vbios drm/nv50/gr: refactor initialisation drm/nouveau: if requested, try harder at disabling sysmem pushbufs drm/nv50/gr: enable ctxprog xfer only when we need it to save power drm/nouveau/dp: add support for displayport table 0x30 drm/nouveau/dp: return master dp table pointer too when looking up encoder drm/nouveau/bios: simplify U/d table hash matching func to just match drm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET drm/nvc0/gr: remove MODULE_FIRMWARE() lines drm/nouveau/dp: use alternate lane mask for nvaf drm/nouveau/dp: link rate scripts are selected with a comparison table drm/nv40/pm: write nv40-specific reclocking routines drm/nv40/pm: parse geometric delta clock from vbios ...
| * drm/nouveau: remove allocations from gart populate() hookBen Skeggs2011-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since some somewhat questionable changes a while back, TTM provides a completely empty array of struct dma_address that stays around for the entire lifetime of the TTM object. Lets use this array, *always*, rather than wasting yet more memory on another array who's purpose is identical, as well as yet another bool array of the same size saying *which* of the previous two arrays to use... This change will also solve the high order allocation failures seen by some people while using nouveau. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.cBen Skeggs2011-09-20
| | | | | | | | | | | | | | I'm still not certain how to determine the number of SUBPs are present on a given board. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| * drm/nvc0/fifo: avoid touching missing subfifosBen Skeggs2011-09-20
| | | | | | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>