Skip to content

Commit c4b7d6c

Browse files
xlnx-hyunkwonMichal Simek
authored andcommitted
drm: xlnx: zynqmp_disp: Skip the modeset for same fb
Since the async update creates a separate atomic mode set, there can be back to back atomic modeset with same fb. If the mode set is applied twice, it ends up submitting 2 dma transactions, and it results in jitter. This fixes it by adding the check in plane atomic update, and using plane mode set in async update. Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com> Tested-by: Preetesh Parekh <preetesh.parekh@xilinx.com>
1 parent 66158e1 commit c4b7d6c

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

drivers/gpu/drm/xlnx/zynqmp_disp.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,6 +2676,9 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
26762676
if (!plane->state->crtc || !plane->state->fb)
26772677
return;
26782678

2679+
if (plane->state->fb == old_state->fb)
2680+
return;
2681+
26792682
if (old_state->fb &&
26802683
old_state->fb->format->format != plane->state->fb->format->format)
26812684
zynqmp_disp_plane_disable(plane);
@@ -2712,12 +2715,15 @@ static void
27122715
zynqmp_disp_plane_atomic_async_update(struct drm_plane *plane,
27132716
struct drm_plane_state *new_state)
27142717
{
2715-
struct drm_plane_state *old_state =
2716-
drm_atomic_get_old_plane_state(new_state->state, plane);
2718+
int ret;
27172719

27182720
if (plane->state->fb == new_state->fb)
27192721
return;
27202722

2723+
if (plane->state->fb &&
2724+
plane->state->fb->format->format != new_state->fb->format->format)
2725+
zynqmp_disp_plane_disable(plane);
2726+
27212727
/* Update the current state with new configurations */
27222728
drm_atomic_set_fb_for_plane(plane->state, new_state->fb);
27232729
plane->state->crtc = new_state->crtc;
@@ -2731,7 +2737,19 @@ zynqmp_disp_plane_atomic_async_update(struct drm_plane *plane,
27312737
plane->state->src_h = new_state->src_h;
27322738
plane->state->state = new_state->state;
27332739

2734-
zynqmp_disp_plane_atomic_update(plane, old_state);
2740+
ret = zynqmp_disp_plane_mode_set(plane, plane->state->fb,
2741+
plane->state->crtc_x,
2742+
plane->state->crtc_y,
2743+
plane->state->crtc_w,
2744+
plane->state->crtc_h,
2745+
plane->state->src_x >> 16,
2746+
plane->state->src_y >> 16,
2747+
plane->state->src_w >> 16,
2748+
plane->state->src_h >> 16);
2749+
if (ret)
2750+
return;
2751+
2752+
zynqmp_disp_plane_enable(plane);
27352753
}
27362754

27372755
static const struct drm_plane_helper_funcs zynqmp_disp_plane_helper_funcs = {

0 commit comments

Comments
 (0)