xf86-video-amdgpu: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 20 09:26:30 UTC 2018


 src/amdgpu_present.c  |   32 ++++++++++++++------------------
 src/drmmode_display.h |    1 -
 2 files changed, 14 insertions(+), 19 deletions(-)

New commits:
commit b689dc5081493377a31759d24a8dc9fcde12948a
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Dec 18 16:39:28 2018 +0100

    Remove superfluous vrr_flipping field and clean up related code
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 4c6866b..5a4b9c0 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -91,16 +91,15 @@ amdgpu_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc)
  * Changes the variable refresh state for every CRTC on the screen.
  */
 static void
-amdgpu_present_set_screen_vrr(ScrnInfoPtr scrn)
+amdgpu_present_set_screen_vrr(ScrnInfoPtr scrn, Bool vrr_enabled)
 {
-	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 	xf86CrtcPtr crtc;
 	int i;
 
 	for (i = 0; i < config->num_crtc; i++) {
 		crtc = config->crtc[i];
-		drmmode_crtc_set_vrr(crtc, info->drmmode.vrr_flipping);
+		drmmode_crtc_set_vrr(crtc, vrr_enabled);
 	}
 }
 
@@ -292,16 +291,6 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
 
 	info->flip_window = window;
 
-	/* A window can only flip if it covers the entire X screen.
-	 * Only one window can flip at a time.
-	 *
-	 * If the window also has the variable refresh property then
-	 * variable refresh supported can be enabled on every CRTC.
-	 */
-	info->drmmode.vrr_flipping =
-		info->vrr_support &&
-		amdgpu_window_has_variable_refresh(window);
-
 	return TRUE;
 }
 
@@ -347,7 +336,7 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
 	struct amdgpu_present_vblank_event *event;
 	Bool ret = FALSE;
 
-	if (!amdgpu_present_check_flip(crtc, info->flip_window , pixmap, sync_flip))
+	if (!amdgpu_present_check_flip(crtc, info->flip_window, pixmap, sync_flip))
 		return ret;
 
 	event = calloc(1, sizeof(struct amdgpu_present_vblank_event));
@@ -356,7 +345,16 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
 
 	event->event_id = event_id;
 
-	amdgpu_present_set_screen_vrr(scrn);
+	/* A window can only flip if it covers the entire X screen.
+	 * Only one window can flip at a time.
+	 *
+	 * If the window also has the variable refresh property then
+	 * variable refresh supported can be enabled on every CRTC.
+	 */
+	if (info->vrr_support &&
+	    amdgpu_window_has_variable_refresh(info->flip_window))
+		amdgpu_present_set_screen_vrr(scrn, TRUE);
+
 	amdgpu_glamor_flush(scrn);
 
 	ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
@@ -389,8 +387,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
 		FLIP_ASYNC : FLIP_VSYNC;
 	int i;
 
-	info->drmmode.vrr_flipping = FALSE;
-	amdgpu_present_set_screen_vrr(scrn);
+	amdgpu_present_set_screen_vrr(scrn, FALSE);
 
 	if (!amdgpu_present_check_unflip(scrn))
 		goto modeset;
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 2fb97df..5063df9 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -65,7 +65,6 @@ typedef struct {
 
 	Bool dri2_flipping;
 	Bool present_flipping;
-	Bool vrr_flipping;
 	uint32_t vrr_prop_id;
 
 	/* Cache for DRM property type IDs for CRTC color management */
commit 233a0be82d5c317e58002f4daf836d4f95048465
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Dec 18 16:42:53 2018 +0100

    Don't clear info->flip_window in present_unflip
    
    present_unflip can get called between present_check_flip and
    present_flip, in which case the latter would pass a NULL WindowPtr to
    the former, resulting in a crash.
    
    present_flip should never get called for a window which has already been
    destroyed, so there's no need to clear info->flip_window.
    
    Bugzilla: https://bugs.freedesktop.org/109067
    Fixes: 2d18b37159edc "Check last flip window instead of screen root
                          before flipping"
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index f3af045..4c6866b 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -389,7 +389,6 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
 		FLIP_ASYNC : FLIP_VSYNC;
 	int i;
 
-	info->flip_window = NULL;
 	info->drmmode.vrr_flipping = FALSE;
 	amdgpu_present_set_screen_vrr(scrn);
 


More information about the xorg-commit mailing list