@@ -77,18 +77,12 @@ modifiers_ptr(struct drm_format_modifier_blob *blob)
static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane)
{
const struct drm_mode_config *config = &dev->mode_config;
- const uint64_t *temp_modifiers = plane->modifiers;
- unsigned int format_modifier_count = 0;
struct drm_property_blob *blob = NULL;
struct drm_format_modifier *mod;
size_t blob_size = 0, formats_size, modifiers_size;
struct drm_format_modifier_blob *blob_data;
int i, j, ret = 0;
- if (plane->modifiers)
- while (*temp_modifiers++ != DRM_FORMAT_MOD_INVALID)
- format_modifier_count++;
-
formats_size = sizeof(*plane->format_types) * plane->format_count;
if (WARN_ON(!formats_size)) {
/* 0 formats are never expected */
@@ -96,7 +90,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
}
modifiers_size =
- sizeof(struct drm_format_modifier) * format_modifier_count;
+ sizeof(struct drm_format_modifier) * plane->modifier_count;
blob_size = sizeof(struct drm_format_modifier_blob);
blob_size += ALIGN(formats_size, 8);
@@ -110,7 +104,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
blob_data->version = FORMAT_BLOB_CURRENT;
blob_data->count_formats = plane->format_count;
blob_data->formats_offset = sizeof(struct drm_format_modifier_blob);
- blob_data->count_modifiers = format_modifier_count;
+ blob_data->count_modifiers = plane->modifier_count;
/* Modifiers offset is a pointer to a struct with a 64 bit field so it
* should be naturally aligned to 8B.
@@ -125,7 +119,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
goto done;
mod = modifiers_ptr(blob_data);
- for (i = 0; i < format_modifier_count; i++) {
+ for (i = 0; i < plane->modifier_count; i++) {
for (j = 0; j < plane->format_count; j++) {
if (plane->funcs->format_mod_supported(plane,
plane->format_types[j],