pinebookpro: avoid extremely poor performance issues (still bad) Don't set irq_enable true, and force no_vblank = true for each duplicated CRTC state. With both of these, attempting to run X11 apps no longer hangs for 3*10 seconds each operation (see drm_atomic_helper_wait_for_dependencies() and the calls to wait_for_completion_timeout() it makes for the hang cause -- the flip_done member is not completed ever.) There are interrupts in rkdrm that we do not setup or use, and perhaps with those in place we can avoid this hack, but this at least makes it possible to use the system if slowly. This does not fix the problem where the display is blank or corrupted until after X11 starts, dpms blanks the display and then turns it back on. Also set gamma_set to drm_atomic_helper_legacy_gamma_set. diff --git a/sys/arch/arm/rockchip/rk_drm.c b/sys/arch/arm/rockchip/rk_drm.c index 4dd875721f44..610ccd657151 100644 --- a/sys/arch/arm/rockchip/rk_drm.c +++ b/sys/arch/arm/rockchip/rk_drm.c @@ -437,7 +437,7 @@ rk_drm_load(struct drm_device *ddev, unsigned long flags) drm_fb_helper_initial_config(&fbdev->helper, 32); /* XXX */ - ddev->irq_enabled = true; + //ddev->irq_enabled = true; drm_vblank_init(ddev, num_crtc); return 0; diff --git a/sys/arch/arm/rockchip/rk_vop.c b/sys/arch/arm/rockchip/rk_vop.c index e717b716d6fe..f14830f470a5 100644 --- a/sys/arch/arm/rockchip/rk_vop.c +++ b/sys/arch/arm/rockchip/rk_vop.c @@ -510,6 +510,17 @@ rk_vop_atomic_enable(struct drm_crtc *crtc, struct drm_crtc_state *state) WR4(sc, VOP_DSP_VTOTAL_VS_END, val); } +static struct drm_crtc_state * +rk_drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc) +{ + struct drm_crtc_state *newcrtc; + + newcrtc = drm_atomic_helper_crtc_duplicate_state(crtc); + newcrtc->no_vblank = true; + + return newcrtc; +} + static void rk_vop_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *state) { @@ -532,8 +543,9 @@ static const struct drm_crtc_funcs rk_vop_crtc_funcs = { .destroy = drm_crtc_cleanup, .page_flip = drm_atomic_helper_page_flip, .reset = drm_atomic_helper_crtc_reset, - .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, + .atomic_duplicate_state = rk_drm_atomic_helper_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, + .gamma_set = drm_atomic_helper_legacy_gamma_set, }; static int