Skip to content

Commit f3f8f16

Browse files
Samson Tamalexdeucher
authored andcommitted
drm/amd/display: enable DPG when disabling plane for phantom pipe
[Why] In disable_dangling_plane, for phantom pipes, we enable OTG so disable programming gets the double buffer update. But this causes an underflow to occur. [How] Enable DPG prior to enabling OTG. Reviewed-by: Alvin Lee <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Samson Tam <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b5fefd0 commit f3f8f16

File tree

1 file changed

+46
-1
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+46
-1
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373

7474
#include "dc_trace.h"
7575

76+
#include "hw_sequencer_private.h"
77+
7678
#include "dce/dmub_outbox.h"
7779

7880
#define CTX \
@@ -1056,6 +1058,44 @@ static void apply_ctx_interdependent_lock(struct dc *dc, struct dc_state *contex
10561058
}
10571059
}
10581060

1061+
static void phantom_pipe_blank(
1062+
struct dc *dc,
1063+
struct timing_generator *tg,
1064+
int width,
1065+
int height)
1066+
{
1067+
struct dce_hwseq *hws = dc->hwseq;
1068+
enum dc_color_space color_space;
1069+
struct tg_color black_color = {0};
1070+
struct output_pixel_processor *opp = NULL;
1071+
uint32_t num_opps, opp_id_src0, opp_id_src1;
1072+
uint32_t otg_active_width, otg_active_height;
1073+
1074+
/* program opp dpg blank color */
1075+
color_space = COLOR_SPACE_SRGB;
1076+
color_space_to_black_color(dc, color_space, &black_color);
1077+
1078+
otg_active_width = width;
1079+
otg_active_height = height;
1080+
1081+
/* get the OPTC source */
1082+
tg->funcs->get_optc_source(tg, &num_opps, &opp_id_src0, &opp_id_src1);
1083+
ASSERT(opp_id_src0 < dc->res_pool->res_cap->num_opp);
1084+
opp = dc->res_pool->opps[opp_id_src0];
1085+
1086+
opp->funcs->opp_set_disp_pattern_generator(
1087+
opp,
1088+
CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR,
1089+
CONTROLLER_DP_COLOR_SPACE_UDEFINED,
1090+
COLOR_DEPTH_UNDEFINED,
1091+
&black_color,
1092+
otg_active_width,
1093+
otg_active_height,
1094+
0);
1095+
1096+
hws->funcs.wait_for_blank_complete(opp);
1097+
}
1098+
10591099
static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
10601100
{
10611101
int i, j;
@@ -1114,8 +1154,13 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
11141154
* again for different use.
11151155
*/
11161156
if (old_stream->mall_stream_config.type == SUBVP_PHANTOM) {
1117-
if (tg->funcs->enable_crtc)
1157+
if (tg->funcs->enable_crtc) {
1158+
int main_pipe_width, main_pipe_height;
1159+
main_pipe_width = old_stream->mall_stream_config.paired_stream->dst.width;
1160+
main_pipe_height = old_stream->mall_stream_config.paired_stream->dst.height;
1161+
phantom_pipe_blank(dc, tg, main_pipe_width, main_pipe_height);
11181162
tg->funcs->enable_crtc(tg);
1163+
}
11191164
}
11201165
dc_rem_all_planes_for_stream(dc, old_stream, dangling_context);
11211166
disable_all_writeback_pipes_for_stream(dc, old_stream, dangling_context);

0 commit comments

Comments
 (0)