Skip to content

Commit 6834348

Browse files
Electron752anholt
authored andcommitted
drm/vc4: Don't wait for vblank when updating the cursor
Commonly used desktop environments such as xfce4 and gnome on debian sid can flood the graphics drivers with cursor updates. Because the current implementation is waiting for a vblank between cursor updates, this will cause the display to hang for a long time since a typical refresh rate is only 60Hz. This is unnecessary and unexpected by user mode software, so simply swap out the cursor frame buffer without waiting. Signed-off-by: Michael Zoran <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
1 parent 5a2ec1d commit 6834348

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "vc4_drv.h"
2222
#include "vc4_regs.h"
23+
#include "drm_atomic.h"
2324
#include "drm_atomic_helper.h"
2425
#include "drm_fb_cma_helper.h"
2526
#include "drm_plane_helper.h"
@@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane,
769770
if (!plane_state)
770771
goto out;
771772

772-
/* If we're changing the cursor contents, do that in the
773-
* normal vblank-synced atomic path.
774-
*/
775-
if (fb != plane_state->fb)
776-
goto out;
777-
778773
/* No configuring new scaling in the fast path. */
779774
if (crtc_w != plane_state->crtc_w ||
780775
crtc_h != plane_state->crtc_h ||
@@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane,
783778
goto out;
784779
}
785780

781+
if (fb != plane_state->fb) {
782+
drm_atomic_set_fb_for_plane(plane->state, fb);
783+
vc4_plane_async_set_fb(plane, fb);
784+
}
785+
786786
/* Set the cursor's position on the screen. This is the
787787
* expected change from the drm_mode_cursor_universal()
788788
* helper.

0 commit comments

Comments
 (0)