[PATCH xf86-video-amdgpu 1/2] Use drmmode_crtc->scanout_id instead of 0 to check for scanout buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Preparation for following change, no functional change intended.

(Ported from radeon commit aff267ee36cc6a703a532f91f82adc1ba1425ff3)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_dri2.c    | 5 +++--
 src/amdgpu_kms.c     | 4 ++--
 src/amdgpu_present.c | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
index 8dde2930c..a854ce50b 100644
--- a/src/amdgpu_dri2.c
+++ b/src/amdgpu_dri2.c
@@ -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)
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index b625250fd..cc64eb5b7 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -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;
 
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index 86b095cd1..cf11d2b7a 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -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)
-- 
2.13.2



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux