egl: move eglCreateDRMImageMESA's malloc later
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 28 Jun 2017 20:23:00 +0000 (21:23 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 12 Jul 2017 14:42:03 +0000 (15:42 +0100)
commit9365ff4b885730d76e535edc12445b6f1b72f667
treedb1c4bd22135f61af98bc013ad29f0801c78a9d2
parentf7e78abdf45b26f3991dc336120162ae01b208f1
egl: move eglCreateDRMImageMESA's malloc later

Don't bother allocating any memory until we're finished parsing and
sanitising all the attributes.

As a nice side effect we now consistently set eglError when any of
the attrib/values are not correct.

Strangely enough the spec does not mention _anything_ about what error
should be set where, even if the implementation already sets the odd
one.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/egl_dri2.c