meta/egl-gbm: Avoid using fixed size for number of planes
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4027>
This commit is contained in:
parent
507409f5d0
commit
ca7345588f
@ -46,10 +46,10 @@ create_gbm_bo_egl_image (MetaEgl *egl,
|
|||||||
unsigned int width;
|
unsigned int width;
|
||||||
unsigned int height;
|
unsigned int height;
|
||||||
uint32_t i, n_planes;
|
uint32_t i, n_planes;
|
||||||
uint32_t strides[4] = { 0 };
|
uint32_t *strides;
|
||||||
uint32_t offsets[4] = { 0 };
|
uint32_t *offsets;
|
||||||
uint64_t modifiers[4] = { 0 };
|
uint64_t *modifiers;
|
||||||
int fds[4] = { -1, -1, -1, -1 };
|
int *fds;
|
||||||
uint32_t format;
|
uint32_t format;
|
||||||
EGLImageKHR egl_image;
|
EGLImageKHR egl_image;
|
||||||
gboolean use_modifiers;
|
gboolean use_modifiers;
|
||||||
@ -67,6 +67,11 @@ create_gbm_bo_egl_image (MetaEgl *egl,
|
|||||||
format = gbm_bo_get_format (shared_bo);
|
format = gbm_bo_get_format (shared_bo);
|
||||||
|
|
||||||
n_planes = gbm_bo_get_plane_count (shared_bo);
|
n_planes = gbm_bo_get_plane_count (shared_bo);
|
||||||
|
fds = g_alloca (sizeof (*fds) * n_planes);
|
||||||
|
strides = g_alloca (sizeof (*strides) * n_planes);
|
||||||
|
offsets = g_alloca (sizeof (*offsets) * n_planes);
|
||||||
|
modifiers = g_alloca (sizeof (*modifiers) * n_planes);
|
||||||
|
|
||||||
for (i = 0; i < n_planes; i++)
|
for (i = 0; i < n_planes; i++)
|
||||||
{
|
{
|
||||||
strides[i] = gbm_bo_get_stride_for_plane (shared_bo, i);
|
strides[i] = gbm_bo_get_stride_for_plane (shared_bo, i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user