diff options
author | Christopher Michael <cp.michael@samsung.com> | 2019-01-28 14:45:23 -0500 |
---|---|---|
committer | Christopher Michael <cp.michael@samsung.com> | 2019-01-28 14:45:23 -0500 |
commit | 9dedaddf2dd550ea3b3d87e5f698e5fd4eab2161 (patch) | |
tree | 00508cf783a9b4f57c97ea157fd1ea57fdca55a4 /src/lib/ecore_drm2 | |
parent | 497acc672215fd3bbba64b43b9a5a28af06ccb0e (diff) |
ecore-drm2: Support multiple gpus during vblank
Summary:
When we try to calculate a drm vblank type, we should take into
account the output's pipe value which is used to determine if we are
using multiple gpus (if so, we need to use the high_crtc_mask.
Reviewers: ManMower
Reviewed By: ManMower
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7803
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_outputs.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 8cebea513b..293a78eec2 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c | |||
@@ -925,6 +925,20 @@ _output_destroy(Ecore_Drm2_Device *dev EINA_UNUSED, Ecore_Drm2_Output *output) | |||
925 | free(output); | 925 | free(output); |
926 | } | 926 | } |
927 | 927 | ||
928 | /* this function is used to indicate if we are in a multi-gpu situation | ||
929 | * and need to calculate vblank sync with high crtc mask */ | ||
930 | static unsigned int | ||
931 | _output_vblank_pipe(Ecore_Drm2_Output *output) | ||
932 | { | ||
933 | if (output->pipe > 1) | ||
934 | return ((output->pipe << DRM_VBLANK_HIGH_CRTC_SHIFT) & | ||
935 | DRM_VBLANK_HIGH_CRTC_MASK); | ||
936 | else if (output->pipe > 0) | ||
937 | return DRM_VBLANK_SECONDARY; | ||
938 | else | ||
939 | return 0; | ||
940 | } | ||
941 | |||
928 | EAPI Eina_Bool | 942 | EAPI Eina_Bool |
929 | ecore_drm2_outputs_create(Ecore_Drm2_Device *device) | 943 | ecore_drm2_outputs_create(Ecore_Drm2_Device *device) |
930 | { | 944 | { |
@@ -1619,6 +1633,7 @@ ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *s | |||
1619 | 1633 | ||
1620 | memset(&v, 0, sizeof(v)); | 1634 | memset(&v, 0, sizeof(v)); |
1621 | v.request.type = DRM_VBLANK_RELATIVE; | 1635 | v.request.type = DRM_VBLANK_RELATIVE; |
1636 | v.request.type |= _output_vblank_pipe(output); | ||
1622 | v.request.sequence = sequence; | 1637 | v.request.sequence = sequence; |
1623 | ret = sym_drmWaitVBlank(output->fd, &v); | 1638 | ret = sym_drmWaitVBlank(output->fd, &v); |
1624 | success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); | 1639 | success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); |