diff options
author | Sultan Alsawaf <sultan@kerneltoast.com> | 2023-02-14 19:41:50 -0800 |
---|---|---|
committer | Sultan Alsawaf <sultan@kerneltoast.com> | 2023-02-28 22:43:37 -0800 |
commit | f490622fca4ec175193f68587b9c647a2ab515f4 (patch) | |
tree | b61a8aa40fe036e6ff6764872a64c61b27bdae1f | |
parent | 1fab978a9585cc7fea483583bc1c76e9e48e4f35 (diff) | |
download | xserver-f490622fca4ec175193f68587b9c647a2ab515f4.tar.gz |
present: Document the TearFree flip reasons in PresentFlipReason
Adding new flip reasons after the TearFree ones would break the assumption
that `reason >= PRESENT_FLIP_REASON_DRIVER_TEARFREE` implies either of the
TearFree reasons. Document this in the PresentFlipReason enum in order to
save someone a very bad headache in the future.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
-rw-r--r-- | present/present.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/present/present.h b/present/present.h index 1d7b0ce42..a3f34a929 100644 --- a/present/present.h +++ b/present/present.h @@ -30,6 +30,12 @@ typedef enum { PRESENT_FLIP_REASON_UNKNOWN, PRESENT_FLIP_REASON_BUFFER_FORMAT, + + /* Don't add new flip reasons after the TearFree ones, since it's expected + * that the TearFree reasons are the highest ones in order to allow doing + * `reason >= PRESENT_FLIP_REASON_DRIVER_TEARFREE` to check if a reason is + * PRESENT_FLIP_REASON_DRIVER_TEARFREE{_FLIPPING}. + */ PRESENT_FLIP_REASON_DRIVER_TEARFREE, PRESENT_FLIP_REASON_DRIVER_TEARFREE_FLIPPING } PresentFlipReason; |