diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-21 23:32:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-21 23:32:09 -0400 |
commit | 1cfea546b10c8fec218973c3f3c39ff797a3e50c (patch) | |
tree | d2aa389291efa4d5552baa2502706a8a95c30ca6 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 27db64f65f1be2f2ee741a1bf20d8d13d62c167f (diff) | |
parent | f3294568bbb19cbfc53451de192df6daae80f9b3 (diff) |
Merge tag 'drm-fixes-2018-06-22' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie:
"Just run of the mill fixes,
core:
- regression fix in device unplug
qxl:
- regression fix for might sleep in cursor handling
nouveau:
- regression fix in multi-screen cursor handling
amdgpu:
- switch off DC by default on Kaveri and older
- some minor fixes
i915:
- some GEM regression fixes
- doublescan mode fixes
sun4i:
- revert fix for a regression
sii8620 bridge:
- misc fixes"
* tag 'drm-fixes-2018-06-22' of git://anongit.freedesktop.org/drm/drm: (28 commits)
drm/bridge/sii8620: fix display of packed pixel modes in MHL2
drm/amdgpu: Make amdgpu_vram_mgr_bo_invisible_size always accurate
drm/amdgpu: Refactor amdgpu_vram_mgr_bo_invisible_size helper
drm/amdgpu: Update pin_size values before unpinning BO
drm/amdgpu:All UVD instances share one idle_work handle
drm/amdgpu: Don't default to DC support for Kaveri and older
drm/amdgpu: Use kvmalloc_array for allocating VRAM manager nodes array
drm/amd/pp: Fix uninitialized variable
drm/i915: Enable provoking vertex fix on Gen9 systems.
drm/i915: Fix context ban and hang accounting for client
drm/i915: Turn off g4x DP port in .post_disable()
drm/i915: Disallow interlaced modes on g4x DP outputs
drm/i915: Fix PIPESTAT irq ack on i965/g4x
drm/i915: Allow DBLSCAN user modes with eDP/LVDS/DSI
drm/i915/execlists: Avoid putting the error pointer
drm/i915: Apply batch location restrictions before pinning
drm/nouveau/kms/nv50-: cursors always use core channel vram ctxdma
Revert "drm/sun4i: Handle DRM_BUS_FLAG_PIXDATA_*EDGE"
drm/atmel-hlcdc: check stride values in the first plane
drm/bridge/sii8620: fix HDMI cable connection to dongle
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 5e4e1bd90383..3526efa8960e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -762,8 +762,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, | |||
762 | domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); | 762 | domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type); |
763 | if (domain == AMDGPU_GEM_DOMAIN_VRAM) { | 763 | if (domain == AMDGPU_GEM_DOMAIN_VRAM) { |
764 | adev->vram_pin_size += amdgpu_bo_size(bo); | 764 | adev->vram_pin_size += amdgpu_bo_size(bo); |
765 | if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) | 765 | adev->invisible_pin_size += amdgpu_vram_mgr_bo_invisible_size(bo); |
766 | adev->invisible_pin_size += amdgpu_bo_size(bo); | ||
767 | } else if (domain == AMDGPU_GEM_DOMAIN_GTT) { | 766 | } else if (domain == AMDGPU_GEM_DOMAIN_GTT) { |
768 | adev->gart_pin_size += amdgpu_bo_size(bo); | 767 | adev->gart_pin_size += amdgpu_bo_size(bo); |
769 | } | 768 | } |
@@ -790,25 +789,22 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo) | |||
790 | bo->pin_count--; | 789 | bo->pin_count--; |
791 | if (bo->pin_count) | 790 | if (bo->pin_count) |
792 | return 0; | 791 | return 0; |
793 | for (i = 0; i < bo->placement.num_placement; i++) { | ||
794 | bo->placements[i].lpfn = 0; | ||
795 | bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; | ||
796 | } | ||
797 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | ||
798 | if (unlikely(r)) { | ||
799 | dev_err(adev->dev, "%p validate failed for unpin\n", bo); | ||
800 | goto error; | ||
801 | } | ||
802 | 792 | ||
803 | if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { | 793 | if (bo->tbo.mem.mem_type == TTM_PL_VRAM) { |
804 | adev->vram_pin_size -= amdgpu_bo_size(bo); | 794 | adev->vram_pin_size -= amdgpu_bo_size(bo); |
805 | if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS) | 795 | adev->invisible_pin_size -= amdgpu_vram_mgr_bo_invisible_size(bo); |
806 | adev->invisible_pin_size -= amdgpu_bo_size(bo); | ||
807 | } else if (bo->tbo.mem.mem_type == TTM_PL_TT) { | 796 | } else if (bo->tbo.mem.mem_type == TTM_PL_TT) { |
808 | adev->gart_pin_size -= amdgpu_bo_size(bo); | 797 | adev->gart_pin_size -= amdgpu_bo_size(bo); |
809 | } | 798 | } |
810 | 799 | ||
811 | error: | 800 | for (i = 0; i < bo->placement.num_placement; i++) { |
801 | bo->placements[i].lpfn = 0; | ||
802 | bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; | ||
803 | } | ||
804 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | ||
805 | if (unlikely(r)) | ||
806 | dev_err(adev->dev, "%p validate failed for unpin\n", bo); | ||
807 | |||
812 | return r; | 808 | return r; |
813 | } | 809 | } |
814 | 810 | ||