<div dir="ltr">Your a life savor man. That did the trick. I cannot test on the Radeon and Nouveau until I get back into the office tomorrow, but it worked great on the VMWGFX driver. <div><br></div><div>I'll also email David to let him know as his examples (which a lot of people reference) also need to that #define. </div><div><br></div><div>Thanks again,</div><div>- Rian</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 5:33 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 11 November 2014 07:33, Rian Quinn <<a href="mailto:rianquinn@gmail.com">rianquinn@gmail.com</a>> wrote:<br>
> I would be surprised if the size argument was the issue. That comes right<br>
> out out of the create IOCTL unmodified. Here is the full source that I am<br>
> using.<br>
><br>
>     // Clear the arg buffers.<br>
>     memset(&create_arg, 0, sizeof(create_arg));<br>
>     memset(&map_arg, 0, sizeof(map_arg));<br>
><br>
>     //<br>
> ------------------------------------------------------------------------<br>
>     // Allocate<br>
><br>
>     // Fill in the arguments for the IOCTL. Note that we only support 32bpp<br>
>     // dumb buffers so that is hard coded here.<br>
>     create_arg.width = width;<br>
>     create_arg.height = height;<br>
>     create_arg.bpp = 32;<br>
><br>
>     // Allocate the dumb buffer<br>
>     if (drmIoctl(gpu->fd(), DRM_IOCTL_MODE_CREATE_DUMB, &create_arg))<br>
>     {<br>
>         svWarning(0) << "Failed: DRM_IOCTL_MODE_CREATE_DUMB - " <<<br>
> strerror(errno);<br>
>         return;<br>
>     }<br>
><br>
>     // Store the dumb buffer properties.<br>
>     mSize = create_arg.size;<br>
>     mStride = create_arg.pitch;<br>
>     mHandle = create_arg.handle;<br>
><br>
>     //<br>
> ------------------------------------------------------------------------<br>
>     // Map<br>
><br>
>     // Fill in the arguments for the IOCTL.<br>
>     map_arg.handle = mHandle;<br>
><br>
>     // Allocate the dumb buffer<br>
>     if (drmIoctl(gpu->fd(), DRM_IOCTL_MODE_MAP_DUMB, &map_arg))<br>
>     {<br>
>         svWarning(0) << "Failed: DRM_IOCTL_MODE_MAP_DUMB - " <<<br>
> strerror(errno);<br>
>         return;<br>
>     }<br>
><br>
>     // Store the mapped memory<br>
>     if ((mVaddr = (svuint32 *)mmap(0, mSize, PROT_READ | PROT_WRITE,<br>
> MAP_SHARED, gpu->fd(), map_arg.offset)) == MAP_FAILED)<br>
>     {<br>
>         // Need to clear out the address so that we don't try to use it.<br>
>         mVaddr = NULL;<br>
><br>
>         // Error out.<br>
>         svWarning(0) << "Failed: Dumb Buffer mmap - " << strerror(errno);<br>
>         return;<br>
>     }<br>
><br>
<br>
</div></div>mmap is probably truncating the offset,<br>
<br>
look into,<br>
#define _FILE_OFFSET_BITS 64<br>
<br>
AC_SYS_LARGEFILE<br>
<span class="HOEnZb"><font color="#888888"><br>
Dave.<br>
</font></span></blockquote></div><br></div>