mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
egl: split _eglParseImageAttribList into per extension functions
Will allow us to simplify existing code and make further improvements short and simple. No functional change intended. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
81e95924ea
commit
3ee2be4113
1 changed files with 256 additions and 182 deletions
|
|
@ -34,6 +34,245 @@
|
||||||
#include "eglimage.h"
|
#include "eglimage.h"
|
||||||
#include "egllog.h"
|
#include "egllog.h"
|
||||||
|
|
||||||
|
static EGLint
|
||||||
|
_eglParseKHRImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
|
EGLint attr, EGLint val)
|
||||||
|
{
|
||||||
|
switch (attr) {
|
||||||
|
/* EGL_KHR_image_base */
|
||||||
|
case EGL_IMAGE_PRESERVED_KHR:
|
||||||
|
attrs->ImagePreserved = val;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* EGL_KHR_gl_image */
|
||||||
|
case EGL_GL_TEXTURE_LEVEL_KHR:
|
||||||
|
attrs->GLTextureLevel = val;
|
||||||
|
break;
|
||||||
|
case EGL_GL_TEXTURE_ZOFFSET_KHR:
|
||||||
|
attrs->GLTextureZOffset = val;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return EGL_BAD_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EGL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static EGLint
|
||||||
|
_eglParseMESADrmImageAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
|
EGLint attr, EGLint val)
|
||||||
|
{
|
||||||
|
switch (attr) {
|
||||||
|
/* EGL_MESA_drm_image */
|
||||||
|
case EGL_WIDTH:
|
||||||
|
attrs->Width = val;
|
||||||
|
break;
|
||||||
|
case EGL_HEIGHT:
|
||||||
|
attrs->Height = val;
|
||||||
|
break;
|
||||||
|
case EGL_DRM_BUFFER_FORMAT_MESA:
|
||||||
|
attrs->DRMBufferFormatMESA = val;
|
||||||
|
break;
|
||||||
|
case EGL_DRM_BUFFER_USE_MESA:
|
||||||
|
attrs->DRMBufferUseMESA = val;
|
||||||
|
break;
|
||||||
|
case EGL_DRM_BUFFER_STRIDE_MESA:
|
||||||
|
attrs->DRMBufferStrideMESA = val;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return EGL_BAD_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EGL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static EGLint
|
||||||
|
_eglParseWLBindWaylandDisplayAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
|
EGLint attr, EGLint val)
|
||||||
|
{
|
||||||
|
switch (attr) {
|
||||||
|
/* EGL_WL_bind_wayland_display */
|
||||||
|
case EGL_WAYLAND_PLANE_WL:
|
||||||
|
attrs->PlaneWL = val;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return EGL_BAD_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EGL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static EGLint
|
||||||
|
_eglParseEXTImageDmaBufImportAttribs(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
|
EGLint attr, EGLint val)
|
||||||
|
{
|
||||||
|
EGLint err = EGL_SUCCESS;
|
||||||
|
|
||||||
|
switch (attr) {
|
||||||
|
case EGL_LINUX_DRM_FOURCC_EXT:
|
||||||
|
attrs->DMABufFourCC.Value = val;
|
||||||
|
attrs->DMABufFourCC.IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE0_FD_EXT:
|
||||||
|
attrs->DMABufPlaneFds[0].Value = val;
|
||||||
|
attrs->DMABufPlaneFds[0].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE0_OFFSET_EXT:
|
||||||
|
attrs->DMABufPlaneOffsets[0].Value = val;
|
||||||
|
attrs->DMABufPlaneOffsets[0].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE0_PITCH_EXT:
|
||||||
|
attrs->DMABufPlanePitches[0].Value = val;
|
||||||
|
attrs->DMABufPlanePitches[0].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE1_FD_EXT:
|
||||||
|
attrs->DMABufPlaneFds[1].Value = val;
|
||||||
|
attrs->DMABufPlaneFds[1].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE1_OFFSET_EXT:
|
||||||
|
attrs->DMABufPlaneOffsets[1].Value = val;
|
||||||
|
attrs->DMABufPlaneOffsets[1].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE1_PITCH_EXT:
|
||||||
|
attrs->DMABufPlanePitches[1].Value = val;
|
||||||
|
attrs->DMABufPlanePitches[1].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE2_FD_EXT:
|
||||||
|
attrs->DMABufPlaneFds[2].Value = val;
|
||||||
|
attrs->DMABufPlaneFds[2].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE2_OFFSET_EXT:
|
||||||
|
attrs->DMABufPlaneOffsets[2].Value = val;
|
||||||
|
attrs->DMABufPlaneOffsets[2].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE2_PITCH_EXT:
|
||||||
|
attrs->DMABufPlanePitches[2].Value = val;
|
||||||
|
attrs->DMABufPlanePitches[2].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_YUV_COLOR_SPACE_HINT_EXT:
|
||||||
|
if (val != EGL_ITU_REC601_EXT && val != EGL_ITU_REC709_EXT &&
|
||||||
|
val != EGL_ITU_REC2020_EXT) {
|
||||||
|
err = EGL_BAD_ATTRIBUTE;
|
||||||
|
} else {
|
||||||
|
attrs->DMABufYuvColorSpaceHint.Value = val;
|
||||||
|
attrs->DMABufYuvColorSpaceHint.IsPresent = EGL_TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EGL_SAMPLE_RANGE_HINT_EXT:
|
||||||
|
if (val != EGL_YUV_FULL_RANGE_EXT && val != EGL_YUV_NARROW_RANGE_EXT) {
|
||||||
|
err = EGL_BAD_ATTRIBUTE;
|
||||||
|
} else {
|
||||||
|
attrs->DMABufSampleRangeHint.Value = val;
|
||||||
|
attrs->DMABufSampleRangeHint.IsPresent = EGL_TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT:
|
||||||
|
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
|
||||||
|
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
|
||||||
|
err = EGL_BAD_ATTRIBUTE;
|
||||||
|
} else {
|
||||||
|
attrs->DMABufChromaHorizontalSiting.Value = val;
|
||||||
|
attrs->DMABufChromaHorizontalSiting.IsPresent = EGL_TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT:
|
||||||
|
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
|
||||||
|
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
|
||||||
|
err = EGL_BAD_ATTRIBUTE;
|
||||||
|
} else {
|
||||||
|
attrs->DMABufChromaVerticalSiting.Value = val;
|
||||||
|
attrs->DMABufChromaVerticalSiting.IsPresent = EGL_TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static EGLint
|
||||||
|
_eglParseEXTImageDmaBufImportModifiersAttribs(_EGLImageAttribs *attrs,
|
||||||
|
_EGLDisplay *dpy,
|
||||||
|
EGLint attr, EGLint val)
|
||||||
|
{
|
||||||
|
EGLint err = EGL_SUCCESS;
|
||||||
|
|
||||||
|
switch (attr) {
|
||||||
|
case EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersLo[0].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersLo[0].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersHi[0].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersHi[0].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersLo[1].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersLo[1].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersHi[1].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersHi[1].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersLo[2].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersLo[2].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersHi[2].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersHi[2].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE3_FD_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneFds[3].Value = val;
|
||||||
|
attrs->DMABufPlaneFds[3].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE3_OFFSET_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneOffsets[3].Value = val;
|
||||||
|
attrs->DMABufPlaneOffsets[3].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE3_PITCH_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlanePitches[3].Value = val;
|
||||||
|
attrs->DMABufPlanePitches[3].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersLo[3].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersLo[3].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
case EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT:
|
||||||
|
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
attrs->DMABufPlaneModifiersHi[3].Value = val;
|
||||||
|
attrs->DMABufPlaneModifiersHi[3].IsPresent = EGL_TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
err = EGL_BAD_PARAMETER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the list of image attributes.
|
* Parse the list of image attributes.
|
||||||
|
|
@ -45,9 +284,7 @@ EGLBoolean
|
||||||
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
_eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
const EGLint *attrib_list)
|
const EGLint *attrib_list)
|
||||||
{
|
{
|
||||||
EGLint i, err = EGL_SUCCESS;
|
EGLint i, err;
|
||||||
|
|
||||||
(void) dpy;
|
|
||||||
|
|
||||||
memset(attrs, 0, sizeof(*attrs));
|
memset(attrs, 0, sizeof(*attrs));
|
||||||
|
|
||||||
|
|
@ -58,190 +295,27 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
||||||
EGLint attr = attrib_list[i++];
|
EGLint attr = attrib_list[i++];
|
||||||
EGLint val = attrib_list[i];
|
EGLint val = attrib_list[i];
|
||||||
|
|
||||||
switch (attr) {
|
err = _eglParseKHRImageAttribs(attrs, dpy, attr, val);
|
||||||
/* EGL_KHR_image_base */
|
if (err == EGL_SUCCESS)
|
||||||
case EGL_IMAGE_PRESERVED_KHR:
|
continue;
|
||||||
attrs->ImagePreserved = val;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* EGL_KHR_gl_image */
|
err = _eglParseMESADrmImageAttribs(attrs, dpy, attr, val);
|
||||||
case EGL_GL_TEXTURE_LEVEL_KHR:
|
if (err == EGL_SUCCESS)
|
||||||
attrs->GLTextureLevel = val;
|
continue;
|
||||||
break;
|
|
||||||
case EGL_GL_TEXTURE_ZOFFSET_KHR:
|
|
||||||
attrs->GLTextureZOffset = val;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* EGL_MESA_drm_image */
|
err = _eglParseWLBindWaylandDisplayAttribs(attrs, dpy, attr, val);
|
||||||
case EGL_WIDTH:
|
if (err == EGL_SUCCESS)
|
||||||
attrs->Width = val;
|
continue;
|
||||||
break;
|
|
||||||
case EGL_HEIGHT:
|
|
||||||
attrs->Height = val;
|
|
||||||
break;
|
|
||||||
case EGL_DRM_BUFFER_FORMAT_MESA:
|
|
||||||
attrs->DRMBufferFormatMESA = val;
|
|
||||||
break;
|
|
||||||
case EGL_DRM_BUFFER_USE_MESA:
|
|
||||||
attrs->DRMBufferUseMESA = val;
|
|
||||||
break;
|
|
||||||
case EGL_DRM_BUFFER_STRIDE_MESA:
|
|
||||||
attrs->DRMBufferStrideMESA = val;
|
|
||||||
break;
|
|
||||||
|
|
||||||
/* EGL_WL_bind_wayland_display */
|
err = _eglParseEXTImageDmaBufImportAttribs(attrs, dpy, attr, val);
|
||||||
case EGL_WAYLAND_PLANE_WL:
|
if (err == EGL_SUCCESS)
|
||||||
attrs->PlaneWL = val;
|
continue;
|
||||||
break;
|
|
||||||
|
|
||||||
case EGL_LINUX_DRM_FOURCC_EXT:
|
err = _eglParseEXTImageDmaBufImportModifiersAttribs(attrs, dpy, attr, val);
|
||||||
attrs->DMABufFourCC.Value = val;
|
if (err == EGL_SUCCESS)
|
||||||
attrs->DMABufFourCC.IsPresent = EGL_TRUE;
|
continue;
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE0_FD_EXT:
|
|
||||||
attrs->DMABufPlaneFds[0].Value = val;
|
|
||||||
attrs->DMABufPlaneFds[0].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE0_OFFSET_EXT:
|
|
||||||
attrs->DMABufPlaneOffsets[0].Value = val;
|
|
||||||
attrs->DMABufPlaneOffsets[0].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE0_PITCH_EXT:
|
|
||||||
attrs->DMABufPlanePitches[0].Value = val;
|
|
||||||
attrs->DMABufPlanePitches[0].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersLo[0].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersLo[0].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersHi[0].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersHi[0].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE1_FD_EXT:
|
|
||||||
attrs->DMABufPlaneFds[1].Value = val;
|
|
||||||
attrs->DMABufPlaneFds[1].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE1_OFFSET_EXT:
|
|
||||||
attrs->DMABufPlaneOffsets[1].Value = val;
|
|
||||||
attrs->DMABufPlaneOffsets[1].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE1_PITCH_EXT:
|
|
||||||
attrs->DMABufPlanePitches[1].Value = val;
|
|
||||||
attrs->DMABufPlanePitches[1].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersLo[1].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersLo[1].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersHi[1].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersHi[1].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE2_FD_EXT:
|
|
||||||
attrs->DMABufPlaneFds[2].Value = val;
|
|
||||||
attrs->DMABufPlaneFds[2].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE2_OFFSET_EXT:
|
|
||||||
attrs->DMABufPlaneOffsets[2].Value = val;
|
|
||||||
attrs->DMABufPlaneOffsets[2].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE2_PITCH_EXT:
|
|
||||||
attrs->DMABufPlanePitches[2].Value = val;
|
|
||||||
attrs->DMABufPlanePitches[2].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersLo[2].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersLo[2].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersHi[2].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersHi[2].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE3_FD_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneFds[3].Value = val;
|
|
||||||
attrs->DMABufPlaneFds[3].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE3_OFFSET_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneOffsets[3].Value = val;
|
|
||||||
attrs->DMABufPlaneOffsets[3].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE3_PITCH_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlanePitches[3].Value = val;
|
|
||||||
attrs->DMABufPlanePitches[3].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersLo[3].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersLo[3].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT:
|
|
||||||
if (!dpy->Extensions.EXT_image_dma_buf_import_modifiers)
|
|
||||||
err = EGL_BAD_PARAMETER;
|
|
||||||
attrs->DMABufPlaneModifiersHi[3].Value = val;
|
|
||||||
attrs->DMABufPlaneModifiersHi[3].IsPresent = EGL_TRUE;
|
|
||||||
break;
|
|
||||||
case EGL_YUV_COLOR_SPACE_HINT_EXT:
|
|
||||||
if (val != EGL_ITU_REC601_EXT && val != EGL_ITU_REC709_EXT &&
|
|
||||||
val != EGL_ITU_REC2020_EXT) {
|
|
||||||
err = EGL_BAD_ATTRIBUTE;
|
|
||||||
} else {
|
|
||||||
attrs->DMABufYuvColorSpaceHint.Value = val;
|
|
||||||
attrs->DMABufYuvColorSpaceHint.IsPresent = EGL_TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EGL_SAMPLE_RANGE_HINT_EXT:
|
|
||||||
if (val != EGL_YUV_FULL_RANGE_EXT && val != EGL_YUV_NARROW_RANGE_EXT) {
|
|
||||||
err = EGL_BAD_ATTRIBUTE;
|
|
||||||
} else {
|
|
||||||
attrs->DMABufSampleRangeHint.Value = val;
|
|
||||||
attrs->DMABufSampleRangeHint.IsPresent = EGL_TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT:
|
|
||||||
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
|
|
||||||
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
|
|
||||||
err = EGL_BAD_ATTRIBUTE;
|
|
||||||
} else {
|
|
||||||
attrs->DMABufChromaHorizontalSiting.Value = val;
|
|
||||||
attrs->DMABufChromaHorizontalSiting.IsPresent = EGL_TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT:
|
|
||||||
if (val != EGL_YUV_CHROMA_SITING_0_EXT &&
|
|
||||||
val != EGL_YUV_CHROMA_SITING_0_5_EXT) {
|
|
||||||
err = EGL_BAD_ATTRIBUTE;
|
|
||||||
} else {
|
|
||||||
attrs->DMABufChromaVerticalSiting.Value = val;
|
|
||||||
attrs->DMABufChromaVerticalSiting.IsPresent = EGL_TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
return _eglError(err, __func__);
|
||||||
return _eglError(EGL_BAD_ATTRIBUTE, __func__);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err != EGL_SUCCESS)
|
|
||||||
return _eglError(err, __func__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EGL_TRUE;
|
return EGL_TRUE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue