Skip to contentSkip to conversation

Use drmmode_crtc_scanout_free in drmmode_fini

PATCH New Michel Dänzer 2 participants 11 messages Mar 3, 2017 – Mar 6, 2017 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 Use drmmode_crtc_scanout_free in drmmode_fini

From: Michel Dänzer <[email protected]>

We were leaking drmmode_crtc->scanout_damage, which caused trouble on server reset. Fixes server reset with active separate scanout pixmaps.

(Cherry picked from radeon commit 0c29deb5a97d9a57e994cc0053c49ddf7aca6ecb)

---
 src/drmmode_display.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
src/drmmode_display.c +2 -7
index 40439dd2b..406b5eed6 100644
@@ -2415,13 +2415,8 @@ void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 #endif
 	}
 
-	for (c = 0; c < config->num_crtc; c++) {
-		xf86CrtcPtr crtc = config->crtc[c];
-		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
-		drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[0]);
-		drmmode_crtc_scanout_destroy(&info->drmmode, &drmmode_crtc->scanout[1]);
-	}
+	for (c = 0; c < config->num_crtc; c++)
+		drmmode_crtc_scanout_free(config->crtc[c]->driver_private);
 }
 
 void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id,
Signature · 6 lines
2.11.0

_______________________________________________
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): 20170303090745.2254-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/9 present: Only call drmModeRmFB after setting modes for unflip

From: Michel Dänzer <[email protected]>

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

(Ported from radeon commit 3ff29e5a14451916bc66b4e0028e9a317f0723f8)

---
 src/amdgpu_present.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/amdgpu_present.c +3 -1
index 364619084..5a345cb0a 100644
@@ -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;
 }
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/9 present: Wait for GPU idle before setting modes for unflip

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

To make sure the screen pixmap contents are up to date when it starts being scanned out.

(Ported from radeon commit 244d4bc7f8c8f6bc90f49556c0b9344c8aa40295)

---
 src/amdgpu_present.c | 1 +
 1 file changed, 1 insertion(+)
src/amdgpu_present.c +1 -0
index 5a345cb0a..cf6e36b2f 100644
@@ -378,6 +378,7 @@ modeset:
 	old_fb_id = info->drmmode.fb_id;
 	info->drmmode.fb_id = 0;
 
+	amdgpu_glamor_finish(scrn);
 	for (i = 0; i < config->num_crtc; i++) {
 		xf86CrtcPtr crtc = config->crtc[i];
 		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 4/9 present: Also flush before using a flip to unflip

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

Not doing so might result in intermittently scanning out stale contents of the screen pixmap.

(Ported from radeon commit 9a951a3e551db58ba50e7a594521ceac54d90615)

---
 src/amdgpu_present.c | 1 +
 1 file changed, 1 insertion(+)
src/amdgpu_present.c +1 -0
index cf6e36b2f..4048f9844 100644
@@ -366,6 +366,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
 	event->event_id = event_id;
 	event->unflip = TRUE;
 
+	amdgpu_glamor_flush(scrn);
 	if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
 			       event_id, event, -1, amdgpu_present_flip_event,
 			       amdgpu_present_flip_abort, FLIP_VSYNC, 0))
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 5/9 present: Use async flip for unflip if possible

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

In that case, unflip operations should finish faster in general.

(Ported from radeon commit 0a4eb0e12f0c9c653cf4cea6fd62e1a507eb261c)

---
 src/amdgpu_present.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/amdgpu_present.c +6 -1
index 4048f9844..d381e15e0 100644
@@ -48,6 +48,8 @@
 
 #include "present.h"
 
+static present_screen_info_rec amdgpu_present_screen_info;
+
 struct amdgpu_present_vblank_event {
 	uint64_t event_id;
 	Bool unflip;
@@ -351,6 +353,9 @@ 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);
+	enum drmmode_flip_sync flip_sync =
+		(amdgpu_present_screen_info.capabilities & PresentCapabilityAsync) ?
+		FLIP_ASYNC : FLIP_VSYNC;
 	int old_fb_id;
 	int i;
 
@@ -369,7 +374,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
 	amdgpu_glamor_flush(scrn);
 	if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap,
 			       event_id, event, -1, amdgpu_present_flip_event,
