summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2020-05-04 20:46:47 +0200
committerAnton Kindestam <antonki@kth.se>2020-05-08 21:26:25 +0200
commit6c04eb0508e1e30fc3b5b486363e9722f461296c (patch)
tree9f6058a8b48cae05d82524e241501bbbd4c50be7 /video/out
parentc0bc8bf5d3d567c72abf4b8a5d2732fc9e14144c (diff)
downloadmpv-6c04eb0508e1e30fc3b5b486363e9722f461296c.tar.bz2
mpv-6c04eb0508e1e30fc3b5b486363e9722f461296c.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/drm_prime.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/video/out/drm_prime.c b/video/out/drm_prime.c
index 46971d35b8..1cfaa1a1d3 100644
--- a/video/out/drm_prime.c
+++ b/video/out/drm_prime.c
@@ -32,8 +32,10 @@ int drm_prime_create_framebuffer(struct mp_log *log, int fd,
struct drm_prime_handle_refs *handle_refs)
{
AVDRMLayerDescriptor *layer = NULL;
- uint32_t pitches[4], offsets[4], handles[4];
- uint64_t modifiers[4];
+ uint32_t pitches[4] = { 0 };
+ uint32_t offsets[4] = { 0 };
+ uint32_t handles[4] = { 0 };
+ uint64_t modifiers[4] = { 0 };
int ret, layer_fd;
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);
goto fail;
}
- if (object == 0) {
- modifiers[object] = descriptor->objects[object].format_modifier;
- }
+ modifiers[object] = descriptor->objects[object].format_modifier;
}
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;
offsets[plane] = layer->planes[plane].offset;
handles[plane] = layer_fd;
- modifiers[plane] = modifiers[0];
} else {
pitches[plane] = 0;
offsets[plane] = 0;