From cf3bf0ec6568b8cabb7b15d8e8faf7dfbffd0536 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 10 Jun 2016 03:55:57 +0000 Subject: [PATCH] simplify whitelist/greylist/blacklist code and whitelist intel skylake (which seems to work fine here), other intel chipsets are still greylisted only git-svn-id: https://xpra.org/svn/Xpra/trunk@12773 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/client/gl/gl_check.py | 51 ++++++++++++++++------------------ 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/src/xpra/client/gl/gl_check.py b/src/xpra/client/gl/gl_check.py index 0bcf46fe1e..12e8ef586b 100755 --- a/src/xpra/client/gl/gl_check.py +++ b/src/xpra/client/gl/gl_check.py @@ -13,17 +13,20 @@ required_extensions = ["GL_ARB_texture_rectangle", "GL_ARB_vertex_program"] -WHITELIST = {} -GREYLIST = {} -VERSION_REQ = {"nouveau" : [3, 0], #older versions have issues +WHITELIST = { + "renderer" : ["Skylake"] + } +GREYLIST = { + "vendor" : ["Intel"] + } +VERSION_REQ = { + "nouveau" : [3, 0], #older versions have issues } -BLACKLIST = {"vendor" : ["Humper", "VMware, Inc."], - "renderer" : ["Software Rasterizer"]} +BLACKLIST = { + "vendor" : ["Humper", "VMware, Inc."], + "renderer" : ["Software Rasterizer"] + } -#the Intel driver causes too many problems: -GREYLIST.setdefault("vendor", []).append("Intel") -GREYLIST.setdefault("vendor", []).append("Intel Inc.") -GREYLIST.setdefault("vendor", []).append("Intel Open Source Technology Center") from xpra.os_util import getUbuntuVersion uv = getUbuntuVersion() if uv and uv<[15]: @@ -280,24 +283,18 @@ def fixstring(v): log("%s: %s", d, v) props[d] = v - blacklisted = None - whitelisted = None - greylisted = None - for k,vlist in BLACKLIST.items(): - v = props.get(k) - if v in vlist: - log("%s '%s' found in blacklist: %s", k, v, vlist) - blacklisted = k, v - for k,vlist in GREYLIST.items(): - v = props.get(k) - if v in vlist: - log("%s '%s' found in greylist: %s", k, v, vlist) - greylisted = k, v - for k,vlist in WHITELIST.items(): - v = props.get(k) - if v in vlist: - log("%s '%s' found in whitelist: %s", k, v, vlist) - whitelisted = k, v + def match_list(thelist, listname): + for k,vlist in thelist.items(): + v = props.get(k) + matches = [x for x in vlist if v.find(x)>=0] + if matches: + log("%s '%s' found in %s: %s", k, v, listname, vlist) + return (k, v) + log("%s '%s' not found in %s: %s", k, v, listname, vlist) + return None + blacklisted = match_list(BLACKLIST, "blacklist") + whitelisted = match_list(GREYLIST, "greylist") + greylisted = match_list(WHITELIST, "whitelist") if blacklisted: if whitelisted: log.info("%s '%s' enabled (found in both blacklist and whitelist)", *whitelisted)