|
@@ -561,19 +561,20 @@ int drm_plane_check_pixel_format(struct drm_plane *plane,
|
|
if (i == plane->format_count)
|
|
if (i == plane->format_count)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- if (!plane->modifier_count)
|
|
|
|
- return 0;
|
|
|
|
|
|
+ if (plane->funcs->format_mod_supported) {
|
|
|
|
+ if (!plane->funcs->format_mod_supported(plane, format, modifier))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ } else {
|
|
|
|
+ if (!plane->modifier_count)
|
|
|
|
+ return 0;
|
|
|
|
|
|
- for (i = 0; i < plane->modifier_count; i++) {
|
|
|
|
- if (modifier == plane->modifiers[i])
|
|
|
|
- break;
|
|
|
|
|
|
+ for (i = 0; i < plane->modifier_count; i++) {
|
|
|
|
+ if (modifier == plane->modifiers[i])
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (i == plane->modifier_count)
|
|
|
|
+ return -EINVAL;
|
|
}
|
|
}
|
|
- if (i == plane->modifier_count)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
- if (plane->funcs->format_mod_supported &&
|
|
|
|
- !plane->funcs->format_mod_supported(plane, format, modifier))
|
|
|
|
- return -EINVAL;
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|