[Glamor] dri3 warnings

Gaetan Nadon memsize at videotron.ca
Sun Dec 8 06:59:57 PST 2013


On 13-12-08 08:45 AM, davyaxel at free.fr wrote:
> The other cases in which we uses eglCreateImageKHR are with arguments that fit well with EGLClientBuffer.
> But EGL_KHR_gl_image is a special case in which we have to pass a texture name,
> and not a pointer on a structure defining a buffer.
>
> "If <target> is EGL_GL_TEXTURE_2D_KHR, <buffer> must be the name of a
>     nonzero, GL_TEXTURE_2D target texture object, cast into
>     the type EGLClientBuffer."
>
> The code actually works on my pc, and the patch I proposed removes the compilation warning.
> If you think of a better way to cast the texture name into EGLClientBuffer, please indicate it.

Thanks for the info. I did a bit of reading as I suspected it is a
common problem. The compiler complains because there is  no guaranty
that an unsigned long is big enough to hold a pointer. This is one
recommendation I saw, but I have no personal experience with it. You can
give it a try to make sure it works, but it compiles ok.

    (EGLClientBuffer)(uintptr_t)texor just
    (uintptr_t)tex

I checked that uintptr_t is widely used in xserver and X libraries and
we do compile all of X with C99. It's worth a try because suppressing
the warning is dangerous as you will not be notified for other cases
where it will really be a problem.

If that does not work, I'd rather keep the warning to be alerted of
other places in the code. Opinions will vary on that, the maintainer has
the last word.

Thanks for looking into that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/glamor/attachments/20131208/0e0b1385/attachment-0001.html>


More information about the Glamor mailing list