diff options
author | Jason Ekstrand <[email protected]> | 2017-07-16 16:54:44 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-17 13:48:38 -0700 |
commit | 7947d05f840cfbb9b162a279d6eccc9416217e68 (patch) | |
tree | 0f030fe4ba2891eea162e43a81117d827d4a7c45 | |
parent | ec4364d57ec2990e9cc81bb5a932bc115d3e6c44 (diff) |
i965: Check if the modifier is supported in select_best_modifier
Otherwise, if a client gave us a list of modifiers that contained a
modifier we understand but which is not supported on the hardware, we
might return that one and then fail to create the image.
Reviewed-by: Daniel Stone <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 0c1a88d36f3..7ccc1d34f0d 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -586,6 +586,9 @@ select_best_modifier(struct gen_device_info *devinfo, enum modifier_priority prio = MODIFIER_PRIORITY_INVALID; for (int i = 0; i < count; i++) { + if (!modifier_is_supported(devinfo, modifiers[i])) + continue; + switch (modifiers[i]) { case I915_FORMAT_MOD_Y_TILED: prio = MAX2(prio, MODIFIER_PRIORITY_Y); |