-			       amdgpu_present_flip_abort, FLIP_VSYNC, 0))
+			       amdgpu_present_flip_abort, flip_sync, 0))
 		return;
 
 modeset:
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 6/9 present: Flush before flipping

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

This isn't necessary for DRI clients, but the Present extension can also be used for presenting normal pixmaps rendered to via the X11 protocol.

(Ported from radeon commit 9035b6abea557828e672ee455f0c84e43da0906f)

---
 src/amdgpu_present.c | 2 ++
 1 file changed, 2 insertions(+)
src/amdgpu_present.c +2 -0
index d381e15e0..3c4bc5259 100644
@@ -327,6 +327,8 @@ amdgpu_present_flip(RRCrtcPtr crtc, uint64_t event_id, uint64_t target_msc,
 
 	event->event_id = event_id;
 
+	amdgpu_glamor_flush(scrn);
+
 	ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT,
 				 pixmap, event_id, event, crtc_id,
 				 amdgpu_present_flip_event,
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#7 lore raw

PATCH 7/9 Call drmmode_set_desired_modes from a WindowExposures hook

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via AMDGPUUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo.

Fixes intermittently showing garbage on server startup or after server reset.

As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling AMDGPUBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = AMDGPUBlockHandler_KMS.

Bugzilla: https://bugs.freedesktop.org/99457
(Ported from radeon commit 0a12bf1085505017068dfdfd31d23133e51b45b9)

---
 src/amdgpu_drv.h |  1 +
 src/amdgpu_kms.c | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 12 deletions(-)
src/amdgpu_drv.h +1 -0
index 2aaafe438..ae5b6f94c 100644
@@ -230,6 +230,7 @@ typedef struct {
 
 	CreateScreenResourcesProcPtr CreateScreenResources;
 	CreateWindowProcPtr CreateWindow;
+	WindowExposuresProcPtr WindowExposures;
 
 	Bool IsSecondary;
 
src/amdgpu_kms.c +28 -12
index bafcb9bbb..3420fd89a 100644
@@ -1039,17 +1039,6 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 #endif
 }
 
-static void AMDGPUBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL)
-{
-	SCREEN_PTR(arg);
-	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
-
-	AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS);
-
-	drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
-}
-
 /* This is called by AMDGPUPreInit to set up the default visual */
 static Bool AMDGPUPreInitVisual(ScrnInfoPtr pScrn)
 {
@@ -1266,6 +1255,31 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin)
 	return ret;
 }
 
+/* When the root window is mapped, set the initial modes */
+static void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+					  , RegionPtr pBSRegion
+#endif
+	)
+{
+	ScreenPtr pScreen = pWin->drawable.pScreen;
+	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+
+	if (pWin != pScreen->root)
+		ErrorF("%s called for non-root window %p\n", __func__, pWin);
+
+	pScreen->WindowExposures = info->WindowExposures;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+	pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion);
+#else
+	pScreen->WindowExposures(pWin, pRegion);
+#endif
+
+	amdgpu_glamor_finish(pScrn);
+	drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
+}
+
 Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
 {
 	AMDGPUInfoPtr info;
@@ -1824,6 +1838,8 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 		info->CreateWindow = pScreen->CreateWindow;
 		pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
 	}
+	info->WindowExposures = pScreen->WindowExposures;
+	pScreen->WindowExposures = AMDGPUWindowExposures_oneshot;
 
 	/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
 	/* Wrap CloseScreen */
@@ -1831,7 +1847,7 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	pScreen->CloseScreen = AMDGPUCloseScreen_KMS;
 	pScreen->SaveScreen = AMDGPUSaveScreen_KMS;
 	info->BlockHandler = pScreen->BlockHandler;
-	pScreen->BlockHandler = AMDGPUBlockHandler_oneshot;
+	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
 	info->CreateScreenResources = pScreen->CreateScreenResources;
 	pScreen->CreateScreenResources = AMDGPUCreateScreenResources_KMS;
Signature · 6 lines
2.11.0

_______________________________________________
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): 20170303090745.2254-7-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#9 lore raw

PATCH v2 7/9 Call drmmode_set_desired_modes from a WindowExposures hook

From: Michel Dänzer <[email protected]>

This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via AMDGPUUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo.

Fixes intermittently showing garbage on server startup or after server reset.

As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling AMDGPUBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = AMDGPUBlockHandler_KMS.

