Skip to content

Commit

Permalink
drm/vc4: Don't wait for vblank when updating the cursor
Browse files Browse the repository at this point in the history
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 <mzoran@crowfest.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170224015431.24583-1-mzoran@crowfest.net
  • Loading branch information
Michael Zoran authored and Eric Anholt committed Feb 28, 2017
1 parent fb4fe33 commit 6d24c1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/gpu/drm/vc4/vc4_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "vc4_drv.h"
#include "vc4_regs.h"
#include "drm_atomic.h"
#include "drm_atomic_helper.h"
#include "drm_fb_cma_helper.h"
#include "drm_plane_helper.h"
Expand Down Expand Up @@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane,
if (!plane_state)
goto out;

/* If we're changing the cursor contents, do that in the
* normal vblank-synced atomic path.
*/
if (fb != plane_state->fb)
goto out;

/* No configuring new scaling in the fast path. */
if (crtc_w != plane_state->crtc_w ||
crtc_h != plane_state->crtc_h ||
Expand All @@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane,
goto out;
}

if (fb != plane_state->fb) {
drm_atomic_set_fb_for_plane(plane->state, fb);
vc4_plane_async_set_fb(plane, fb);
}

/* Set the cursor's position on the screen. This is the
* expected change from the drm_mode_cursor_universal()
* helper.
Expand Down

0 comments on commit 6d24c1c

Please sign in to comment.