drm-buffer-gbm: Avoid using fixed size for number of planes
(cherry picked from commit c4c4b387536d1d2cf26ea1985a1090df43c7c59d) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027> Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
parent
e0b7afe8fa
commit
09c8a4c8a3
1 changed files with 9 additions and 4 deletions
|
@ -248,10 +248,10 @@ meta_drm_buffer_gbm_create_native_blit_image (MetaEgl *egl,
|
|||
unsigned int width;
|
||||
unsigned int height;
|
||||
uint32_t i, n_planes;
|
||||
uint32_t strides[4] = { 0 };
|
||||
uint32_t offsets[4] = { 0 };
|
||||
uint64_t modifiers[4] = { 0 };
|
||||
int fds[4] = { -1, -1, -1, -1 };
|
||||
uint32_t *strides;
|
||||
uint32_t *offsets;
|
||||
uint64_t *modifiers;
|
||||
int *fds;
|
||||
uint32_t format;
|
||||
EGLImageKHR egl_image;
|
||||
gboolean use_modifiers;
|
||||
|
@ -269,6 +269,11 @@ meta_drm_buffer_gbm_create_native_blit_image (MetaEgl *egl,
|
|||
format = gbm_bo_get_format (shared_bo);
|
||||
|
||||
n_planes = gbm_bo_get_plane_count (shared_bo);
|
||||
fds = g_alloca (sizeof (int) * n_planes);
|
||||
strides = g_alloca (sizeof (uint32_t) * n_planes);
|
||||
offsets = g_alloca (sizeof (uint32_t) * n_planes);
|
||||
modifiers = g_alloca (sizeof (uint64_t) * n_planes);
|
||||
|
||||
for (i = 0; i < n_planes; i++)
|
||||
{
|
||||
strides[i] = gbm_bo_get_stride_for_plane (shared_bo, i);
|
||||
|
|
Loading…
Reference in a new issue