List Info

Thread: drm on amd64




drm on amd64
user name
2007-03-20 14:58:41
If anyone gets to try the new drm code on amd64, please let
me know
how it goes for you. I'm trying to rule out any problems
with my X
server, etc.

It's probably some 64-bit issue, but it would be helpful to
know if
this problem is specific to me or not.

Regards,

--Blair

-- 
Support WFMU-FM: free-form radio for the masses!
<http://www.wfmu.org/>


"The frivolity and boredom which unsettle the
established order, the
vague foreboding of something unknown, these are the heralds
of
approaching change.  The gradual crumbling that left
unaltered the
face of the whole is cut short by a sunburst which, in one
flash,
illuminates the features of the new world."  --G.W.F.
Hegel,
_Phenomenology of Spirit_ 5:11

Re: drm on amd64
user name
2007-03-31 14:58:04
"Blair Sadewitz" <blair.sadewitzgmail.com> writes:

Hello,

> If anyone gets to try the new drm code on amd64, please
let me know
> how it goes for you. I'm trying to rule out any
problems with my X
> server, etc.
>
> It's probably some 64-bit issue, but it would be
helpful to know if
> this problem is specific to me or not.
>

1. Xorg (v7.2.0) log
===================
(II) RADEON(0): [drm] DRM interface version 1.2
(II) RADEON(0): [drm] created "radeon" driver at
busid "pci:0000:01:00.0"
(II) RADEON(0): [drm] added 8192 byte SAREA at
0xffff8000367b0000
(II) RADEON(0): [drm] drmMap failed
(EE) RADEON(0): [dri] DRIScreenInit failed.  Disabling DRI.


