formats, count))
return EGL_FALSE;
+ if (max > 0) {
+ /* Assert that all of the formats returned are actually fourcc formats.
+ * Some day, if we want the internal interface function to be able to
+ * return the fake fourcc formats defined in dri_interface.h, we'll have
+ * to do something more clever here to pair the list down to just real
+ * fourcc formats so that we don't leak the fake internal ones.
+ */
+ for (int i = 0; i < *count; i++) {
+ assert(dri2_num_fourcc_format_planes(formats[i]) > 0);
+ }
+ }
+
return EGL_TRUE;
}
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ if (dri2_num_fourcc_format_planes(format) == 0)
+ return _eglError(EGL_BAD_PARAMETER, "invalid fourcc format");
+
if (max < 0)
return _eglError(EGL_BAD_PARAMETER, "invalid value for max count of formats");