mmap fails for DRM_IOCTL_MODE_MAP_DUMB for Radeon, Nouveau, and VMWGFX
Dave Airlie
airlied at gmail.com
Mon Nov 10 13:14:09 PST 2014
On 11 November 2014 06:33, Rian Quinn <rianquinn at gmail.com> wrote:
> I did another test using the following that David put up on github:
>
> https://github.com/dvdhrm/docs/blob/master/drm-howto/modeset.c
>
> This test also fails on everything except Intel. What's really strange is
> this test actually does a test to verify that dumb buffers are supported,
> and the test passes in all cases. David's code is returning with the same
> error of "Invalid Argument" on the mmap call. Why would the other driver's
> claim to support dumb buffers, but have no means to map the memory?
Just a guess, the size argument is wrong.
But you know you have the kernel source, stick some printks in the
EINVAL return paths already.
Dave.
> - Rian
>
> On Mon, Nov 10, 2014 at 2:48 PM, Rian Quinn <rianquinn at gmail.com> wrote:
>>
>> When working with dumb buffers, DRM_IOCTL_MODE_MAP_DUMB and mmap works
>> fine on Intel, but the mmap call fails on Radeon, Nouveau, and VMWGFX. I you
>> look at the source for the xorg moderating driver, it only uses the dumb
>> buffer IOCTL (i.e. it’s not using LibKMS), and if you look at the kernel
>> source code for the dumb buffer IOCTLs for each of the Radeon, Nouveau, and
>> VMWGFX drivers, they all implement the functions. Furthermore all of the
>> IOCTLs succeed without error. Its only when you attempt to map the memory,
>> that you get an error of “Invalid Argument”. Here is my map call:
>>
>> mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, map_arg.offset)
>>
>> Is this a bug, or is there a different way to map the dumb buffers for
>> these drivers other than LibKMS.
>>
>> Thanks,
>> - Rian
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
More information about the dri-devel
mailing list