[PATCH xserver] modesetting: Fix page flipping harder under DRI 3.2.
Mario Kleiner
mario.kleiner.de at gmail.com
Wed Apr 4 01:49:02 UTC 2018
Non-atomic kms drivers like radeon-kms (or nouveau-kms with
default setting of "atomic ioctl disabled") don't export
any formats, so num_formats == 0.
Some atomic drivers (nouveau-kms with boot param nouveau.atomic=1,
or intel-kms on, e.g., Linux 4.13) expose num_formats == 0, or
don't expose any modifiers, so num_modifiers == 0.
Let the drmmode_is_format_supported() check pass in these cases
to allow page flipping, as it works just fine.
Tested on NV-96 for nouveau, HD-5770 for radeon, Intel Ivybridge
with Linux 4.13 and drm-next to fix page flipping.
Fixes: 9d147305b404 ("modesetting: Check if buffer format is supported when flipping")
Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index cb0ee7c..b12faa9 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -100,13 +100,17 @@ drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t modifier
if (!crtc->enabled)
continue;
+ if (drmmode_crtc->num_formats == 0)
+ continue;
+
for (i = 0; i < drmmode_crtc->num_formats; i++) {
drmmode_format_ptr iter = &drmmode_crtc->formats[i];
if (iter->format != format)
continue;
- if (modifier == DRM_FORMAT_MOD_INVALID) {
+ if (modifier == DRM_FORMAT_MOD_INVALID ||
+ iter->num_modifiers == 0) {
found = TRUE;
break;
}
--
2.7.4
More information about the xorg-devel
mailing list