summaryrefslogtreecommitdiff
path: root/hw/xfree86/drivers/modesetting/drmmode_display.h
diff options
context:
space:
mode:
authorSultan Alsawaf <sultan@kerneltoast.com>2023-02-14 19:41:39 -0800
committerSultan Alsawaf <sultan@kerneltoast.com>2023-02-28 22:43:37 -0800
commit53b02054f36a49bd45e954f0eef1029152af78b7 (patch)
tree022246d317f6802e61eec488a3d80fd8e8c0d448 /hw/xfree86/drivers/modesetting/drmmode_display.h
parent9d1997f72aa431612961cba0e4c2cbf40c07f7c4 (diff)
downloadxserver-53b02054f36a49bd45e954f0eef1029152af78b7.tar.gz
modesetting: Support accurate DRI presentation timing with TearFree
When using TearFree, DRI clients have no way of accurately knowing when their copied pixmaps appear on the display without utilizing the kernel driver's notification indicating that the TearFree flip containing their pixmap is complete. This is because the target CRTC's MSC can change while the predicted completion MSC is calculated and even while the page flip IOCTL is sent to the kernel due to scheduling delays and/or unfortunate timing. Even worse, a page flip isn't actually guaranteed to be finished after one vblank; it may be several MSCs until a flip actually finishes depending on delays and load in hardware. As a result, DRI clients may be off by one or more MSCs when they naively expect their pixmaps to be visible at MSC+1 with TearFree enabled. This, for example, makes it impossible for DRI clients to achieve precise A/V synchronization when TearFree is enabled. This change therefore adds a way for DRI clients to receive a notification straight from the TearFree flip-done handler to know exactly when their pixmaps appear on the display. This is done by checking for a NULL pixmap pointer to modesetting's DRI flip routine, which indicates that the DRI client has copied its pixmap and wants TearFree to send a notification when the copied pixmap appears on the display as part of a TearFree flip. The existing PageFlip scaffolding is reused to achieve this with minimal churn. The Present extension will be updated in an upcoming change to utilize this new mechanism for DRI clients' presentations. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Diffstat (limited to 'hw/xfree86/drivers/modesetting/drmmode_display.h')
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index 145cb8cc7..b4074a30f 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -176,6 +176,7 @@ typedef struct {
typedef struct {
drmmode_shadow_fb_rec buf[2];
+ struct xorg_list dri_flip_list;
uint32_t back_idx;
uint32_t flip_seq;
} drmmode_tearfree_rec, *drmmode_tearfree_ptr;