From 45a3a972f07bd39fa9aa96aaa98517d6400b6fb6 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 23 Feb 2017 17:54:31 -0800 Subject: [PATCH 1/2] 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 Reviewed-by: Eric Anholt --- drivers/gpu/drm/vc4/vc4_plane.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 881bf489478b01..14d69bb4967ded 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -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" @@ -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 || @@ -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. From 7d19e0bec3117530299637e675063741b867ceb1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Mar 2017 12:17:16 -0800 Subject: [PATCH 2/2] panel-raspberrypi-touchscreen: Round up clk rate to fix DSI panel. Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the reported rate of PLLD, so the clk driver decided that PLLD/3/8 was now higher than our requested pixel clock rate and rejected it in favor of PLLD/4/8, which then ran the pixel clock way out of spec. By bumping the requested clock rate just slightly, we get back to PLLD/3/8 like we wanted and the panel displays content again. Signed-off-by: Eric Anholt --- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 1a536fe4d040f5..7f315f04b10962 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -220,7 +220,12 @@ static const struct drm_display_mode rpi_touchscreen_modes[] = { #define HBP 46 #define HFP ((PIXEL_CLOCK / (VTOTAL * VREFRESH)) - (HACT + HSW + HBP)) - .clock = PIXEL_CLOCK / 1000, + /* Round up the pixel clock a bit (10khz), so that the + * "don't run things faster than the requested clock + * rate" rule of the clk driver doesn't reject the + * divide-by-3 mode due to rounding error. + */ + .clock = PIXEL_CLOCK / 1000 + 10, .hdisplay = HACT, .hsync_start = HACT + HFP, .hsync_end = HACT + HFP + HSW,