drm_prime: get the modifier for all planes

Untested (I don't have a platform that requires modifiers to work
here). Might break something, or might fix something. At least this
looks more intuitive to me.
This commit is contained in:
Anton Kindestam 2020-05-04 20:46:47 +02:00
parent c0bc8bf5d3
commit 6c04eb0508
1 changed files with 5 additions and 6 deletions

View File

@ -32,8 +32,10 @@ int drm_prime_create_framebuffer(struct mp_log *log, int fd,
struct drm_prime_handle_refs *handle_refs) struct drm_prime_handle_refs *handle_refs)
{ {
AVDRMLayerDescriptor *layer = NULL; AVDRMLayerDescriptor *layer = NULL;
uint32_t pitches[4], offsets[4], handles[4]; uint32_t pitches[4] = { 0 };
uint64_t modifiers[4]; uint32_t offsets[4] = { 0 };
uint32_t handles[4] = { 0 };
uint64_t modifiers[4] = { 0 };
int ret, layer_fd; int ret, layer_fd;
if (descriptor && descriptor->nb_layers) { if (descriptor && descriptor->nb_layers) {
@ -47,9 +49,7 @@ int drm_prime_create_framebuffer(struct mp_log *log, int fd,
object, descriptor->objects[object].fd); object, descriptor->objects[object].fd);
goto fail; goto fail;
} }
if (object == 0) { modifiers[object] = descriptor->objects[object].format_modifier;
modifiers[object] = descriptor->objects[object].format_modifier;
}
} }
layer = &descriptor->layers[0]; layer = &descriptor->layers[0];
@ -60,7 +60,6 @@ int drm_prime_create_framebuffer(struct mp_log *log, int fd,
pitches[plane] = layer->planes[plane].pitch; pitches[plane] = layer->planes[plane].pitch;
offsets[plane] = layer->planes[plane].offset; offsets[plane] = layer->planes[plane].offset;
handles[plane] = layer_fd; handles[plane] = layer_fd;
modifiers[plane] = modifiers[0];
} else { } else {
pitches[plane] = 0; pitches[plane] = 0;
offsets[plane] = 0; offsets[plane] = 0;