summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSultan Alsawaf <sultan@kerneltoast.com>2023-01-22 20:57:14 -0800
committerSultan Alsawaf <sultan@kerneltoast.com>2023-02-28 22:43:37 -0800
commitbe864d8e185fe9e699fa661e70e02b319384dee6 (patch)
tree6013f44796f891237057f5eb3654873eaf216fe2
parent1fd9d79ae0dac5ae5f84f8012aa2764fcb777ea1 (diff)
downloadxserver-be864d8e185fe9e699fa661e70e02b319384dee6.tar.gz
modesetting: Pass CRTC pointer to TearFree flip handlers
The CRTC pointer will soon be needed in the TearFree flip handlers, so pass it in instead of passing in drmmode_tearfree_ptr. No functional change. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
-rw-r--r--hw/xfree86/drivers/modesetting/pageflip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c
index b0ff9655b..08a1bcd31 100644
--- a/hw/xfree86/drivers/modesetting/pageflip.c
+++ b/hw/xfree86/drivers/modesetting/pageflip.c
@@ -476,7 +476,9 @@ error_out:
static void
ms_tearfree_flip_abort(void *data)
{
- drmmode_tearfree_ptr trf = data;
+ xf86CrtcPtr crtc = data;
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_tearfree_ptr trf = &drmmode_crtc->tearfree;
trf->flip_seq = 0;
}
@@ -484,7 +486,9 @@ ms_tearfree_flip_abort(void *data)
static void
ms_tearfree_flip_handler(uint64_t msc, uint64_t usec, void *data)
{
- drmmode_tearfree_ptr trf = data;
+ xf86CrtcPtr crtc = data;
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_tearfree_ptr trf = &drmmode_crtc->tearfree;
/* Swap the buffers and complete the flip */
trf->back_idx ^= 1;
@@ -498,7 +502,7 @@ ms_do_tearfree_flip(ScreenPtr screen, xf86CrtcPtr crtc)
drmmode_tearfree_ptr trf = &drmmode_crtc->tearfree;
uint32_t idx = trf->back_idx, seq;
- seq = ms_drm_queue_alloc(crtc, trf, ms_tearfree_flip_handler,
+ seq = ms_drm_queue_alloc(crtc, crtc, ms_tearfree_flip_handler,
ms_tearfree_flip_abort);
if (!seq)
goto no_flip;