summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2013-09-23Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds22-193/+273
Pull drm fixes from Dave Airlie: - some small fixes for msm and exynos - a regression revert affecting nouveau users with old userspace - intel pageflip deadlock and gpu hang fixes, hsw modesetting hangs * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits) Revert "drm: mark context support as a legacy subsystem" drm/i915: Don't enable the cursor on a disable pipe drm/i915: do not update cursor in crtc mode set drm/exynos: fix return value check in lowlevel_buffer_allocate() drm/exynos: Fix address space warnings in exynos_drm_fbdev.c drm/exynos: Fix address space warning in exynos_drm_buf.c drm/exynos: Remove redundant OF dependency drm/msm: drop unnecessary set_need_resched() drm/i915: kill set_need_resched drm/msm: fix potential NULL pointer dereference drm/i915/dvo: set crtc timings again for panel fixed modes drm/i915/sdvo: Robustify the dtd<->drm_mode conversions drm/msm: workaround for missing irq drm/msm: return -EBUSY if bo still active drm/msm: fix return value check in ERR_PTR() drm/msm: fix cmdstream size check drm/msm: hangcheck harder drm/msm: handle read vs write fences drm/i915/sdvo: Fully translate sync flags in the dtd->mode conversion drm/i915: Use proper print format for debug prints ...
2013-09-20Merge branch 'msm-fixes-3.12' of ↵Dave Airlie7-45/+107
git://people.freedesktop.org/~robclark/linux into drm-fixes A couple small msm fixes. Plus drop of set_need_resched(). * 'msm-fixes-3.12' of git://people.freedesktop.org/~robclark/linux: drm/msm: drop unnecessary set_need_resched() drm/msm: fix potential NULL pointer dereference drm/msm: workaround for missing irq drm/msm: return -EBUSY if bo still active drm/msm: fix return value check in ERR_PTR() drm/msm: fix cmdstream size check drm/msm: hangcheck harder drm/msm: handle read vs write fences
2013-09-20Merge branch 'exynos-drm-fixes' of ↵Dave Airlie3-6/+8
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes Just small fixes, and code cleanups. * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: drm/exynos: fix return value check in lowlevel_buffer_allocate() drm/exynos: Fix address space warnings in exynos_drm_fbdev.c drm/exynos: Fix address space warning in exynos_drm_buf.c drm/exynos: Remove redundant OF dependency
2013-09-20Merge tag 'drm-intel-fixes-2013-09-19' of ↵Dave Airlie9-74/+122
git://people.freedesktop.org/~danvet/drm-intel into drm-fixes Some more dealock fixes around pageflips and gpu hangs, fixes for hsw hangs when doing modesets/dpms. And a few minor things to rectify issues with our modeset state tracking which the checker spotted. * tag 'drm-intel-fixes-2013-09-19' of git://people.freedesktop.org/~danvet/drm-intel: drm/i915: Don't enable the cursor on a disable pipe drm/i915: do not update cursor in crtc mode set drm/i915: kill set_need_resched drm/i915/dvo: set crtc timings again for panel fixed modes drm/i915/sdvo: Robustify the dtd<->drm_mode conversions drm/i915/sdvo: Fully translate sync flags in the dtd->mode conversion drm/i915: Use proper print format for debug prints drm/i915: fix wait_for_pending_flips vs gpu hang deadlock drm/i915: Track pfit enable state separately from size
2013-09-20Revert "drm: mark context support as a legacy subsystem"Dave Airlie3-68/+36
This reverts commit 7c510133d93dd6f15ca040733ba7b2891ed61fd1. Well looks like not enough digging was done, libdrm_nouveau before 2.4.33 used contexts, 292da616fe1f936ca78a3fa8e1b1b19883e343b6 nouveau: pull in major libdrm rewrite got rid of them, Reported-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com> Reported-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-19Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds54-259/+832
Pull drm radeon/nouveau/core fixes from Dave Airlie: "Mostly radeon fixes, with some nouveau bios parser, ttm fix and a fix for AST driver" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (42 commits) drm/fb-helper: don't sleep for screen unblank when an oops is in progress drm, ttm Fix uninitialized warning drm/ttm: fix the tt_populated check in ttm_tt_destroy() drm/nouveau/ttm: prevent double-free in nouveau_sgdma_create_ttm() failure path drm/nouveau/bios/init: fix thinko in INIT_CONFIGURE_MEM drm/nouveau/kms: enable for non-vga pci classes drm/nouveau/bios/init: stub opcode 0xaa drm/radeon: avoid UVD corruptions on AGP cards drm/radeon: fix panel scaling with eDP and LVDS bridges drm/radeon/dpm: rework auto performance level enable drm/radeon: Fix hmdi typo drm/radeon/dpm/rs780: fix force_performance state for same sclks drm/radeon/dpm/rs780: don't enable sclk scaling if not required drm/radeon/dpm/rs780: add some sanity checking to sclk scaling drm/radeon/dpm/rs780: use drm_mode_vrefresh() drm/udl: rip out set_need_resched drm/ast: fix the ast open key function drm/radeon/dpm: add bapm callback for kb/kv drm/radeon/dpm: add bapm callback for trinity drm/radeon/dpm: add infrastructure to properly handle bapm ...
2013-09-19drm/fb-helper: don't sleep for screen unblank when an oops is in progressDaniel Vetter1-0/+8
Otherwise the system will burn even brighter and worse, leave the user wondering what's going on exactly. Since we already have a panic handler which will (try) to restore the entire fbdev console mode, we can just bail out. Inspired by a patch from Konstantin Khlebnikov. The callchain leading to this, cut&pasted from Konstantin's original patch: callstack: panic() bust_spinlocks(1) unblank_screen() vc->vc_sw->con_blank() fbcon_blank() fb_blank() info->fbops->fb_blank() drm_fb_helper_blank() drm_fb_helper_dpms() drm_modeset_lock_all() mutex_lock(&dev->mode_config.mutex) Note that the entire locking in the fb helper around panic/sysrq and kdbg is ... non-existant. So we have a decent change of blowing up everything. But since reworking this ties in with funny concepts like the fbdev notifier chain or the impressive things which happen around console_lock while oopsing, I'll leave that as an exercise for braver souls than me. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Dave Airlie <airlied@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-19drm, ttm Fix uninitialized warningPrarit Bhargava1-1/+1
Fix uninitialized warning. drivers/gpu/drm/ttm/ttm_object.c: In function ‘ttm_base_object_lookup’: drivers/gpu/drm/ttm/ttm_object.c:213:10: error: ‘base’ may be used uninitialized in this function [-Werror=maybe-uninitialized] kref_put(&base->refcount, ttm_release_base); ^ drivers/gpu/drm/ttm/ttm_object.c:221:26: note: ‘base’ was declared here struct ttm_base_object *base; Signed-off-by: Prarit Bhargava <prarit@redhat.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-19drm/ttm: fix the tt_populated check in ttm_tt_destroy()Ben Skeggs1-1/+1
After a vmalloc failure in ttm_dma_tt_alloc_page_directory(), ttm_dma_tt_init() will call ttm_tt_destroy() to cleanup, and end up inside the driver's unpopulate() hook when populate() has never yet been called. On nouveau, the first issue to be hit because of this is that dma_address[] may be a NULL pointer. After working around this, ttm_pool_unpopulate() may potentially hit the same issue with the pages[] array. It seems to make more sense to avoid calling unpopulate on already unpopulated TTMs than to add checks to all the implementations. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Cc: stable@vger.kernel.org Cc: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-19Merge branch 'drm-nouveau-next' of ↵Dave Airlie4-27/+36
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes A couple of bios parser fixes (one for ancient chips, another for new ones - important in Optimus configs). Another to make sure KMS is enabled on certain Optimus configs, and a TTM failure path fix. * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/ttm: prevent double-free in nouveau_sgdma_create_ttm() failure path drm/nouveau/bios/init: fix thinko in INIT_CONFIGURE_MEM drm/nouveau/kms: enable for non-vga pci classes drm/nouveau/bios/init: stub opcode 0xaa
2013-09-18drm/i915: Don't enable the cursor on a disable pipeVille Syrjälä1-2/+4
On HSW enabling a plane on a disabled pipe may hang the entire system. And there's no good reason for doing it ever, so just don't. v2: Move the crtc active checks to intel_crtc_cursor_{set,move} to avoid confusing people during modeset Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-18drm/i915: do not update cursor in crtc mode setJani Nikula1-9/+0
The cursor is disabled before crtc mode set in crtc disable (and we assert this is the case), and enabled afterwards in crtc enable. Do not update it in crtc mode set. On HSW enabling a plane on a disabled pipe may hang the entire system. And there's no good reason for doing it ever, so just don't. v2: Add note about HSW hangs - vsyrjala Cc: stable@vger.kernel.org Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17drm/nouveau/ttm: prevent double-free in nouveau_sgdma_create_ttm() failure pathBen Skeggs1-3/+1
TTM calls the destructor on its own already... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-17drm/nouveau/bios/init: fix thinko in INIT_CONFIGURE_MEMBen Skeggs1-1/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-17drm/nouveau/kms: enable for non-vga pci classesBen Skeggs2-21/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-17drm/nouveau/bios/init: stub opcode 0xaaBen Skeggs1-2/+17
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-16drm/exynos: fix return value check in lowlevel_buffer_allocate()Wei Yongjun1-2/+2
In case of error, the function drm_prime_pages_to_sg() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-16drm/exynos: Fix address space warnings in exynos_drm_fbdev.cSachin Kamat1-2/+3
Silences the following warnings: drivers/gpu/drm/exynos/exynos_drm_fbdev.c:102:40: warning: incorrect type in assignment (different address spaces) drivers/gpu/drm/exynos/exynos_drm_fbdev.c:102:40: expected void [noderef] <asn:2>*kvaddr drivers/gpu/drm/exynos/exynos_drm_fbdev.c:102:40: got void * drivers/gpu/drm/exynos/exynos_drm_fbdev.c:107:48: warning: incorrect type in assignment (different address spaces) drivers/gpu/drm/exynos/exynos_drm_fbdev.c:107:48: expected void [noderef] <asn:2>*kvaddr drivers/gpu/drm/exynos/exynos_drm_fbdev.c:107:48: got void * Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-16drm/exynos: Fix address space warning in exynos_drm_buf.cSachin Kamat1-1/+2
Fixes the following warning: drivers/gpu/drm/exynos/exynos_drm_buf.c:66:29: warning: incorrect type in assignment (different address spaces) drivers/gpu/drm/exynos/exynos_drm_buf.c:66:29: expected void [noderef] <asn:2>*kvaddr drivers/gpu/drm/exynos/exynos_drm_buf.c:66:29: got void * Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-16drm/exynos: Remove redundant OF dependencySachin Kamat1-1/+1
Now that DRM_EXYNOS depends on OF, we do not need individual drivers to depend on it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-16drm/msm: drop unnecessary set_need_resched()Rob Clark1-1/+0
This was inherited from i915/udl, and not actually needed. Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-09-16drm/radeon: avoid UVD corruptions on AGP cardsChristian König1-3/+5
Putting everything into VRAM seems to help. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-09-16drm/radeon: fix panel scaling with eDP and LVDS bridgesAlex Deucher1-3/+31
We were using the wrong set_properly callback so we always ended up with Full scaling even if something else (Center or Full aspect) was selected. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-09-16drm/radeon/dpm: rework auto performance level enableAlex Deucher11-47/+9
Calling force_performance_level() from set_power_state() doesn't work on some asics because the current power state pointer has not been properly updated at that point. Move the calls to force_performance_level() out of the asic specific set_power_state() functions and into the main power state sequence. Fixes dpm resume on SI. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-16drm/radeon: Fix hmdi typoDamien Lespiau3-3/+3
I keep making that one, so checked if I was the only one. Apparently not. Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-16drm/radeon/dpm/rs780: fix force_performance state for same sclksAlex Deucher1-2/+4
If the low and high sclks within a power state are the same, there no need to enable sclk scaling. Enabling sclk scaling can cause display stability issues on some boards. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-16drm/radeon/dpm/rs780: don't enable sclk scaling if not requiredAlex Deucher1-0/+3
If the low and high sclks are the same, there is no need to enable sclk scaling. This causes display stability issues on certain boards. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=60857 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-16drm/radeon/dpm/rs780: add some sanity checking to sclk scalingAlex Deucher1-0/+6
Since the clock scaling is based on fb divider adjustments, make sure the other pll parameters are the same. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-16drm/radeon/dpm/rs780: use drm_mode_vrefresh()Alex Deucher1-3/+1
Rather than open coding it. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
2013-09-16drm/udl: rip out set_need_reschedDaniel Vetter1-1/+0
This very much looks like copypasta from drm/i915's fault handler. It was used there to duct-tape over issues around gpu reset handling. Since that can't ever happen for udl and there's seemingly no other reason for this just drop it. Reported-by: Peter Zijlstra <peterz@infradead.org> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-16Merge branch 'drm-fixes-3.12' of git://people.freedesktop.org/~agd5f/linux ↵Dave Airlie36-170/+726
into drm-fixes Radeon drm fixes for 3.12. All over the place (display, dpm, uvd, etc.). Also adds a couple more berlin pci ids. * 'drm-fixes-3.12' of git://people.freedesktop.org/~agd5f/linux: (25 commits) drm/radeon/dpm: add bapm callback for kb/kv drm/radeon/dpm: add bapm callback for trinity drm/radeon/dpm: add infrastructure to properly handle bapm drm/radeon/dpm: handle bapm on kb/kv drm/radeon/dpm: handle bapm on trinity drm/radeon: expose DPM thermal thresholds through sysfs drm/radeon: simplify driver data retrieval drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2) drm/radeon/dpm: fix fallback for empty UVD clocks drm/radeon: add command submission tracepoint drm/radeon: remove stale radeon_fence_retire tracepoint drm/radeon/r6xx: add a stubbed out set_uvd_clocks callback drm/radeon: fix typo in PG flags drm/radeon: add some additional berlin pci ids drm/radeon/cik: update gpu_init for an additional berlin gpu drm/radeon: add spinlocks for indirect register accesss drm/radeon: protect concurrent smc register access with a spinlock drm/radeon: dpm updates for KV drm/radeon: signedness bug in kv_dpm.c drm/radeon: clean up r600_free_extended_power_table() ...
2013-09-13Merge branch 'for-linus' of ↵Linus Torvalds4-62/+119
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile 4 from Al Viro: "list_lru pile, mostly" This came out of Andrew's pile, Al ended up doing the merge work so that Andrew didn't have to. Additionally, a few fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (42 commits) super: fix for destroy lrus list_lru: dynamically adjust node arrays shrinker: Kill old ->shrink API. shrinker: convert remaining shrinkers to count/scan API staging/lustre/libcfs: cleanup linux-mem.h staging/lustre/ptlrpc: convert to new shrinker API staging/lustre/obdclass: convert lu_object shrinker to count/scan API staging/lustre/ldlm: convert to shrinkers to count/scan API hugepage: convert huge zero page shrinker to new shrinker API i915: bail out earlier when shrinker cannot acquire mutex drivers: convert shrinkers to new count/scan API fs: convert fs shrinkers to new scan/count API xfs: fix dquot isolation hang xfs-convert-dquot-cache-lru-to-list_lru-fix xfs: convert dquot cache lru to list_lru xfs: rework buffer dispose list tracking xfs-convert-buftarg-lru-to-generic-code-fix xfs: convert buftarg LRU to generic code fs: convert inode and dentry shrinking to be node aware vmscan: per-node deferred work ...
2013-09-13drm/i915: kill set_need_reschedDaniel Vetter1-7/+4
This is just a remnant from the old days when our reset handling was horribly racy, suffered from terribly locking issues and often happily live-locked. Those days are now gone so we can drop the hacks and just rip the reschedule-point out. Reported-by: Peter Zijlstra <peterz@infradead.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-12drm/msm: fix potential NULL pointer dereferenceWei Yongjun1-1/+2
The dereference to 'pdata' should be moved below the NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
2013-09-12drm/ast: fix the ast open key functionDave Airlie1-1/+1
When porting from UMS I mistyped this from the wrong place, AST noticed and pointed it out, so we should fix it to be like the X.org driver. Reported-by: Y.C. Chen <yc_chen@aspeedtech.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-12drm/i915/dvo: set crtc timings again for panel fixed modesDaniel Vetter1-0/+2
Yet another regression due to commit 135c81b8c3c9a70d7b55758c9c2a247a4abb7b64 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Sun Jul 21 21:37:09 2013 +0200 drm/i915: clean up crtc timings computation I'm starting to wonder whether this was worth it ... v2: Actually make it compile. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-12drm/i915/sdvo: Robustify the dtd<->drm_mode conversionsDaniel Vetter1-29/+34
We've failed to properly clear out the flags when converting a dtd to a drm mode. For more paranoia just memset the entire structure (and drop the now redundant clears). Also since commit 135c81b8c3c9a70d7b55758c9c2a247a4abb7b64 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Sun Jul 21 21:37:09 2013 +0200 drm/i915: clean up crtc timings computation we don't update the crtc timings any more properly, so do that again. v2: Remove more redundant clearing, spotted by Ville. v3: Actually make it compile. Oops. v4: Use a temporary structure to fill in the mode and copy it over with drm_mode_copy. This will ensure we don't clobber the mode list or id. Suggested by Ville. Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [danvet: Use the = {}; structure clearing instead of memset as suggested by Ville.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-12drm/msm: workaround for missing irqRob Clark1-2/+5
Occasionally we seem to miss an IRQ from the ME (microengine). I'm not entirely sure the root cause, but for now we can unwedge things by retiring from the hangcheck timer. Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-09-12drm/msm: return -EBUSY if bo still activeRob Clark3-18/+44
When we CPU_PREP a bo with NOSYNC flag (for example, to implement PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE), an -EBUSY return indicates to userspace that the bo is still busy. Previously it was incorrectly returning 0 in this case. And while we're in there throw in an bit of extra sanity checking in case userspace tries to wait for a bogus fence. Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-09-12drm/msm: fix return value check in ERR_PTR()Wei Yongjun1-2/+2
In case of error, the function drm_prime_pages_to_sg() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
2013-09-11drm/radeon/dpm: add bapm callback for kb/kvAlex Deucher3-0/+22
This adds the enable_bapm callback for kb/kv. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: add bapm callback for trinityAlex Deucher4-0/+17
This adds the enable_bapm callback for trinity. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: add infrastructure to properly handle bapmAlex Deucher2-1/+12
bapm is a pm feature for sharing the power budget between the GPU and the CPU on APUs. It needs to be enabled or disabled in certain circumstances. For now, disable it when on battery and enable it when on AC power. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: handle bapm on kb/kvAlex Deucher3-0/+17
bapm is a power management feature for handling the power budget between the CPU and GPU on APUs. This patch adds support for enabling or disabling it. For now disable it by default. Enabling it properly requires quite a bit more work and will be addressed in a separate patch. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/dpm: handle bapm on trinityAlex Deucher4-0/+13
bapm is a power management feature for handling the power budget between the CPU and GPU on APUs. This patch adds support for enabling or disabling it. For now disable it by default. Enabling it properly requires quite a bit more work and will be addressed in a separate patch. This patch fixes hangs on boot on certain trinity laptops when the system is on battery power. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-09-11drm/radeon: expose DPM thermal thresholds through sysfsJean Delvare1-0/+38
The hwmon sysfs interface allows exposing temperature limits. The "max" and "min" thresholds will be exposed as a critical high limit and its hysteresis value, respectively. This gives the user a better idea of how well cooling is doing and whether it is sufficient. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon: simplify driver data retrievalJean Delvare1-9/+9
You can get the driver data from struct device directly, there's no need to get the PCI device first. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: David Airlie <airlied@linux.ie> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-09-11drm/radeon/atom: workaround vbios bug in transmitter table on rs880 (v2)Alex Deucher1-2/+6
The OUTPUT_ENABLE action jumps past the point in the coder where the data_offset is set on certain rs780 cards. This worked previously because the OUTPUT_ENABLE action is always called immediately after the ENABLE action so the data_offset remained set. In 6f8bbaf568c7f2c497558bfd04654c0b9841ad57 (drm/radeon/atom: initialize more atom interpretor elements to 0), we explictly reset data_offset to 0 between atom calls which then caused this to fail. The fix is to just skip calling the OUTPUT_ENABLE action on the problematic chipsets. The ENABLE action does the same thing and more. Ultimately, we could probably drop the OUTPUT_ENABLE action all together on DCE3 asics. fixes: https://bugzilla.kernel.org/show_bug.cgi?id=60791 v2: only rs880 seems to be affected Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-09-11drm/radeon/dpm: fix fallback for empty UVD clocksAlex Deucher2-6/+14
Some older 6xx-7xx boards didn't always fill in the UVD clocks properly in the UVD power states. This leads to the driver trying to set a 0 clock which results in slow or broken UVD playback. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69120 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
2013-09-11drm/radeon: add command submission tracepointChristian König2-0/+23
Neither complete nor perfect, but solves my problem at hand and might be useful in the future. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>