Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+43 -13
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 3165 3165 3166 3166 /* No need to recover an evicted BO */ 3167 3167 if (shadow->tbo.mem.mem_type != TTM_PL_TT || 3168 + shadow->tbo.mem.start == AMDGPU_BO_INVALID_OFFSET || 3168 3169 shadow->parent->tbo.mem.mem_type != TTM_PL_VRAM) 3169 3170 continue; 3170 3171
+1
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
··· 182 182 tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, 183 183 L2_CACHE_BIGK_FRAGMENT_SIZE, 6); 184 184 } 185 + WREG32_SOC15(MMHUB, 0, mmVM_L2_CNTL3, tmp); 185 186 186 187 tmp = mmVM_L2_CNTL4_DEFAULT; 187 188 tmp = REG_SET_FIELD(tmp, VM_L2_CNTL4, VMC_TAP_PDE_REQUEST_PHYSICAL, 0);
+19
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 1377 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 1385 type = get_plane_info_update_type(u); 1381 1386 elevate_update_type(&overall_type, type); 1382 1387 ··· 1807 1802 } 1808 1803 1809 1804 dc_resource_state_copy_construct(state, context); 1805 + 1806 + for (i = 0; i < dc->res_pool->pipe_count; i++) { 1807 + struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i]; 1808 + struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i]; 1809 + 1810 + if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state) 1811 + new_pipe->plane_state->force_full_update = true; 1812 + } 1810 1813 } 1811 1814 1812 1815 ··· 1851 1838 dc->current_state = context; 1852 1839 dc_release_state(old); 1853 1840 1841 + for (i = 0; i < dc->res_pool->pipe_count; i++) { 1842 + struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; 1843 + 1844 + if (pipe_ctx->plane_state && pipe_ctx->stream == stream) 1845 + pipe_ctx->plane_state->force_full_update = false; 1846 + } 1854 1847 } 1855 1848 /*let's use current_state to update watermark etc*/ 1856 1849 if (update_type >= UPDATE_TYPE_FULL)
+3
drivers/gpu/drm/amd/display/dc/dc.h
··· 503 503 struct dc_plane_status status; 504 504 struct dc_context *ctx; 505 505 506 + /* HACK: Workaround for forcing full reprogramming under some conditions */ 507 + bool force_full_update; 508 + 506 509 /* private to dc_surface.c */ 507 510 enum dc_irq_source irq_source; 508 511 struct kref refcount;
+6 -3
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
··· 190 190 1, 191 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 199 /* set the delay and the number of bytes to write */ 194 200 195 201 /* The length include ··· 248 242 } 249 243 } 250 244 251 - REG_UPDATE(AUX_INTERRUPT_CONTROL, AUX_SW_DONE_ACK, 1); 252 - REG_WAIT(AUX_SW_STATUS, AUX_SW_DONE, 0, 253 - 10, aux110->timeout_period/10); 254 245 REG_UPDATE(AUX_SW_CONTROL, AUX_SW_GO, 1); 255 246 } 256 247
+3 -3
drivers/gpu/drm/amd/display/dc/dce/dce_aux.h
··· 71 71 * at most within ~240usec. That means, 72 72 * increasing this timeout will not affect normal operation, 73 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 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 81 struct dce_aux {
+3 -1
drivers/gpu/drm/ttm/ttm_bo.c
··· 876 876 reservation_object_add_shared_fence(bo->resv, fence); 877 877 878 878 ret = reservation_object_reserve_shared(bo->resv, 1); 879 - if (unlikely(ret)) 879 + if (unlikely(ret)) { 880 + dma_fence_put(fence); 880 881 return ret; 882 + } 881 883 882 884 dma_fence_put(bo->moving); 883 885 bo->moving = fence;
+7 -6
drivers/gpu/drm/ttm/ttm_page_alloc.c
··· 730 730 } 731 731 732 732 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 733 - if (!(flags & TTM_PAGE_FLAG_DMA32)) { 734 - for (j = 0; j < HPAGE_PMD_NR; ++j) 735 - if (p++ != pages[i + j]) 733 + if (!(flags & TTM_PAGE_FLAG_DMA32) && 734 + (npages - i) >= HPAGE_PMD_NR) { 735 + for (j = 1; j < HPAGE_PMD_NR; ++j) 736 + if (++p != pages[i + j]) 736 737 break; 737 738 738 739 if (j == HPAGE_PMD_NR) ··· 760 759 unsigned max_size, n2free; 761 760 762 761 spin_lock_irqsave(&huge->lock, irq_flags); 763 - while (i < npages) { 762 + while ((npages - i) >= HPAGE_PMD_NR) { 764 763 struct page *p = pages[i]; 765 764 unsigned j; 766 765 767 766 if (!p) 768 767 break; 769 768 770 - for (j = 0; j < HPAGE_PMD_NR; ++j) 771 - if (p++ != pages[i + j]) 769 + for (j = 1; j < HPAGE_PMD_NR; ++j) 770 + if (++p != pages[i + j]) 772 771 break; 773 772 774 773 if (j != HPAGE_PMD_NR)