Subject: Re: drm on amd64 (drmMap failed)
To: Xning Lee <xning@soforge.com>
From: Matt Thomas <matt@3am-software.com>
List: tech-x11
Date: 04/05/2007 19:59:56
Xning Lee wrote:
> "Blair Sadewitz" <blair.sadewitz@gmail.com> writes:
> 
>> This is exactly the same problem I had on amd64; I've since switched
>> to i386 (for reasons other than drm; linux compatability on amd64 for
>> EMT64 processors is broken).  Could you file a PR for this, please?
>>
>> Thanks,
>>
> 
> The issue of 'drmMap failed' on amd64 because the function
> 'udv_attach' of /usr/src/sys/uvm/uvm_device.c can't accept address
> offset value more than 4GB: (the type of 'voff_t' is int64)

This is going to be, ultimately, a sign extension problem.  I'm guessing
that line 176 in drm_ioctl.c would show that the address being passed in
has already been sign-extended.

if ((voff_t)(vaddr_t)request.offset < 0)
   printf("drm_getmap: invalid offset %"PRIx64"\n",
    (voff_t)(vaddr_t)request.offset);

So the question is where it happened.  Have fun finding it. :)