@@ -734,10 +734,6 @@ static void calculate_split_count_and_index(struct pipe_ctx *pipe_ctx, int *spli
734734 (* split_idx )++ ;
735735 split_pipe = split_pipe -> top_pipe ;
736736 }
737-
738- /* MPO window on right side of ODM split */
739- if (split_pipe && split_pipe -> prev_odm_pipe && !pipe_ctx -> prev_odm_pipe )
740- (* split_idx )++ ;
741737 } else {
742738 /*Get odm split index*/
743739 struct pipe_ctx * split_pipe = pipe_ctx -> prev_odm_pipe ;
@@ -784,11 +780,7 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
784780 /*
785781 * Only the leftmost ODM pipe should be offset by a nonzero distance
786782 */
787- if (pipe_ctx -> top_pipe && pipe_ctx -> top_pipe -> prev_odm_pipe && !pipe_ctx -> prev_odm_pipe ) {
788- /* MPO window on right side of ODM split */
789- data -> recout .x = stream -> dst .x + (surf_clip .x - stream -> dst .width /2 ) *
790- stream -> dst .width / stream -> src .width ;
791- } else if (!pipe_ctx -> prev_odm_pipe || split_idx == split_count ) {
783+ if (!pipe_ctx -> prev_odm_pipe || split_idx == split_count ) {
792784 data -> recout .x = stream -> dst .x ;
793785 if (stream -> src .x < surf_clip .x )
794786 data -> recout .x += (surf_clip .x - stream -> src .x ) * stream -> dst .width
@@ -986,8 +978,6 @@ static void calculate_inits_and_viewports(struct pipe_ctx *pipe_ctx)
986978 * stream -> dst .height / stream -> src .height ;
987979 if (pipe_ctx -> prev_odm_pipe && split_idx )
988980 ro_lb = data -> h_active * split_idx - recout_full_x ;
989- else if (pipe_ctx -> top_pipe && pipe_ctx -> top_pipe -> prev_odm_pipe )
990- ro_lb = data -> h_active * split_idx - recout_full_x + data -> recout .x ;
991981 else
992982 ro_lb = data -> recout .x - recout_full_x ;
993983 ro_tb = data -> recout .y - recout_full_y ;
@@ -1086,9 +1076,6 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
10861076 timing -> v_border_top + timing -> v_border_bottom ;
10871077 if (pipe_ctx -> next_odm_pipe || pipe_ctx -> prev_odm_pipe )
10881078 pipe_ctx -> plane_res .scl_data .h_active /= get_num_odm_splits (pipe_ctx ) + 1 ;
1089- /* ODM + windows MPO, where window is on either right or left ODM half */
1090- else if (pipe_ctx -> top_pipe && (pipe_ctx -> top_pipe -> next_odm_pipe || pipe_ctx -> top_pipe -> prev_odm_pipe ))
1091- pipe_ctx -> plane_res .scl_data .h_active /= get_num_odm_splits (pipe_ctx -> top_pipe ) + 1 ;
10921079
10931080 /* depends on h_active */
10941081 calculate_recout (pipe_ctx );
@@ -1097,6 +1084,11 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
10971084 /* depends on scaling ratios and recout, does not calculate offset yet */
10981085 calculate_viewport_size (pipe_ctx );
10991086
1087+ /* Stopgap for validation of ODM + MPO on one side of screen case */
1088+ if (pipe_ctx -> plane_res .scl_data .viewport .height < 1 ||
1089+ pipe_ctx -> plane_res .scl_data .viewport .width < 1 )
1090+ return false;
1091+
11001092 /*
11011093 * LB calculations depend on vp size, h/v_active and scaling ratios
11021094 * Setting line buffer pixel depth to 24bpp yields banding
@@ -1445,54 +1437,23 @@ bool dc_add_plane_to_context(
14451437 if (head_pipe != free_pipe ) {
14461438 tail_pipe = resource_get_tail_pipe (& context -> res_ctx , head_pipe );
14471439 ASSERT (tail_pipe );
1448-
1449- /* ODM + window MPO, where MPO window is on right half only */
1450- if (free_pipe -> plane_state &&
1451- (free_pipe -> plane_state -> clip_rect .x >= free_pipe -> stream -> src .width /2 ) &&
1452- tail_pipe -> next_odm_pipe ) {
1453- free_pipe -> stream_res .tg = tail_pipe -> next_odm_pipe -> stream_res .tg ;
1454- free_pipe -> stream_res .abm = tail_pipe -> next_odm_pipe -> stream_res .abm ;
1455- free_pipe -> stream_res .opp = tail_pipe -> next_odm_pipe -> stream_res .opp ;
1456- free_pipe -> stream_res .stream_enc = tail_pipe -> next_odm_pipe -> stream_res .stream_enc ;
1457- free_pipe -> stream_res .audio = tail_pipe -> next_odm_pipe -> stream_res .audio ;
1458- free_pipe -> clock_source = tail_pipe -> next_odm_pipe -> clock_source ;
1459-
1460- free_pipe -> top_pipe = tail_pipe -> next_odm_pipe ;
1461- tail_pipe -> next_odm_pipe -> bottom_pipe = free_pipe ;
1462- } else {
1463- free_pipe -> stream_res .tg = tail_pipe -> stream_res .tg ;
1464- free_pipe -> stream_res .abm = tail_pipe -> stream_res .abm ;
1465- free_pipe -> stream_res .opp = tail_pipe -> stream_res .opp ;
1466- free_pipe -> stream_res .stream_enc = tail_pipe -> stream_res .stream_enc ;
1467- free_pipe -> stream_res .audio = tail_pipe -> stream_res .audio ;
1468- free_pipe -> clock_source = tail_pipe -> clock_source ;
1469-
1470- free_pipe -> top_pipe = tail_pipe ;
1471- tail_pipe -> bottom_pipe = free_pipe ;
1472-
1473- if (!free_pipe -> next_odm_pipe && tail_pipe -> next_odm_pipe && tail_pipe -> next_odm_pipe -> bottom_pipe ) {
1474- free_pipe -> next_odm_pipe = tail_pipe -> next_odm_pipe -> bottom_pipe ;
1475- tail_pipe -> next_odm_pipe -> bottom_pipe -> prev_odm_pipe = free_pipe ;
1476- }
1477- if (!free_pipe -> prev_odm_pipe && tail_pipe -> prev_odm_pipe && tail_pipe -> prev_odm_pipe -> bottom_pipe ) {
1478- free_pipe -> prev_odm_pipe = tail_pipe -> prev_odm_pipe -> bottom_pipe ;
1479- tail_pipe -> prev_odm_pipe -> bottom_pipe -> next_odm_pipe = free_pipe ;
1480- }
1440+ free_pipe -> stream_res .tg = tail_pipe -> stream_res .tg ;
1441+ free_pipe -> stream_res .abm = tail_pipe -> stream_res .abm ;
1442+ free_pipe -> stream_res .opp = tail_pipe -> stream_res .opp ;
1443+ free_pipe -> stream_res .stream_enc = tail_pipe -> stream_res .stream_enc ;
1444+ free_pipe -> stream_res .audio = tail_pipe -> stream_res .audio ;
1445+ free_pipe -> clock_source = tail_pipe -> clock_source ;
1446+ free_pipe -> top_pipe = tail_pipe ;
1447+ tail_pipe -> bottom_pipe = free_pipe ;
1448+ if (!free_pipe -> next_odm_pipe && tail_pipe -> next_odm_pipe && tail_pipe -> next_odm_pipe -> bottom_pipe ) {
1449+ free_pipe -> next_odm_pipe = tail_pipe -> next_odm_pipe -> bottom_pipe ;
1450+ tail_pipe -> next_odm_pipe -> bottom_pipe -> prev_odm_pipe = free_pipe ;
1451+ }
1452+ if (!free_pipe -> prev_odm_pipe && tail_pipe -> prev_odm_pipe && tail_pipe -> prev_odm_pipe -> bottom_pipe ) {
1453+ free_pipe -> prev_odm_pipe = tail_pipe -> prev_odm_pipe -> bottom_pipe ;
1454+ tail_pipe -> prev_odm_pipe -> bottom_pipe -> next_odm_pipe = free_pipe ;
14811455 }
14821456 }
1483-
1484- /* ODM + window MPO, where MPO window is on left half only */
1485- if (free_pipe -> plane_state &&
1486- (free_pipe -> plane_state -> clip_rect .x + free_pipe -> plane_state -> clip_rect .width <=
1487- free_pipe -> stream -> src .x + free_pipe -> stream -> src .width /2 )) {
1488- break ;
1489- }
1490- /* ODM + window MPO, where MPO window is on right half only */
1491- if (free_pipe -> plane_state &&
1492- (free_pipe -> plane_state -> clip_rect .x >= free_pipe -> stream -> src .width /2 )) {
1493- break ;
1494- }
1495-
14961457 head_pipe = head_pipe -> next_odm_pipe ;
14971458 }
14981459 /* assign new surfaces*/
0 commit comments