xf86-video-amdgpu: Branch 'master' - 3 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Mar 4 18:10:58 UTC 2019
src/amdgpu_dri2.h | 1 +
src/amdgpu_kms.c | 6 ++++++
src/amdgpu_present.c | 16 +++++++++++-----
src/drmmode_display.c | 8 --------
src/drmmode_display.h | 9 +++++++++
5 files changed, 27 insertions(+), 13 deletions(-)
New commits:
commit a2b32e72fdaff3007a79b84929997d8176c2d512
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri Mar 1 17:42:08 2019 +0100
present: Don't check tiling parameters with DC & DRM minor version >= 31
Current DC handles any changes of tiling parameters for flips.
v2:
* Just check all tiling bits if DRM minor < 31 or DC is disabled.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index ce88bd8..fdedd32 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -278,12 +278,18 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
return FALSE;
#endif
- /* The kernel driver doesn't handle flipping between BOs with different
- * tiling parameters correctly yet
+ /* Only DC supports advanced color management features, so we can use
+ * drmmode_cm_enabled as a proxy for "Is DC enabled?"
*/
- if (amdgpu_pixmap_get_tiling_info(pixmap) !=
- amdgpu_pixmap_get_tiling_info(screen_pixmap))
- return FALSE;
+ if (info->dri2.pKernelDRMVersion->version_minor < 31 ||
+ !drmmode_cm_enabled(&info->drmmode)) {
+ /* The kernel driver doesn't handle flipping between BOs with
+ * different tiling parameters correctly
+ */
+ if (amdgpu_pixmap_get_tiling_info(pixmap) !=
+ amdgpu_pixmap_get_tiling_info(screen_pixmap))
+ return FALSE;
+ }
for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) {
if (drmmode_crtc_can_flip(config->crtc[i]))
commit 2798244be78df3ef3a7841597577506bfbe50156
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri Mar 1 17:47:24 2019 +0100
Make drmmode_cm_enabled an inline function
So that it can be used outside of drmmode_display.c as well.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 859c01e..b44a4f4 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -827,14 +827,6 @@ static enum drmmode_cm_prop get_cm_enum_from_str(const char *prop_name)
}
/**
- * Return TRUE if kernel supports non-legacy color management.
- */
-static Bool drmmode_cm_enabled(drmmode_ptr drmmode)
-{
- return drmmode->cm_prop_ids[CM_GAMMA_LUT_SIZE] != 0;
-}
-
-/**
* If legacy LUT is a, and non-legacy LUT is b, then the result of b(a(x)) is
* returned in out_lut. out_lut's length is expected to be the same as the
* non-legacy LUT b.
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 5063df9..154a1e1 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -182,6 +182,15 @@ enum drmmode_flip_sync {
};
+/**
+ * Return TRUE if kernel supports non-legacy color management.
+ */
+static inline Bool
+drmmode_cm_enabled(drmmode_ptr drmmode)
+{
+ return drmmode->cm_prop_ids[CM_GAMMA_LUT_SIZE] != 0;
+}
+
/* Can the page flip ioctl be used for this CRTC? */
static inline Bool
drmmode_crtc_can_flip(xf86CrtcPtr crtc)
commit 72653455e4f652ca6c7c290c7f1e8a889b77f5ce
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri Mar 1 17:35:48 2019 +0100
Revert "Remove set but unused amdgpu_dri2::pKernelDRMVersion"
This reverts commit 720a61000aeb139005bd8125908cec66a6e69554.
We're going to make use of it now.
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
diff --git a/src/amdgpu_dri2.h b/src/amdgpu_dri2.h
index a345e6b..c6a2ab6 100644
--- a/src/amdgpu_dri2.h
+++ b/src/amdgpu_dri2.h
@@ -30,6 +30,7 @@
#include <xorg-server.h>
struct amdgpu_dri2 {
+ drmVersionPtr pKernelDRMVersion;
Bool available;
Bool enabled;
char *device_name;
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 458d2d0..74d5806 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1595,6 +1595,12 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info->dri2.available = FALSE;
info->dri2.enabled = FALSE;
+ info->dri2.pKernelDRMVersion = drmGetVersion(pAMDGPUEnt->fd);
+ if (info->dri2.pKernelDRMVersion == NULL) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "AMDGPUDRIGetVersion failed to get the DRM version\n");
+ return FALSE;
+ }
/* Get ScreenInit function */
if (!xf86LoadSubModule(pScrn, "fb"))
More information about the xorg-commit
mailing list