Use drmmode_crtc->scanout_id instead of 0 to check for scanout buffer
PATCH 1/2 Use drmmode_crtc->scanout_id instead of 0 to check for scanout buffer
From: Michel Dänzer <[email protected]>
Preparation for following change, no functional change intended.
(Ported from radeon commit aff267ee36cc6a703a532f91f82adc1ba1425ff3)
--- src/amdgpu_dri2.c | 5 +++-- src/amdgpu_kms.c | 4 ++-- src/amdgpu_present.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
src/amdgpu_dri2.c +3 -2
@@ -608,7 +608,8 @@ can_exchange(ScrnInfoPtr pScrn, DrawablePtr draw,drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;if (crtc->enabled && - (crtc->rotatedData || drmmode_crtc->scanout[0 ].bo)) + (crtc->rotatedData || + drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo))return FALSE; }
@@ -658,7 +659,7 @@ can_flip(ScrnInfoPtr pScrn, DrawablePtr draw,continue ;if (!drmmode_crtc || drmmode_crtc->rotate.bo || - drmmode_crtc->scanout[0 ].bo) + drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo)return FALSE;if (drmmode_crtc->pending_dpms_mode == DPMSModeOn)
src/amdgpu_kms.c +2 -2
@@ -635,7 +635,7 @@ amdgpu_prime_scanout_update(PixmapDirtyUpdatePtr dirty) drmmode_crtc = xf86_crtc->driver_private;if (drmmode_crtc->scanout_update_pending || - !drmmode_crtc->scanout[0 ].pixmap || + !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || drmmode_crtc->pending_dpms_mode != DPMSModeOn)return ;
@@ -921,7 +921,7 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc)if (!xf86_crtc->enabled || drmmode_crtc->scanout_update_pending || - !drmmode_crtc->scanout[0 ].pixmap || + !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || drmmode_crtc->pending_dpms_mode != DPMSModeOn)return ;
src/amdgpu_present.c +1 -1
@@ -234,7 +234,7 @@ amdgpu_present_check_unflip(ScrnInfoPtr scrn)continue ;if (!drmmode_crtc || drmmode_crtc->rotate.bo || - drmmode_crtc->scanout[0 ].bo) + drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo)return FALSE;if (drmmode_crtc->pending_dpms_mode == DPMSModeOn)
Signature · 6 lines
2.13.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170713084626.14854-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 2/2 If a TearFree flip fails, fall back to non-TearFree operation
From: Michel Dänzer <[email protected]>
In order to avoid possible freeze / log file spam in that case.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99769
(Ported from radeon commit 94dc2b80f3ef0b2c17c20501d824fb0447d52e7a)
--- src/amdgpu_kms.c | 21 +++++++++++++-------- src/drmmode_display.c | 12 +++++++----- src/drmmode_display.h | 2 ++ 3 files changed, 22 insertions(+), 13 deletions(-)
src/amdgpu_kms.c +13 -8
@@ -902,7 +902,9 @@ static void amdgpu_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *event_data) { - amdgpu_scanout_do_update(crtc, 0); + drmmode_crtc_private_ptr drmmode_crtc = event_data; + +amdgpu_scanout_do_update (crtc, drmmode_crtc->scanout_id);amdgpu_scanout_update_abort (crtc, event_data); }
@@ -921,7 +923,6 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc)if (!xf86_crtc->enabled || drmmode_crtc->scanout_update_pending || - !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || drmmode_crtc->pending_dpms_mode != DPMSModeOn)return ;
@@ -1023,9 +1024,17 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,if (drmmode_page_flip_target_relative (pAMDGPUEnt, drmmode_crtc, drmmode_crtc->flip_pending->handle,0 , drm_queue_seq,0 ) !=0 ) { -xf86DrvMsg (scrn->scrnIndex,X_WARNING ,"flip queue failed in %s: %s\n" , +xf86DrvMsg (scrn->scrnIndex,X_WARNING ,"flip queue failed in %s: %s, " +"TearFree inactive until next modeset\n" , __func__,strerror (errno));amdgpu_drm_abort_entry (drm_queue_seq); +RegionCopy (DamageRegion (drmmode_crtc->scanout_damage), + &drmmode_crtc->scanout_last_region); +RegionEmpty (&drmmode_crtc->scanout_last_region); +amdgpu_scanout_update (xf86_crtc); +drmmode_crtc_scanout_destroy (drmmode_crtc->drmmode, + &drmmode_crtc->scanout[scanout_id]); + drmmode_crtc->tear_free = FALSE;return ; }
@@ -1071,11 +1080,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)if (drmmode_crtc->tear_free)amdgpu_scanout_flip (pScreen, info, crtc); -else if (info->shadow_primary -#if XF86_CRTC_VERSION >= 4 - || crtc->driverIsPerformingTransform -#endif - ) +else if (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)amdgpu_scanout_update (crtc); } }
src/drmmode_display.c +7 -5
@@ -438,7 +438,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)return ; } -static void +void drmmode_crtc_scanout_destroy (drmmode_ptr drmmode,struct drmmode_scanout *scanout) {
@@ -707,15 +707,17 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,ScreenPtr screen = scrn->pScreen;drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -drmmode_crtc_scanout_create (crtc, &drmmode_crtc->scanout[0 ], +drmmode_crtc_scanout_create (crtc, &drmmode_crtc->scanout[scanout_id], mode->HDisplay, mode->VDisplay);if (drmmode_crtc->tear_free) { -drmmode_crtc_scanout_create (crtc, &drmmode_crtc->scanout[1 ], +drmmode_crtc_scanout_create (crtc, + &drmmode_crtc->scanout[scanout_id ^1 ], mode->HDisplay, mode->VDisplay); } -if (drmmode_crtc->scanout[0 ].pixmap && - (!drmmode_crtc->tear_free || drmmode_crtc->scanout[1 ].pixmap)) { +if (drmmode_crtc->scanout[scanout_id].pixmap && + (!drmmode_crtc->tear_free || + drmmode_crtc->scanout[scanout_id ^1 ].pixmap)) {RegionPtr region;BoxPtr box;
src/drmmode_display.h +2 -0
@@ -185,6 +185,8 @@ extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,extern void drmmode_copy_fb (ScrnInfoPtr pScrn,drmmode_ptr drmmode);extern Bool drmmode_setup_colormap (ScreenPtr pScreen,ScrnInfoPtr pScrn); +extern void drmmode_crtc_scanout_destroy (drmmode_ptr drmmode, +struct drmmode_scanout *scanout);extern void drmmode_scanout_free (ScrnInfoPtr scrn);extern void drmmode_uevent_init (ScrnInfoPtr scrn,drmmode_ptr drmmode);
Signature · 6 lines
2.13.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170713084626.14854-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH xf86-video-amdgpu 2/2] If a TearFree flip fails, fall back to non-TearFree operation
Quoted 8 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Thursday, July 13, 2017 4:46 AM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu 2/2] If a TearFree flip fails, fall back to non-TearFree operation
Quoted 8 lines
From: Michel Dänzer <[email protected]>
In order to avoid possible freeze / log file spam in that case.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99769
(Ported from radeon commit94dc2b80f3ef0b2c17c20501d824fb0447d52e7a)Signed-off-by Michel Dänzer <[email protected]>
Series is:
Quoted 133 lines
--- src/amdgpu_kms.c | 21 +++++++++++++-------- src/drmmode_display.c | 12 +++++++----- src/drmmode_display.h | 2 ++ 3 files changed, 22 insertions(+), 13 deletions(-)src/amdgpu_kms.c +3
-1@@ -902,7 +902,9 @@ static void amdgpu_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *event_data) { - amdgpu_scanout_do_update(crtc, 0); + drmmode_crtc_private_ptr drmmode_crtc = event_data; + +amdgpu_scanout_do_update (crtc, drmmode_crtc->scanout_id);amdgpu_scanout_update_abort (crtc, event_data);}
src/amdgpu_kms.c +1
-2@@ -921,7 +923,6 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc)if (!xf86_crtc->enabled || drmmode_crtc->scanout_update_pending || - !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || drmmode_crtc->pending_dpms_mode != DPMSModeOn)return ;@@ -1023,9 +1024,17 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info, if (drmmode_page_flip_target_relative(pAMDGPUEnt, drmmode_crtc, drmmode_crtc->flip_pending- >handle, 0, drm_queue_seq, 0) != 0) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s\n", + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queuefailed in %s: %s, "
src/amdgpu_kms.c +2
-0+"TearFree inactive until next modeset\n" , __func__, strerror(errno));amdgpu_drm_abort_entry (drm_queue_seq); + RegionCopy(DamageRegion(drmmode_crtc-Quoted 1 line
scanout_damage),src/amdgpu_kms.c +4
-0+ &drmmode_crtc->scanout_last_region); +RegionEmpty (&drmmode_crtc->scanout_last_region); +amdgpu_scanout_update (xf86_crtc); + drmmode_crtc_scanout_destroy(drmmode_crtc-Quoted 1 line
drmmode,
src/amdgpu_kms.c +1
-0+ &drmmode_crtc-Quoted 1 line
scanout[scanout_id]);
src/amdgpu_kms.c +2
-5+ drmmode_crtc->tear_free = FALSE;return ; }@@ -1071,11 +1080,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) if (drmmode_crtc->tear_free) amdgpu_scanout_flip(pScreen, info, crtc); - else if (info->shadow_primary -#if XF86_CRTC_VERSION >= 4 - || crtc->driverIsPerformingTransform -#endif - ) + else if (drmmode_crtc->scanout[drmmode_crtc- >scanout_id].pixmap) amdgpu_scanout_update(crtc);src/amdgpu_kms.c +0
-0} }src/drmmode_display.c +1
-1@@ -438,7 +438,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) return; } -static void +void drmmode_crtc_scanout_destroy (drmmode_ptr drmmode,struct drmmode_scanout *scanout){
src/drmmode_display.c +3
-4@@ -707,15 +707,17 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc,DisplayModePtr mode, ScreenPtr screen = scrn->pScreen;drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; -drmmode_crtc_scanout_create (crtc, &drmmode_crtc->scanout[0 ], +drmmode_crtc_scanout_create (crtc, &drmmode_crtc- >scanout[scanout_id], mode->HDisplay, mode->VDisplay);if (drmmode_crtc->tear_free) { -drmmode_crtc_scanout_create (crtc, &drmmode_crtc- >scanout[1], +drmmode_crtc_scanout_create (crtc, + &drmmode_crtc- >scanout[scanout_id ^ 1], mode->HDisplay, mode->VDisplay); } - if (drmmode_crtc->scanout[0].pixmap && - (!drmmode_crtc->tear_free || drmmode_crtc-Quoted 1 line
scanout[1].pixmap)) {
src/drmmode_display.c +3
-0+if (drmmode_crtc->scanout[scanout_id].pixmap && + (!drmmode_crtc->tear_free || + drmmode_crtc->scanout[scanout_id ^1 ].pixmap)) {RegionPtr region;BoxPtr box;src/drmmode_display.h +2
-0@@ -185,6 +185,8 @@ extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode, extern void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode);extern Bool drmmode_setup_colormap (ScreenPtr pScreen,ScrnInfoPtr pScrn); +extern void drmmode_crtc_scanout_destroy (drmmode_ptr drmmode, +struct drmmode_scanout *scanout);extern void
drmmode_scanout_free(ScrnInfoPtr scrn);extern void drmmode_uevent_init(ScrnInfoPtr scrn,
drmmode_ptr
drmmode);
--
2.13.2
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx