[Mesa-dev] [PATCH] egl: Fix for not setting EGL_BAD_MATCH by eglCreatePbufferSurface.
Ilia Mirkin
imirkin at alum.mit.edu
Fri Mar 4 15:59:30 UTC 2016
On Fri, Mar 4, 2016 at 9:06 AM, Pielech, Adrian
<adrian.pielech at intel.com> wrote:
>
>
>
>
> This is fix for not setting EGL_BAD_MATCH when calling
> eglCreatePbufferSurface with invalid setting of EGL_TEXTURE_FORMAT and
> EGL_TEXTURE_TARGET.
>
> According to EGL spec the following combination should generate
> EGL_BAD_MATCH:
>
> EGL_TEXTURE_FORMAT == EGL_NO_TEXTURE and EGL_TEXTURE_TARGET !=
> EGL_NO_TEXTURE,
>
> EGL_TEXTURE_FORMAT != EGL_NO_TEXTURE and EGL_TEXTURE_TARGET ==
> EGL_NO_TEXTURE
>
>
>
>
>
> ---
>
> src/egl/main/eglsurface.c | 8 ++++++++
>
> 1 file changed, 8 insertions(+)
>
>
>
> diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
>
> index d42737e..b79e3c6 100644
>
> --- a/src/egl/main/eglsurface.c
>
> +++ b/src/egl/main/eglsurface.c
>
> @@ -223,6 +223,14 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const
> EGLint *attrib_list)
>
> }
>
> }
>
> + //if surface is Pbuffer type and [(EGL_TEXTURE_FORMAT == EGL_NO_TEXTURE
> and EGL_TEXTURE_TARGET != EGL_NO_TEXTURE) or (EGL_TEXTURE_FORMAT !=
> EGL_NO_TEXTURE and EGL_TEXTURE_TARGET == EGL_NO_TEXTURE)] then the
> EGL_BAD_MATCH should be set
Is this substantially different than the code below? Feels like a
i++; // increment i by 1
type of situation... also try to keep lines under 80 chars.
>
> + if ((surf->TextureFormat == EGL_NO_TEXTURE && surf->TextureTarget !=
> EGL_NO_TEXTURE ||
>
> + surf->TextureFormat != EGL_NO_TEXTURE && surf->TextureTarget ==
> EGL_NO_TEXTURE) &&
If you were feeling clever, you could do something like
if (((surf->TextureFormat == EGL_NO_TEXTURE) ^ (surf->TextureTarget ==
EGL_NO_TEXTURE)) && (surf->Type & EGL_PBUFFER_BIT))
Your patch appears to have come through badly misformatted... I think
it's HTML-formatted maybe? Please make sure that your emails are able
to be processed by "git am". (Or just use git format-patch +
send-email and avoid the headache.)
>
> + (surf->Type & EGL_PBUFFER_BIT))
>
> + {
>
> + err = EGL_BAD_MATCH;
>
> + }
>
> +
>
> return err;
>
> }
>
> --
>
> 2.7.0.rc3
>
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk
> Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego
> - KRS 101882 | NIP 957-07-52-316 | Kapitał zakładowy 200.000 PLN.
>
> Ta wiadomość wraz z załącznikami jest przeznaczona dla
> określonego adresata i może zawierać informacje poufne. W razie
> przypadkowego otrzymania tej wiadomości, prosimy o powiadomienie nadawcy
> oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub
> rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the
> sole use of the intended recipient(s). If you are not the intended
> recipient, please contact the sender and delete all copies; any review or
> distribution by others is strictly prohibited.
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list