diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2022-03-24 13:32:55 +0100 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2022-03-25 09:33:19 +0100 |
commit | 47d7b27a682308755ca253e31f33608e0aa009a3 (patch) | |
tree | 159a2286259eaf31b19c27c0b6c9b88bfdeec22a | |
parent | 42e4cd1d2901a7f4f4e843394c6618e0c5ab4ac0 (diff) | |
download | libtdm-vc4-47d7b27a682308755ca253e31f33608e0aa009a3.tar.gz libtdm-vc4-47d7b27a682308755ca253e31f33608e0aa009a3.tar.bz2 libtdm-vc4-47d7b27a682308755ca253e31f33608e0aa009a3.zip |
Workaround: skip DPMS handling if there is no mode change
Setting DPMS properties causes VC4 to timeout on waiting for the vblank
on HDMI port 0 on RaspberriPi4b with the latest firmware. This is a known
firmware bug, but until it gets fixed, simply skip setting DPMS property
if there is no DPMS mode change.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I00c255c811700070e4d5a86c336cdbc130a0a23e
-rw-r--r-- | src/libhal-backend-tdm-vc4/tdm_vc4_display.c | 9 | ||||
-rw-r--r-- | src/libtdm-vc4/tdm_vc4_display.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/libhal-backend-tdm-vc4/tdm_vc4_display.c b/src/libhal-backend-tdm-vc4/tdm_vc4_display.c index eb92ecf..3db50bb 100644 --- a/src/libhal-backend-tdm-vc4/tdm_vc4_display.c +++ b/src/libhal-backend-tdm-vc4/tdm_vc4_display.c @@ -1733,6 +1733,7 @@ hal_tdm_error vc4_output_set_dpms(hal_tdm_output *output, hal_tdm_output_dpms dpms_value) { tdm_vc4_output *output_data = output; + hal_tdm_output_dpms cur_dpms_value; tdm_vc4_display *display_data; int ret; @@ -1743,6 +1744,14 @@ vc4_output_set_dpms(hal_tdm_output *output, hal_tdm_output_dpms dpms_value) return HAL_TDM_ERROR_OPERATION_FAILED; } + /* + * Workaround for the RPi4 firmware bug, call drmModeObjectSetProperty + * only if there is a real DPMS mode change to avoid vblank timeout. + */ + if (vc4_output_get_dpms(output, &cur_dpms_value) == HAL_TDM_ERROR_NONE && + cur_dpms_value == dpms_value) + return HAL_TDM_ERROR_NONE; + display_data = output_data->display_data; ret = drmModeObjectSetProperty(display_data->drm_fd, output_data->connector_id, DRM_MODE_OBJECT_CONNECTOR, diff --git a/src/libtdm-vc4/tdm_vc4_display.c b/src/libtdm-vc4/tdm_vc4_display.c index 49ab114..4fbad9d 100644 --- a/src/libtdm-vc4/tdm_vc4_display.c +++ b/src/libtdm-vc4/tdm_vc4_display.c @@ -1775,6 +1775,7 @@ tdm_error vc4_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value) { tdm_vc4_output_data *output_data = output; + tdm_output_dpms cur_dpms_value; tdm_vc4_data *vc4_data; int ret; @@ -1785,6 +1786,14 @@ vc4_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value) return TDM_ERROR_OPERATION_FAILED; } + /* + * Workaround for the RPi4 firmware bug, call drmModeObjectSetProperty + * only if there is a real DPMS mode change to avoid vblank timeout. + */ + if (vc4_output_get_dpms(output, &cur_dpms_value) == TDM_ERROR_NONE && + cur_dpms_value == dpms_value) + return TDM_ERROR_NONE; + vc4_data = output_data->vc4_data; ret = drmModeObjectSetProperty(vc4_data->drm_fd, output_data->connector_id, DRM_MODE_OBJECT_CONNECTOR, |