Skip to content

Commit 92d43bd

Browse files
committed
drm/imx: ipuv3-plane: Fix overlay plane width
ipu_src_rect_width() was introduced to support odd screen resolutions such as 1366x768 by internally rounding up primary plane width to a multiple of 8 and compensating with reduced horizontal blanking. This also caused overlay plane width to be rounded up, which was not intended. Fix overlay plane width by limiting the rounding up to the primary plane. drm_rect_width(&new_state->src) >> 16 is the same value as drm_rect_width(dst) because there is no plane scaling support. Fixes: 94dfec4 ("drm/imx: Add 8 pixel alignment fix") Reviewed-by: Lucas Stach <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Tested-by: Ian Ray <[email protected]> (cherry picked from commit 4333472) Signed-off-by: Philipp Zabel <[email protected]>
1 parent a764da4 commit 92d43bd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/gpu/drm/imx/ipuv3-plane.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
614614
break;
615615
}
616616

617+
if (ipu_plane->dp_flow == IPU_DP_FLOW_SYNC_BG)
618+
width = ipu_src_rect_width(new_state);
619+
else
620+
width = drm_rect_width(&new_state->src) >> 16;
621+
617622
eba = drm_plane_state_to_eba(new_state, 0);
618623

619624
/*
@@ -622,8 +627,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
622627
*/
623628
if (ipu_state->use_pre) {
624629
axi_id = ipu_chan_assign_axi_id(ipu_plane->dma);
625-
ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id,
626-
ipu_src_rect_width(new_state),
630+
ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, width,
627631
drm_rect_height(&new_state->src) >> 16,
628632
fb->pitches[0], fb->format->format,
629633
fb->modifier, &eba);
@@ -678,9 +682,8 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
678682
break;
679683
}
680684

681-
ipu_dmfc_config_wait4eot(ipu_plane->dmfc, ALIGN(drm_rect_width(dst), 8));
685+
ipu_dmfc_config_wait4eot(ipu_plane->dmfc, width);
682686

683-
width = ipu_src_rect_width(new_state);
684687
height = drm_rect_height(&new_state->src) >> 16;
685688
info = drm_format_info(fb->format->format);
686689
ipu_calculate_bursts(width, info->cpp[0], fb->pitches[0],
@@ -744,8 +747,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
744747
ipu_cpmem_set_burstsize(ipu_plane->ipu_ch, 16);
745748

746749
ipu_cpmem_zero(ipu_plane->alpha_ch);
747-
ipu_cpmem_set_resolution(ipu_plane->alpha_ch,
748-
ipu_src_rect_width(new_state),
750+
ipu_cpmem_set_resolution(ipu_plane->alpha_ch, width,
749751
drm_rect_height(&new_state->src) >> 16);
750752
ipu_cpmem_set_format_passthrough(ipu_plane->alpha_ch, 8);
751753
ipu_cpmem_set_high_priority(ipu_plane->alpha_ch);

0 commit comments

Comments
 (0)