2. kernel log
=============
radeondrm0 at vga0
info: [drm] ATI Radeon AS 9550 (unit 0)
info: [drm] AGP at 0xf8000000 64MB
info: [drm] Initialized radeon 1.25.0 20060524
[drm:pid682:drm_open] open_count = 0
[drm:pid682:drm_open_helper] pid = 682, minor = 0
[drm:pid682:radeon_driver_open] 
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid682:drm_ioremap] ioremap mem found:
0xffff8000368b0000
[drm:pid682:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid682:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid682:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid682:drm_addmap] Added map 0 0xe8000000/0x8000000
[drm:pid682:drm_firstopen] 
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_close] open_count = 1
[drm:pid682:drm_close] setting priv->refs 1 to 1
[drm:pid682:drm_close] setting open_count 1 to 1
[drm:pid682:drm_close_pid] pid = 682, device =
0xffff8000018e2800, open_count = 1
[drm:pid682:drm_lastclose] 
[drm:pid682:radeon_do_cleanup_cp] 
[drm:pid682:drm_mtrr_del] offset=e8000000 size=134217728
[drm:pid682:drm_rmmap] mtrr_del = 0
[drm:pid682:drm_lastclose] 
[drm:pid682:drm_open] open_count = 0
[drm:pid682:drm_open_helper] pid = 682, minor = 0
[drm:pid682:radeon_driver_open] 
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid682:drm_ioremap] ioremap mem found:
0xffff8000368b0000
[drm:pid682:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid682:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid682:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid682:drm_addmap] Added map 0 0xe8000000/0x8000000
[drm:pid682:drm_firstopen] 
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106407, nr=0x07, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106401, nr=0x01, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106401, nr=0x01, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_close] open_count = 1
[drm:pid682:drm_close] setting priv->refs 1 to 1
[drm:pid682:drm_close] setting open_count 1 to 1
[drm:pid682:drm_close_pid] pid = 682, device =
0xffff8000018e2800, open_count = 1
[drm:pid682:drm_lastclose] 
[drm:pid682:radeon_do_cleanup_cp] 
[drm:pid682:drm_mtrr_del] offset=e8000000 size=134217728
[drm:pid682:drm_rmmap] mtrr_del = 0
[drm:pid682:drm_lastclose] 
[drm:pid682:drm_open] open_count = 0
[drm:pid682:drm_open_helper] pid = 682, minor = 0
[drm:pid682:radeon_driver_open] 
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid682:drm_ioremap] ioremap mem found:
0xffff8000368b0000
[drm:pid682:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid682:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid682:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid682:drm_addmap] Added map 0 0xe8000000/0x8000000
[drm:pid682:drm_firstopen] 
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_close] open_count = 1
[drm:pid682:drm_close] setting priv->refs 1 to 1
[drm:pid682:drm_close] setting open_count 1 to 1
[drm:pid682:drm_close_pid] pid = 682, device =
0xffff8000018e2800, open_count = 1
[drm:pid682:drm_lastclose] 
[drm:pid682:radeon_do_cleanup_cp] 
[drm:pid682:drm_lastclose] 
[drm:pid682:drm_open] open_count = 0
[drm:pid682:drm_open_helper] pid = 682, minor = 0
[drm:pid682:radeon_driver_open] 
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid682:drm_ioremap] ioremap mem found:
0xffff8000368b0000
[drm:pid682:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid682:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid682:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid682:drm_addmap] Added map 0 0xe8000000/0x8000000
[drm:pid682:drm_firstopen] 
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0406400, nr=0x00, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_close] open_count = 1
[drm:pid682:drm_close] setting priv->refs 1 to 1
[drm:pid682:drm_close] setting open_count 1 to 1
[drm:pid682:drm_close_pid] pid = 682, device =
0xffff8000018e2800, open_count = 1
[drm:pid682:drm_lastclose] 
[drm:pid682:radeon_do_cleanup_cp] 
[drm:pid682:drm_lastclose] 
[drm:pid682:drm_open] open_count = 0
[drm:pid682:drm_open_helper] pid = 682, minor = 0
[drm:pid682:radeon_driver_open] 
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid682:drm_ioremap] ioremap mem found:
0xffff8000368b0000
[drm:pid682:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid682:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid682:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid682:drm_addmap] Added map 0 0xe8000000/0x8000000
[drm:pid682:drm_firstopen] 
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106407, nr=0x07, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106401, nr=0x01, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106401, nr=0x01, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0106407, nr=0x07, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_ioctl] pid=682, cmd=0xc0286415, nr=0x15, dev
0xffff8000018e2800, auth=1
[drm:pid682:drm_addmap] offset = 0x00000000, size =
0x00002000, type = 2
[drm:pid682:drm_addmap] Found kernel map 2
[drm:pid682:drm_addmap] Added map 2
0xffff80003674a000/0x2000
[drm:pid682:drm_close] open_count = 1
[drm:pid682:drm_close] setting priv->refs 1 to 1
[drm:pid682:drm_close] setting open_count 1 to 1
[drm:pid682:drm_close_pid] pid = 682, device =
0xffff8000018e2800, open_count = 1
[drm:pid682:drm_lastclose] 
[drm:pid682:radeon_do_cleanup_cp] 
[drm:pid682:drm_lastclose] 


Regards,

--Xning

Re: drm on amd64
user name
2007-04-01 13:09:32
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,

--Blair

-- 
Support WFMU-FM: free-form radio for the masses!
<http://www.wfmu.org/>


"The frivolity and boredom which unsettle the
established order, the
vague foreboding of something unknown, these are the heralds
of
approaching change.  The gradual crumbling that left
unaltered the
face of the whole is cut short by a sunburst which, in one
flash,
illuminates the features of the new world."  --G.W.F.
Hegel,
_Phenomenology of Spirit_ 5:11

Re: drm on amd64 (drmMap failed)
user name
2007-04-05 08:45:14
Xning Lee <xningsoforge.com> writes:

> "Blair Sadewitz" <blair.sadewitzgmail.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)
               ^^^^^^^^^^^^^
correct: more than 0x7fffffffffffffff



Regards,

--Xning

Re: drm on amd64 (drmMap failed)
user name
2007-04-05 08:08:13
"Blair Sadewitz" <blair.sadewitzgmail.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)

struct uvm_object *
udv_attach(void *arg, vm_prot_t accessprot,
    voff_t off,	        /* used only for access check */
    vsize_t size	/* used only for access check */)
{
        ...

	if (off < 0)
		return(NULL);
        ...
}

