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

drm/amd/display: Fix null timing generator resource

[Why]
For some customer blending transition cases, the
available pipe for second stream is a pipe index that is
greater than the number of timing generators, which
can cause a problem in acquire_first_free_pipe since it
assumes same index for pipe and timing generator

[How]
Added logic to use last timing generator index
if the pipe index is greater than number of timing generators.

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Eric Bernstein and committed by
Alex Deucher
c1127df9 8bc3812d

+6
+6
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 1885 1885 pipe_ctx->plane_res.mpcc_inst = pool->dpps[i]->inst; 1886 1886 pipe_ctx->pipe_idx = i; 1887 1887 1888 + if (i >= pool->timing_generator_count) { 1889 + int tg_inst = pool->timing_generator_count - 1; 1890 + 1891 + pipe_ctx->stream_res.tg = pool->timing_generators[tg_inst]; 1892 + pipe_ctx->stream_res.opp = pool->opps[tg_inst]; 1893 + } 1888 1894 1889 1895 pipe_ctx->stream = stream; 1890 1896 return i;