All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-amdgpu 2/9] present: Only call drmModeRmFB after setting modes for unflip
Date: Fri,  3 Mar 2017 18:07:38 +0900	[thread overview]
Message-ID: <20170303090745.2254-2-michel@daenzer.net> (raw)
In-Reply-To: <20170303090745.2254-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>

From: Michel Dänzer <michel.daenzer@amd.com>

Fixes display intermittently blanking when a modeset is used for unflip.

(Ported from radeon commit 3ff29e5a14451916bc66b4e0028e9a317f0723f8)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_present.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 364619084..5a345cb0a 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -351,6 +351,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 	struct amdgpu_present_vblank_event *event;
 	PixmapPtr pixmap = screen->GetScreenPixmap(screen);
+	int old_fb_id;
 	int i;
 
 	if (!amdgpu_present_check_unflip(scrn))
@@ -374,7 +375,7 @@ modeset:
 	/* info->drmmode.fb_id still points to the FB for the last flipped BO.
 	 * Clear it, drmmode_set_mode_major will re-create it
 	 */
-	drmModeRmFB(pAMDGPUEnt->fd, info->drmmode.fb_id);
+	old_fb_id = info->drmmode.fb_id;
 	info->drmmode.fb_id = 0;
 
 	for (i = 0; i < config->num_crtc; i++) {
@@ -391,6 +392,7 @@ modeset:
 			drmmode_crtc->need_modeset = TRUE;
 	}
 
+	drmModeRmFB(pAMDGPUEnt->fd, old_fb_id);
 	present_event_notify(event_id, 0, 0);
 	info->drmmode.present_flipping = FALSE;
 }
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-03-03  9:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  9:07 [PATCH xf86-video-amdgpu 1/9] Use drmmode_crtc_scanout_free in drmmode_fini Michel Dänzer
     [not found] ` <20170303090745.2254-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-03  9:07   ` Michel Dänzer [this message]
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 3/9] present: Wait for GPU idle before setting modes for unflip Michel Dänzer
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 4/9] present: Also flush before using a flip to unflip Michel Dänzer
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 5/9] present: Use async flip for unflip if possible Michel Dänzer
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 6/9] present: Flush before flipping Michel Dänzer
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 7/9] Call drmmode_set_desired_modes from a WindowExposures hook Michel Dänzer
     [not found]     ` <20170303090745.2254-7-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-06  1:47       ` [PATCH xf86-video-amdgpu v2 " Michel Dänzer
     [not found]         ` <20170306014759.9030-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-06 15:23           ` Alex Deucher
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 8/9] Move DPMS check from amdgpu_scanout_do_update to amdgpu_scanout_flip Michel Dänzer
2017-03-03  9:07   ` [PATCH xf86-video-amdgpu 9/9] Don't call amdgpu_glamor_flush in drmmode_copy_fb Michel Dänzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170303090745.2254-2-michel@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.