Bugzilla: https://bugs.freedesktop.org/99457
(Ported from radeon commits 0a12bf1085505017068dfdfd31d23133e51b45b9 and f0e7948e1c0e984fc27f235f365639e9cf628291)

---

v2: Squash radeon commit f0e7948e1c0e984fc27f235f365639e9cf628291 to fix

    compile error against xserver < 1.16.99.901

Any volunteers for reviewing this series?

 src/amdgpu_drv.h |  1 +
 src/amdgpu_kms.c | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 12 deletions(-)
src/amdgpu_drv.h +1 -0
index 2aaafe438..ae5b6f94c 100644
@@ -230,6 +230,7 @@ typedef struct {
 
 	CreateScreenResourcesProcPtr CreateScreenResources;
 	CreateWindowProcPtr CreateWindow;
+	WindowExposuresProcPtr WindowExposures;
 
 	Bool IsSecondary;
 
src/amdgpu_kms.c +28 -12
index bafcb9bbb..ce1ae43a4 100644
@@ -1039,17 +1039,6 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 #endif
 }
 
-static void AMDGPUBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL)
-{
-	SCREEN_PTR(arg);
-	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
-
-	AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS);
-
-	drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
-}
-
 /* This is called by AMDGPUPreInit to set up the default visual */
 static Bool AMDGPUPreInitVisual(ScrnInfoPtr pScrn)
 {
@@ -1266,6 +1255,31 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin)
 	return ret;
 }
 
+/* When the root window is mapped, set the initial modes */
+static void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+					  , RegionPtr pBSRegion
+#endif
+	)
+{
+	ScreenPtr pScreen = pWin->drawable.pScreen;
+	ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+
+	if (pWin != pScreen->root)
+		ErrorF("%s called for non-root window %p\n", __func__, pWin);
+
+	pScreen->WindowExposures = info->WindowExposures;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+	pScreen->WindowExposures(pWin, pRegion, pBSRegion);
+#else
+	pScreen->WindowExposures(pWin, pRegion);
+#endif
+
+	amdgpu_glamor_finish(pScrn);
+	drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
+}
+
 Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
 {
 	AMDGPUInfoPtr info;
@@ -1824,6 +1838,8 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 		info->CreateWindow = pScreen->CreateWindow;
 		pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
 	}
+	info->WindowExposures = pScreen->WindowExposures;
+	pScreen->WindowExposures = AMDGPUWindowExposures_oneshot;
 
 	/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
 	/* Wrap CloseScreen */
@@ -1831,7 +1847,7 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	pScreen->CloseScreen = AMDGPUCloseScreen_KMS;
 	pScreen->SaveScreen = AMDGPUSaveScreen_KMS;
 	info->BlockHandler = pScreen->BlockHandler;
-	pScreen->BlockHandler = AMDGPUBlockHandler_oneshot;
+	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
 	info->CreateScreenResources = pScreen->CreateScreenResources;
 	pScreen->CreateScreenResources = AMDGPUCreateScreenResources_KMS;
Signature · 6 lines
2.11.0

_______________________________________________
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): 20170306014759.9030-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by
#11 lore raw

Re: [PATCH xf86-video-amdgpu v2 7/9] Call drmmode_set_desired_modes from a WindowExposures hook

Quoted 19 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via AMDGPUUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo.

Fixes intermittently showing garbage on server startup or after server reset.

As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling AMDGPUBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = AMDGPUBlockHandler_KMS.

Bugzilla: https://bugs.freedesktop.org/99457
(Ported from radeon commits 0a12bf1085505017068dfdfd31d23133e51b45b9 and f0e7948e1c0e984fc27f235f365639e9cf628291)

Quoted 7 lines

---

v2: Squash radeon commit f0e7948e1c0e984fc27f235f365639e9cf628291 to fix

    compile error against xserver < 1.16.99.901

Any volunteers for reviewing this series?

Series is:

Quoted 92 lines
 src/amdgpu_drv.h |  1 +
 src/amdgpu_kms.c | 40 ++++++++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 12 deletions(-)
src/amdgpu_drv.h +1 -0
index 2aaafe438..ae5b6f94c 100644
@@ -230,6 +230,7 @@ typedef struct {
 
        CreateScreenResourcesProcPtr CreateScreenResources;
        CreateWindowProcPtr CreateWindow;
+       WindowExposuresProcPtr WindowExposures;
 
        Bool IsSecondary;
 
src/amdgpu_kms.c +28 -13
index bafcb9bbb..ce1ae43a4 100644
@@ -1039,17 +1039,6 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 #endif
 }
 
