Skip to contentSkip to conversation

Don't call scanout_flip/update with a legacy RandR scanout buffer

PATCH In review Michel Dänzer 2 participants 4 messages Apr 24, 2018 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Don't call scanout_flip/update with a legacy RandR scanout buffer

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

It means we are not using our own scanout buffers.

Fixes crash when TearFree is supposed to be enabled, but drmmode_handle_transform doesn't set crtc->driverIsPerformingTransform.

Bugzilla: https://bugs.freedesktop.org/105736

---
 src/amdgpu_kms.c | 3 +++
 1 file changed, 3 insertions(+)
src/amdgpu_kms.c +3 -0
index c86c78706..5ea90f90c 100644
@@ -1055,6 +1055,9 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 			xf86CrtcPtr crtc = xf86_config->crtc[c];
 			drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
+			if (drmmode_crtc->rotate.pixmap)
+				continue;
+
 			if (drmmode_crtc->tear_free)
 				amdgpu_scanout_flip(pScreen, info, crtc);
 			else if (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
Signature · 6 lines
2.17.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): 20180424100747.6386-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/2 Simplify drmmode_handle_transform

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

Set crtc->driverIsPerformingTransform for any case we can handle before calling xf86CrtcRotate. We already clear it afterwards when the latter clears crtc->transform_in_use.

This should allow our separate scanout buffer mechanism to be used in more cases.

---
 src/drmmode_display.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
src/drmmode_display.c +1 -5
index 240e88b90..536890d18 100644
@@ -631,13 +631,9 @@ drmmode_handle_transform(xf86CrtcPtr crtc)
 	Bool ret;
 
 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
-	if (crtc->transformPresent || crtc->rotation != RR_Rotate_0)
-	    crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
-	else
-	    crtc->driverIsPerformingTransform = XF86DriverTransformNone;
+	crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
 #else
 	crtc->driverIsPerformingTransform = !crtc->transformPresent &&
-		crtc->rotation != RR_Rotate_0 &&
 		(crtc->rotation & 0xf) == RR_Rotate_0;
 #endif
 
Signature · 6 lines
2.17.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): 20180424100747.6386-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Acked-by
#4 lore raw

Re: [PATCH xf86-video-amdgpu 2/2] Simplify drmmode_handle_transform

Quoted 10 lines · Michel Dänzer

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

Set crtc->driverIsPerformingTransform for any case we can handle before calling xf86CrtcRotate. We already clear it afterwards when the latter clears crtc->transform_in_use.

This should allow our separate scanout buffer mechanism to be used in more cases.

Quoted 26 lines
---
 src/drmmode_display.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
src/drmmode_display.c +1 -6
index 240e88b90..536890d18 100644
@@ -631,13 +631,9 @@ drmmode_handle_transform(xf86CrtcPtr crtc)
        Bool ret;
 
 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
-       if (crtc->transformPresent || crtc->rotation != RR_Rotate_0)
-           crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
-       else
-           crtc->driverIsPerformingTransform = XF86DriverTransformNone;
+       crtc->driverIsPerformingTransform = XF86DriverTransformOutput;
 #else
        crtc->driverIsPerformingTransform = !crtc->transformPresent &&
-               crtc->rotation != RR_Rotate_0 &&
                (crtc->rotation & 0xf) == RR_Rotate_0;
 #endif
 
--

2.17.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

Reviewed-by
#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Michel Dänzer

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

It means we are not using our own scanout buffers.

Fixes crash when TearFree is supposed to be enabled, but drmmode_handle_transform doesn't set crtc->driverIsPerformingTransform.

Bugzilla: https://bugs.freedesktop.org/105736

Quoted 21 lines
---
 src/amdgpu_kms.c | 3 +++
 1 file changed, 3 insertions(+)
src/amdgpu_kms.c +3 -1
index c86c78706..5ea90f90c 100644
@@ -1055,6 +1055,9 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
                        xf86CrtcPtr crtc = xf86_config->crtc[c];
                        drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 
+                       if (drmmode_crtc->rotate.pixmap)
+                               continue;
+
                        if (drmmode_crtc->tear_free)
                                amdgpu_scanout_flip(pScreen, info, crtc);
                        else if (drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap)
--

2.17.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