egl: introduce DMA_BUF_MAX_PLANES
[mesa.git] / src / egl / drivers / dri2 / egl_dri2.c
index 80d366d244a3c3a5a04e2f2598d374d8ba3c90fc..a2c9e417cc0afc4a9b95d41e656fd42377aaf916 100644 (file)
@@ -2092,7 +2092,7 @@ dri2_check_dma_buf_format(const _EGLImageAttribs *attrs)
     *  generated if any of the EGL_DMA_BUF_PLANE1_* or EGL_DMA_BUF_PLANE2_*
     *  attributes are specified."
     */
-   for (i = plane_n; i < 3; ++i) {
+   for (i = plane_n; i < DMA_BUF_MAX_PLANES; ++i) {
       if (attrs->DMABufPlaneFds[i].IsPresent ||
           attrs->DMABufPlaneOffsets[i].IsPresent ||
           attrs->DMABufPlanePitches[i].IsPresent) {
@@ -2125,9 +2125,9 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
    __DRIimage *dri_image;
    unsigned num_fds;
    unsigned i;
-   int fds[3];
-   int pitches[3];
-   int offsets[3];
+   int fds[DMA_BUF_MAX_PLANES];
+   int pitches[DMA_BUF_MAX_PLANES];
+   int offsets[DMA_BUF_MAX_PLANES];
    unsigned error;
 
    /**