struct gbm_dri_device *dri = gbm_dri_device(gbm);
struct gbm_dri_bo *bo;
int dri_format;
- unsigned dri_use = 0;
+ unsigned dri_use = 0, i;
+ bool has_valid_modifier;
/* Callers of this may specify a modifier, or a dri usage, but not both. The
* newer modifier interface deprecates the older usage flags.
* the check here is a convenient debug check likely pointing at whatever
* interface the client is using to build its modifier list.
*/
- if (count == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) {
+ has_valid_modifier = false;
+ for (i = 0; i < count; i++) {
+ if (modifiers[i] != DRM_FORMAT_MOD_INVALID) {
+ has_valid_modifier = true;
+ break;
+ }
+ }
+ if (!has_valid_modifier) {
fprintf(stderr, "Only invalid modifier specified\n");
errno = EINVAL;
goto failed;