When I changed the type of parameter 'off' from 'voff_t' to
'vsize_t'(u_long), 'drm on amd64' can work now.

Xorg.0.log:

  
Re: drm on amd64 (drmMap failed)
user name
2007-04-06 01:17:23
Matt Thomas <matt3am-software.com> writes:

> Xning Lee wrote:
>> "Blair Sadewitz" <blair.sadewitzgmail.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 0x7fffffffffffffff: (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.
>

that because at line 190 in drm_bufs.c, the address
value('map->handle') that retured by 'malloc' has been
more than
0x7fffffffffffffff, then at line 197 in drm_bufs.c:

		map->offset = (unsigned long)map->handle;

Re: drm on amd64 (drmMap failed)
country flaguser name
United States
2007-04-06 10:52:19
On Apr 5, 2007, at 11:17 PM, Xning Lee wrote:

> Matt Thomas <matt3am-software.com>
writes:
>
>> Xning Lee wrote:
>>> "Blair Sadewitz"
<blair.sadewitzgmail.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 0x7fffffffffffffff: (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.
>>
>
> that because at line 190 in drm_bufs.c, the address
> value('map->handle') that retured by 'malloc' has
been more than
> 0x7fffffffffffffff, then at line 197 in drm_bufs.c:
>
> 		map->offset = (unsigned long)map->handle;

Since you can't use a malloc'ed address with mmap, it's
probably not  
that offset.
mmap wants a physical address, not a virtual address.

Re: drm on amd64 (drmMap failed)
user name
2007-04-06 11:43:42
Matt Thomas <matt3am-software.com> writes:

> On Apr 5, 2007, at 11:17 PM, Xning Lee wrote:
>
>> Matt Thomas <matt3am-software.com>
writes:
>>
>>> Xning Lee wrote:
>>>> "Blair Sadewitz"
<blair.sadewitzgmail.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 0x7fffffffffffffff:
(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.
>>>
>>
>> that because at line 190 in drm_bufs.c, the
address
>> value('map->handle') that retured by 'malloc'
has been more than
>> 0x7fffffffffffffff, then at line 197 in
drm_bufs.c:
>>
>> 		map->offset = (unsigned long)map->handle;
>
> Since you can't use a malloc'ed address with mmap, it's
probably not
> that offset.
> mmap wants a physical address, not a virtual address.
>

that is the offset, line 129 in current drm_vm.c:
{
     ...
	case _DRM_SHM:
		phys = vtophys(offset);
	break;
     ...
}

drm log:
========
[drm:pid613:drm_addmap] offset = 0x00000000, size =
0x00010000, type = 2
[drm:pid613:drm_addmap] Added map 2
0xffff8000368c0000/0x10000
                                   
^^^^^^^^^^^^^^^^^^^^^^^^^^
[drm:pid613:drm_addmap] offset = 0xfd400000, size =
0x00010000, type = 1
[drm:pid613:drm_ioremap] ioremap mem found:
0xffff8000368d0000
[drm:pid613:drm_addmap] Added map 1 0xfd400000/0x10000
[drm:pid613:drm_addmap] offset = 0xe8000000, size =
0x08000000, type = 0
[drm:pid613:drm_mtrr_add] offset=e8000000 size=134217728
[drm:pid613:drm_addmap] Added map 0 0xe8000000/0x8000000

Xorg log:
=========
(II) RADEON(0): [drm] DRM interface version 1.2
(II) RADEON(0): [drm] created "radeon" driver at
busid "pci:0000:01:00.0"
(II) RADEON(0): [drm] added 8192 byte SAREA at
0xffff8000368c0000 (drm_addmap_ioctl)
                                              
^^^^^^^^^^^^^^^^^^
(II) RADEON(0): [drm] drmMap failed (mmap offset:
0xffff8000368c0000)


Ultimately, the problem is: 

'mmap' offset provided in 'drm_vm.c' and 'drm_bufs.c' is not
a
physical address.

[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )