[PATCH xserver] dri3: Don't call vfuncs on old DRI3 screens

Daniel Stone daniels at collabora.com
Tue Apr 24 20:27:47 UTC 2018


Only call the get_supported_modifiers vfunc if the DRI3 screen struct is
sufficiently new.

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 dri3/dri3_screen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index 23e33f401..a1d6f47dd 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -171,7 +171,7 @@ cache_formats_and_modifiers(ScreenPtr screen)
     if (!info)
         return BadImplementation;
 
-    if (!info->get_formats || !info->get_modifiers) {
+    if (info->version < 2 || !info->get_formats || !info->get_modifiers) {
         ds->formats = NULL;
         ds->num_formats = 0;
         ds->formats_cached = TRUE;
-- 
2.17.0



More information about the xorg-devel mailing list