tech-x11 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: radeon_bo_gem.c v1.4
> Date: Sat, 19 Jan 2019 00:00:08 +0100
> From: Tobias Nygren <tnn%NetBSD.org@localhost>
>
> - ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr);
> - if (ptr == MAP_FAILED)
> + r = drmMap(boi->bom->fd, args.addr_ptr, args.size, &ptr);
> + if (r)
>
> I think this change is wrong because args.addr_ptr can be larger than 32 bits
> here but drmMap takes "drm_handle_t" as argument 2 which is only 4 bytes wide.
> So it can truncate the value which makes the drm_mmap() inside drmMap() fail.
>
> I will revert the change in pgksrc, perhaps it should be reverted in xsrc too.
This was presumably an artefact of the days before we had custom
struct fileops::fo_mmap functions, and we used a NetBSD-specific ioctl
instead to map the GEM/TTM buffers into userland's addres space. It
is long since obsolete and has been probably since netbs-7.
Home |
Main Index |
Thread Index |
Old Index