mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
egl: drop _eglInitImage() return type
Function cannot fail and always returns true. v2: Inline the one line function in the header Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
This commit is contained in:
parent
860919a3b2
commit
d42b09580a
7 changed files with 12 additions and 42 deletions
|
|
@ -1669,10 +1669,7 @@ dri2_create_image_from_dri(_EGLDisplay *disp, __DRIimage *dri_image)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return NULL;
|
||||
}
|
||||
_eglInitImage(&dri2_img->base, disp);
|
||||
|
||||
dri2_img->dri_image = dri_image;
|
||||
|
||||
|
|
@ -1869,11 +1866,7 @@ dri2_create_image_khr_texture(_EGLDisplay *disp, _EGLContext *ctx,
|
|||
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,
|
||||
|
|
@ -2345,10 +2338,7 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -843,10 +843,7 @@ droid_create_image_from_name(_EGLDisplay *disp, _EGLContext *ctx,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return NULL;
|
||||
}
|
||||
_eglInitImage(&dri2_img->base, disp);
|
||||
|
||||
dri2_img->dri_image =
|
||||
dri2_dpy->image->createImageFromName(dri2_dpy->dri_screen,
|
||||
|
|
|
|||
|
|
@ -478,10 +478,7 @@ dri2_drm_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return NULL;
|
||||
}
|
||||
_eglInitImage(&dri2_img->base, disp);
|
||||
|
||||
dri2_img->dri_image = dri2_dpy->image->dupImage(dri_bo->image, dri2_img);
|
||||
if (dri2_img->dri_image == NULL) {
|
||||
|
|
|
|||
|
|
@ -1070,12 +1070,7 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
|||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(buffers_reply);
|
||||
free(geometry_reply);
|
||||
free(dri2_img);
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
_eglInitImage(&dri2_img->base, disp);
|
||||
|
||||
stride = buffers[0].pitch / buffers[0].cpp;
|
||||
dri2_img->dri_image =
|
||||
|
|
|
|||
|
|
@ -327,10 +327,7 @@ dri3_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
|
|||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dri2_img->base, disp)) {
|
||||
free(dri2_img);
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
_eglInitImage(&dri2_img->base, disp);
|
||||
|
||||
dri2_img->dri_image = loader_dri3_create_image(dri2_dpy->conn,
|
||||
bp_reply,
|
||||
|
|
|
|||
|
|
@ -245,12 +245,3 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
|||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy)
|
||||
{
|
||||
_eglInitResource(&img->Resource, sizeof(*img), dpy);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,11 @@ _eglParseImageAttribList(_EGLImageAttribs *attrs, _EGLDisplay *dpy,
|
|||
const EGLint *attrib_list);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy);
|
||||
static inline void
|
||||
_eglInitImage(_EGLImage *img, _EGLDisplay *dpy)
|
||||
{
|
||||
_eglInitResource(&img->Resource, sizeof(*img), dpy);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue