drm/msm: add support for per-CRTC max_vblank_count on mdp5
authorBrian Masney <masneyb@onstation.org>
Fri, 31 May 2019 09:46:15 +0000 (05:46 -0400)
committerSean Paul <seanpaul@chromium.org>
Thu, 1 Aug 2019 14:21:23 +0000 (10:21 -0400)
commit2bab52af6fe68c43b327a57e5ce5fc10eefdfadf
treeb2b050dc192c480ee4c0a749dfe48cfa26cc8e11
parent3de433c5b38af49a5fc7602721e2ab5d39f1e69c
drm/msm: add support for per-CRTC max_vblank_count on mdp5

The mdp5 drm/kms driver currently does not work on command-mode DSI
panels due to 'vblank wait timed out' errors. This causes a latency
of seconds, or tens of seconds in some cases, before content is shown
on the panel. This hardware does not have the something that we can use
as a frame counter available when running in command mode, so we need to
fall back to using timestamps by setting the max_vblank_count to zero.
This can be done on a per-CRTC basis, so the convert mdp5 to use
drm_crtc_set_max_vblank_count().

This change was tested on a LG Nexus 5 (hammerhead) phone.

Suggested-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190531094619.31704-3-masneyb@onstation.org
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c