-static void AMDGPUBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL)
-{
-       SCREEN_PTR(arg);
-       ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-       AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
-
-       AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS);
-
-       drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
-}
-
 /* This is called by AMDGPUPreInit to set up the default visual */
 static Bool AMDGPUPreInitVisual(ScrnInfoPtr pScrn)
 {
@@ -1266,6 +1255,31 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin)
        return ret;
 }
 
+/* When the root window is mapped, set the initial modes */
+static void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+                                         , RegionPtr pBSRegion
+#endif
+       )
+{
+       ScreenPtr pScreen = pWin->drawable.pScreen;
+       ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
+       AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+
+       if (pWin != pScreen->root)
+               ErrorF("%s called for non-root window %p\n", __func__, pWin);
+
+       pScreen->WindowExposures = info->WindowExposures;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+       pScreen->WindowExposures(pWin, pRegion, pBSRegion);
+#else
+       pScreen->WindowExposures(pWin, pRegion);
+#endif
+
+       amdgpu_glamor_finish(pScrn);
+       drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE);
+}
+
 Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
 {
        AMDGPUInfoPtr info;
@@ -1824,6 +1838,8 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
                info->CreateWindow = pScreen->CreateWindow;
                pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
        }
+       info->WindowExposures = pScreen->WindowExposures;
+       pScreen->WindowExposures = AMDGPUWindowExposures_oneshot;
 
        /* Provide SaveScreen & wrap BlockHandler and CloseScreen */
        /* Wrap CloseScreen */
@@ -1831,7 +1847,7 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
        pScreen->CloseScreen = AMDGPUCloseScreen_KMS;
        pScreen->SaveScreen = AMDGPUSaveScreen_KMS;
        info->BlockHandler = pScreen->BlockHandler;
-       pScreen->BlockHandler = AMDGPUBlockHandler_oneshot;
+       pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
        info->CreateScreenResources = pScreen->CreateScreenResources;
        pScreen->CreateScreenResources = AMDGPUCreateScreenResources_KMS;
--

2.11.0

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

#12 lore raw

PATCH 8/9 Move DPMS check from amdgpu_scanout_do_update to amdgpu_scanout_flip

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

When amdgpu_scanout_do_update is called from drmmode_crtc_scanout_update, drmmode_crtc->pending_dpms_mode may still be != DPMSModeOn, e.g. during server startup.

Fixes intermittently showing garbage with TearFree enabled.

(Ported from radeon commit cc9d6b7db9c2078be1e530a64af6d517c6a42024)

---
 src/amdgpu_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/amdgpu_kms.c +2 -2
index 3420fd89a..6fb051422 100644
@@ -787,7 +787,6 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
 	BoxRec extents;
 
 	if (!xf86_crtc->enabled ||
-	    drmmode_crtc->pending_dpms_mode != DPMSModeOn ||
 	    !drmmode_crtc->scanout[scanout_id].pixmap)
 		return FALSE;
 
@@ -970,7 +969,8 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
 	uintptr_t drm_queue_seq;
 	unsigned scanout_id;
 
-	if (drmmode_crtc->scanout_update_pending)
+	if (drmmode_crtc->scanout_update_pending ||
+	    drmmode_crtc->pending_dpms_mode != DPMSModeOn)
 		return;
 
 	scanout_id = drmmode_crtc->scanout_id ^ 1;
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#13 lore raw

PATCH 9/9 Don't call amdgpu_glamor_flush in drmmode_copy_fb

In reply to a message not in the archive

From: Michel Dänzer <[email protected]>

AMDGPUWindowExposures_oneshot takes care of it.

(Ported from radeon commit d63881623f0686a66a2e3e3c1f84e496aa52ec6b)

---
 src/drmmode_display.c | 2 --
 1 file changed, 2 deletions(-)
src/drmmode_display.c +0 -2
index 406b5eed6..2cdea90ad 100644
@@ -429,8 +429,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 
 	FreeScratchGC(gc);
 
-	amdgpu_glamor_finish(pScrn);
-
 	pScreen->canDoBGNoneRoot = TRUE;
 
 	if (info->fbcon_pixmap)
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx