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

drm/amd/display: Cache cursor when cursor exceeds 64x64

[Why]
When Static screen from MALL, the cursor needs to be
cached if cursor exceeds 64x64 size.

[How]
Program the bit that cache cursor in MALL when size
of the cursor exceeds 64x64.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Chris Park <chris.park@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Chris Park and committed by
Alex Deucher
4074f96d 81f776b6

+11 -6
+2 -2
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.c
··· 47 47 DATA_UCLK_PSTATE_FORCE_VALUE, 0); 48 48 } 49 49 50 - void hubp32_update_mall_sel(struct hubp *hubp, uint32_t mall_sel) 50 + void hubp32_update_mall_sel(struct hubp *hubp, uint32_t mall_sel, bool c_cursor) 51 51 { 52 52 struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp); 53 53 54 54 // Also cache cursor in MALL if using MALL for SS 55 55 REG_UPDATE_2(DCHUBP_MALL_CONFIG, USE_MALL_SEL, mall_sel, 56 - USE_MALL_FOR_CURSOR, mall_sel == 2 ? 1 : 0); 56 + USE_MALL_FOR_CURSOR, c_cursor); 57 57 } 58 58 59 59 void hubp32_prepare_subvp_buffering(struct hubp *hubp, bool enable)
+1 -1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
··· 52 52 53 53 void hubp32_update_force_pstate_disallow(struct hubp *hubp, bool pstate_disallow); 54 54 55 - void hubp32_update_mall_sel(struct hubp *hubp, uint32_t mall_sel); 55 + void hubp32_update_mall_sel(struct hubp *hubp, uint32_t mall_sel, bool c_cursor); 56 56 57 57 void hubp32_prepare_subvp_buffering(struct hubp *hubp, bool enable); 58 58
+7 -2
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
··· 670 670 { 671 671 int i; 672 672 unsigned int num_ways = dcn32_calculate_cab_allocation(dc, context); 673 + bool cache_cursor = false; 673 674 674 675 for (i = 0; i < dc->res_pool->pipe_count; i++) { 675 676 struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; 676 677 struct hubp *hubp = pipe->plane_res.hubp; 677 678 678 679 if (pipe->stream && pipe->plane_state && hubp && hubp->funcs->hubp_update_mall_sel) { 680 + if (hubp->curs_attr.width * hubp->curs_attr.height * 4 > 16384) 681 + cache_cursor = true; 682 + 679 683 if (pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) { 680 - hubp->funcs->hubp_update_mall_sel(hubp, 1); 684 + hubp->funcs->hubp_update_mall_sel(hubp, 1, false); 681 685 } else { 682 686 hubp->funcs->hubp_update_mall_sel(hubp, 683 687 num_ways <= dc->caps.cache_num_ways && 684 - pipe->stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED ? 2 : 0); 688 + pipe->stream->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED ? 2 : 0, 689 + cache_cursor); 685 690 } 686 691 } 687 692 }
+1 -1
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h
··· 198 198 void (*hubp_soft_reset)(struct hubp *hubp, bool reset); 199 199 200 200 void (*hubp_update_force_pstate_disallow)(struct hubp *hubp, bool allow); 201 - void (*hubp_update_mall_sel)(struct hubp *hubp, uint32_t mall_sel); 201 + void (*hubp_update_mall_sel)(struct hubp *hubp, uint32_t mall_sel, bool c_cursor); 202 202 void (*hubp_prepare_subvp_buffering)(struct hubp *hubp, bool enable); 203 203 204 204 void (*hubp_set_flip_int)(struct hubp *hubp);