Commit 49fc2cfc authored by Tomohito Esaki's avatar Tomohito Esaki Committed by Daniel Stone

backend-drm: make linear modifier to default

Make the linear modifier to the default of DRM format modifiers if
supported modifiers isn't get from kernel driver.
parent 5d7877ad
Pipeline #45412 failed with stages
in 1 minute and 24 seconds
......@@ -399,6 +399,12 @@ drm_plane_populate_formats(struct drm_plane *plane, const drmModePlane *kplane,
modifiers[count_modifiers++] = mod->modifier;
}
if (count_modifiers == 0) {
modifiers = malloc(sizeof(*modifiers));
*modifiers = DRM_FORMAT_MOD_LINEAR;
count_modifiers = 1;
}
plane->formats[i].format = blob_formats[i];
plane->formats[i].modifiers = modifiers;
plane->formats[i].count_modifiers = count_modifiers;
......@@ -412,8 +418,12 @@ fallback:
#endif
/* No IN_FORMATS blob available, so just use the old. */
assert(plane->count_formats == kplane->count_formats);
for (i = 0; i < kplane->count_formats; i++)
for (i = 0; i < kplane->count_formats; i++) {
plane->formats[i].format = kplane->formats[i];
plane->formats[i].modifiers = malloc(sizeof(uint64_t));
plane->formats[i].modifiers[0] = DRM_FORMAT_MOD_LINEAR;
plane->formats[i].count_modifiers = 1;
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment