diff options
| author | Dave Airlie <airlied@redhat.com> | 2019-04-17 16:56:26 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2019-04-17 16:56:35 -0400 |
| commit | 00fd14ff3017f64a9a03a08291e4be0d87bedc17 (patch) | |
| tree | 6bcf54e0168c22c6ad51f49529b7b31e5947c508 | |
| parent | ce519c1baa6a7e24ec7a9e59c77c18e607e910ed (diff) | |
| parent | c238bfe0be9ef7420f7669a69e27c8c8f4d8a568 (diff) | |
Merge branch 'drm-fixes-5.1' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
- GPUVM fixes for vega/RV and shadow buffers
- TTM fixes for hugepages
- TTM fix for refcount imbalance in error path
- DC AUX fix for some active DP-DVI dongles
- DC fix for multihead VT switch regression
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190415051703.3377-1-alexander.deucher@amd.com
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/dc.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 13 |
8 files changed, 43 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 5d8b30fd4534..79fb302fb954 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -3165,6 +3165,7 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) | |||
| 3165 | 3165 | ||
| 3166 | /* No need to recover an evicted BO */ | 3166 | /* No need to recover an evicted BO */ |
| 3167 | if (shadow->tbo.mem.mem_type != TTM_PL_TT || | 3167 | if (shadow->tbo.mem.mem_type != TTM_PL_TT || |
| 3168 | shadow->tbo.mem.start == AMDGPU_BO_INVALID_OFFSET || | ||
| 3168 | shadow->parent->tbo.mem.mem_type != TTM_PL_VRAM) | 3169 | shadow->parent->tbo.mem.mem_type != TTM_PL_VRAM) |
| 3169 | continue; | 3170 | continue; |
| 3170 | 3171 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c index d0d966d6080a..1696644ec022 100644 --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | |||
| @@ -182,6 +182,7 @@ static void mmhub_v1_0_init_cache_regs(struct amdgpu_device *adev) | |||
| 182 | tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, | 182 | tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, |
| 183 | L2_CACHE_BIGK_FRAGMENT_SIZE, 6); | 183 | L2_CACHE_BIGK_FRAGMENT_SIZE, 6); |
| 184 | } | 184 | } |
| 185 | WREG32_SOC15(MMHUB, 0, mmVM_L2_CNTL3, tmp); | ||
| 185 | 186 | ||
| 186 | tmp = mmVM_L2_CNTL4_DEFAULT; | 187 | tmp = mmVM_L2_CNTL4_DEFAULT; |
| 187 | tmp = REG_SET_FIELD(tmp, VM_L2_CNTL4, VMC_TAP_PDE_REQUEST_PHYSICAL, 0); | 188 | tmp = REG_SET_FIELD(tmp, VM_L2_CNTL4, VMC_TAP_PDE_REQUEST_PHYSICAL, 0); |
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index c68fbd55db3c..a6cda201c964 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c | |||
| @@ -1377,6 +1377,11 @@ static enum surface_update_type det_surface_update(const struct dc *dc, | |||
| 1377 | return UPDATE_TYPE_FULL; | 1377 | return UPDATE_TYPE_FULL; |
| 1378 | } | 1378 | } |
| 1379 | 1379 | ||
| 1380 | if (u->surface->force_full_update) { | ||
| 1381 | update_flags->bits.full_update = 1; | ||
| 1382 | return UPDATE_TYPE_FULL; | ||
| 1383 | } | ||
| 1384 | |||
| 1380 | type = get_plane_info_update_type(u); | 1385 | type = get_plane_info_update_type(u); |
| 1381 | elevate_update_type(&overall_type, type); | 1386 | elevate_update_type(&overall_type, type); |
| 1382 | 1387 | ||
| @@ -1802,6 +1807,14 @@ void dc_commit_updates_for_stream(struct dc *dc, | |||
| 1802 | } | 1807 | } |
| 1803 | 1808 | ||
| 1804 | dc_resource_state_copy_construct(state, context); | 1809 | dc_resource_state_copy_construct(state, context); |
| 1810 | |||
| 1811 | for (i = 0; i < dc->res_pool->pipe_count; i++) { | ||
| 1812 | struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i]; | ||
| 1813 | struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i]; | ||
| 1814 | |||
| 1815 | if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state) | ||
| 1816 | new_pipe->plane_state->force_full_update = true; | ||
| 1817 | } | ||
| 1805 | } | 1818 | } |
| 1806 | 1819 | ||
| 1807 | 1820 | ||
| @@ -1838,6 +1851,12 @@ void dc_commit_updates_for_stream(struct dc *dc, | |||
| 1838 | dc->current_state = context; | 1851 | dc->current_state = context; |
| 1839 | dc_release_state(old); | 1852 | dc_release_state(old); |
| 1840 | 1853 | ||
| 1854 | for (i = 0; i < dc->res_pool->pipe_count; i++) { | ||
| 1855 | struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; | ||
| 1856 | |||
| 1857 | if (pipe_ctx->plane_state && pipe_ctx->stream == stream) | ||
| 1858 | pipe_ctx->plane_state->force_full_update = false; | ||
| 1859 | } | ||
| 1841 | } | 1860 | } |
| 1842 | /*let's use current_state to update watermark etc*/ | 1861 | /*let's use current_state to update watermark etc*/ |
| 1843 | if (update_type >= UPDATE_TYPE_FULL) | 1862 | if (update_type >= UPDATE_TYPE_FULL) |
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 1a7fd6aa77eb..0515095574e7 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h | |||
| @@ -503,6 +503,9 @@ struct dc_plane_state { | |||
| 503 | struct dc_plane_status status; | 503 | struct dc_plane_status status; |
| 504 | struct dc_context *ctx; | 504 | struct dc_context *ctx; |
| 505 | 505 | ||
| 506 | /* HACK: Workaround for forcing full reprogramming under some conditions */ | ||
| 507 | bool force_full_update; | ||
| 508 | |||
| 506 | /* private to dc_surface.c */ | 509 | /* private to dc_surface.c */ |
| 507 | enum dc_irq_source irq_source; | 510 | enum dc_irq_source irq_source; |
| 508 | struct kref refcount; | 511 | struct kref refcount; |
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c index 4febf4ef7240..4fe3664fb495 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | |||
| @@ -190,6 +190,12 @@ static void submit_channel_request( | |||
| 190 | 1, | 190 | 1, |
| 191 | 0); | 191 | 0); |
| 192 | } | 192 | } |
| 193 | |||
| 194 | REG_UPDATE(AUX_INTERRUPT_CONTROL, AUX_SW_DONE_ACK, 1); | ||
| 195 | |||
| 196 | REG_WAIT(AUX_SW_STATUS, AUX_SW_DONE, 0, | ||
| 197 | 10, aux110->timeout_period/10); | ||
| 198 | |||
| 193 | /* set the delay and the number of bytes to write */ | 199 | /* set the delay and the number of bytes to write */ |
| 194 | 200 | ||
| 195 | /* The length include | 201 | /* The length include |
| @@ -242,9 +248,6 @@ static void submit_channel_request( | |||
| 242 | } | 248 | } |
| 243 | } | 249 | } |
| 244 | 250 | ||
| 245 | REG_UPDATE(AUX_INTERRUPT_CONTROL, AUX_SW_DONE_ACK, 1); | ||
| 246 | REG_WAIT(AUX_SW_STATUS, AUX_SW_DONE, 0, | ||
| 247 | 10, aux110->timeout_period/10); | ||
| 248 | REG_UPDATE(AUX_SW_CONTROL, AUX_SW_GO, 1); | 251 | REG_UPDATE(AUX_SW_CONTROL, AUX_SW_GO, 1); |
| 249 | } | 252 | } |
| 250 | 253 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h index d27f22c05e4b..e28ed6a00ff4 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.h | |||
| @@ -71,11 +71,11 @@ enum { /* This is the timeout as defined in DP 1.2a, | |||
| 71 | * at most within ~240usec. That means, | 71 | * at most within ~240usec. That means, |
| 72 | * increasing this timeout will not affect normal operation, | 72 | * increasing this timeout will not affect normal operation, |
| 73 | * and we'll timeout after | 73 | * and we'll timeout after |
| 74 | * SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 1600usec. | 74 | * SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 2400usec. |
| 75 | * This timeout is especially important for | 75 | * This timeout is especially important for |
| 76 | * resume from S3 and CTS. | 76 | * converters, resume from S3, and CTS. |
| 77 | */ | 77 | */ |
| 78 | SW_AUX_TIMEOUT_PERIOD_MULTIPLIER = 4 | 78 | SW_AUX_TIMEOUT_PERIOD_MULTIPLIER = 6 |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | struct dce_aux { | 81 | struct dce_aux { |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 3f56647cdb35..0fa5034b9f9e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -876,8 +876,10 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, | |||
| 876 | reservation_object_add_shared_fence(bo->resv, fence); | 876 | reservation_object_add_shared_fence(bo->resv, fence); |
| 877 | 877 | ||
| 878 | ret = reservation_object_reserve_shared(bo->resv, 1); | 878 | ret = reservation_object_reserve_shared(bo->resv, 1); |
| 879 | if (unlikely(ret)) | 879 | if (unlikely(ret)) { |
| 880 | dma_fence_put(fence); | ||
| 880 | return ret; | 881 | return ret; |
| 882 | } | ||
| 881 | 883 | ||
| 882 | dma_fence_put(bo->moving); | 884 | dma_fence_put(bo->moving); |
| 883 | bo->moving = fence; | 885 | bo->moving = fence; |
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index f841accc2c00..627f8dc91d0e 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c | |||
| @@ -730,9 +730,10 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, | |||
| 730 | } | 730 | } |
| 731 | 731 | ||
| 732 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 732 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 733 | if (!(flags & TTM_PAGE_FLAG_DMA32)) { | 733 | if (!(flags & TTM_PAGE_FLAG_DMA32) && |
| 734 | for (j = 0; j < HPAGE_PMD_NR; ++j) | 734 | (npages - i) >= HPAGE_PMD_NR) { |
| 735 | if (p++ != pages[i + j]) | 735 | for (j = 1; j < HPAGE_PMD_NR; ++j) |
| 736 | if (++p != pages[i + j]) | ||
| 736 | break; | 737 | break; |
| 737 | 738 | ||
| 738 | if (j == HPAGE_PMD_NR) | 739 | if (j == HPAGE_PMD_NR) |
| @@ -759,15 +760,15 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, | |||
| 759 | unsigned max_size, n2free; | 760 | unsigned max_size, n2free; |
| 760 | 761 | ||
| 761 | spin_lock_irqsave(&huge->lock, irq_flags); | 762 | spin_lock_irqsave(&huge->lock, irq_flags); |
| 762 | while (i < npages) { | 763 | while ((npages - i) >= HPAGE_PMD_NR) { |
| 763 | struct page *p = pages[i]; | 764 | struct page *p = pages[i]; |
| 764 | unsigned j; | 765 | unsigned j; |
| 765 | 766 | ||
| 766 | if (!p) | 767 | if (!p) |
| 767 | break; | 768 | break; |
| 768 | 769 | ||
| 769 | for (j = 0; j < HPAGE_PMD_NR; ++j) | 770 | for (j = 1; j < HPAGE_PMD_NR; ++j) |
| 770 | if (p++ != pages[i + j]) | 771 | if (++p != pages[i + j]) |
| 771 | break; | 772 | break; |
| 772 | 773 | ||
| 773 | if (j != HPAGE_PMD_NR) | 774 | if (j != HPAGE_PMD_NR) |
