mirror of https://github.com/mpv-player/mpv
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:
parent
c0bc8bf5d3
commit
6c04eb0508
|
@ -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,10 +49,8 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue