return NULL;
}
- if (!_eglInitImage(&dri2_img->base, disp)) {
- free(dri2_img);
- return NULL;
- }
+ _eglInitImage(&dri2_img->base, disp);
dri2_img->dri_image = dri_image;
return EGL_NO_IMAGE_KHR;
}
- if (!_eglInitImage(&dri2_img->base, disp)) {
- _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr");
- free(dri2_img);
- return EGL_NO_IMAGE_KHR;
- }
+ _eglInitImage(&dri2_img->base, disp);
dri2_img->dri_image =
dri2_dpy->image->createImageFromTexture(dri2_ctx->dri_context,
* incomplete, EGL_BAD_PARAMETER is generated."
*/
if (attrs->Width <= 0 || attrs->Height <= 0 ||
- !attrs->DMABufFourCC.IsPresent) {
- _eglError(EGL_BAD_PARAMETER, "attribute(s) missing");
- return EGL_FALSE;
- }
+ !attrs->DMABufFourCC.IsPresent)
+ return _eglError(EGL_BAD_PARAMETER, "attribute(s) missing");
/**
* Also:
*/
for (unsigned i = 0; i < ARRAY_SIZE(attrs->DMABufPlanePitches); ++i) {
if (attrs->DMABufPlanePitches[i].IsPresent &&
- attrs->DMABufPlanePitches[i].Value <= 0) {
- _eglError(EGL_BAD_ACCESS, "invalid pitch");
- return EGL_FALSE;
- }
+ attrs->DMABufPlanePitches[i].Value <= 0)
+ return _eglError(EGL_BAD_ACCESS, "invalid pitch");
}
/**
*/
for (unsigned i = 0; i < DMA_BUF_MAX_PLANES; ++i) {
if (attrs->DMABufPlaneModifiersLo[i].IsPresent !=
- attrs->DMABufPlaneModifiersHi[i].IsPresent) {
- _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
- return EGL_FALSE;
- }
+ attrs->DMABufPlaneModifiersHi[i].IsPresent)
+ return _eglError(EGL_BAD_PARAMETER, "modifier attribute lo or hi missing");
}
/* Although the EGL_EXT_image_dma_buf_import_modifiers spec doesn't
(attrs->DMABufPlaneModifiersLo[0].Value !=
attrs->DMABufPlaneModifiersLo[i].Value) ||
(attrs->DMABufPlaneModifiersHi[0].Value !=
- attrs->DMABufPlaneModifiersHi[i].Value)) {
- _eglError(EGL_BAD_PARAMETER, "modifier attributes not equal");
- return EGL_FALSE;
- }
+ attrs->DMABufPlaneModifiersHi[i].Value))
+ return _eglError(EGL_BAD_PARAMETER, "modifier attributes not equal");
}
}
EGLint max, EGLint *formats, EGLint *count)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- if (max < 0 || (max > 0 && formats == NULL)) {
- _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- return EGL_FALSE;
- }
+ if (max < 0 || (max > 0 && formats == NULL))
+ return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
if (dri2_dpy->image->base.version < 15 ||
dri2_dpy->image->queryDmaBufFormats == NULL)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
- if (max < 0) {
- _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- return EGL_FALSE;
- }
+ if (max < 0)
+ return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");
- if (max > 0 && modifiers == NULL) {
- _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
- return EGL_FALSE;
- }
+ if (max > 0 && modifiers == NULL)
+ return _eglError(EGL_BAD_PARAMETER, "invalid modifiers array");
if (dri2_dpy->image->base.version < 15 ||
dri2_dpy->image->queryDmaBufModifiers == NULL)
if (dri2_dpy->image->queryDmaBufModifiers(dri2_dpy->dri_screen, format,
max, modifiers,
(unsigned int *) external_only,
- count) == false) {
- _eglError(EGL_BAD_PARAMETER, "invalid format");
- return EGL_FALSE;
- }
+ count) == false)
+ return _eglError(EGL_BAD_PARAMETER, "invalid format");
return EGL_TRUE;
}
goto cleanup_img;
}
- if (!_eglInitImage(&dri2_img->base, disp)) {
- err = EGL_BAD_PARAMETER;
- goto cleanup_img;
- }
+ _eglInitImage(&dri2_img->base, disp);
err = _eglParseImageAttribList(&attrs, disp, attr_list);
if (err != EGL_SUCCESS)
(void) drv;
if (name && !dri2_dpy->image->queryImage(dri2_img->dri_image,
- __DRI_IMAGE_ATTRIB_NAME, name)) {
- _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa");
- return EGL_FALSE;
- }
+ __DRI_IMAGE_ATTRIB_NAME, name))
+ return _eglError(EGL_BAD_ALLOC, "dri2_export_drm_image_mesa");
if (handle)
dri2_dpy->image->queryImage(dri2_img->dri_image,
struct dri2_egl_sync *dri2_sync = dri2_egl_sync(sync);
EGLint ret;
- if (sync->Type != EGL_SYNC_REUSABLE_KHR) {
- _eglError(EGL_BAD_MATCH, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (sync->Type != EGL_SYNC_REUSABLE_KHR)
+ return _eglError(EGL_BAD_MATCH, "eglSignalSyncKHR");
- if (mode != EGL_SIGNALED_KHR && mode != EGL_UNSIGNALED_KHR) {
- _eglError(EGL_BAD_ATTRIBUTE, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (mode != EGL_SIGNALED_KHR && mode != EGL_UNSIGNALED_KHR)
+ return _eglError(EGL_BAD_ATTRIBUTE, "eglSignalSyncKHR");
dri2_sync->base.SyncStatus = mode;
ret = cnd_broadcast(&dri2_sync->cond);
/* fail to broadcast */
- if (ret) {
- _eglError(EGL_BAD_ACCESS, "eglSignalSyncKHR");
- return EGL_FALSE;
- }
+ if (ret)
+ return _eglError(EGL_BAD_ACCESS, "eglSignalSyncKHR");
}
return EGL_TRUE;