All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Noland <rnoland@2hip.net>
To: Dave Airlie <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org, matthew@bells23.org.uk
Subject: Re: [PATCH] drm_handle_t type
Date: Wed, 14 Apr 2010 12:36:49 -0500	[thread overview]
Message-ID: <4BC5FD31.8020306@2hip.net> (raw)
In-Reply-To: <i2j21d7e9971004132046gf8712008z4e673f0c9c2234eb@mail.gmail.com>



Dave Airlie wrote:
> On Wed, Apr 14, 2010 at 1:32 PM, Robert Noland <rnoland@2hip.net> wrote:
>> On Wed, 2010-04-14 at 00:19 +0100, Matthew W. S. Bell wrote:
>>> On Sun, 2010-04-11 at 09:10 -0500, Robert Noland wrote:
>>>> On Sat, 2010-04-10 at 19:30 +0100, Matthew W. S. Bell wrote:
>>>>> On Mon, 2010-04-05 at 17:46 +1000, Dave Airlie wrote:
>>>>>> Its probably not documented well anywhere, though I think the handles are
>>>>>> 32-bit is written down somewhere.
>>>>> Ah sorry, I missed some.
>>>> drm_handle_t is correct here...
>>> No, drm_handle_t can be of a different size to void *; converting
>>> between integers and pointers of different sizes causes a warning. To
>>> eliminate the warning, the value first needs to be passed between
>>> uintptr_t and void *, which are of the same size, and then converted to
>>> drm_handle_t. The last part is implicit; the drm_handle_t casts are
>>> irrelevant/useless.
>> My point being that the casts to drm_handle_t are correct.  Feel free to
>> fix linux' define for drm_handle_t.
>>
> 
> Weird the drm is defined on Linux and is considered the standard, and
> uint32_t is considered correct handle sizing on Linux.
> 
> I'm not sure why FreeBSD didn't change to 32-bit handles at the same
> time, I think nobody wanted to break stuff by accident at the time,
> assuming FreeBSD maintainers would take care of it.

drm_handle_t is passed directly to mmap() and on FreeBSD that is 
expected to be an offset into the device memory.  If drm_handle_t were 
only a handle, this would all be fine, but due to the fact that it's 
meaning is overloaded and is supposed to represent the KVA as well, it 
either needs to vary with the architecture or be 64bits...  Last time I 
looked at just making it 64bits everywhere, some minor fixups and API 
breakage would have been required in the DDX drivers, which was too much 
trouble to argue about...

The define on FreeBSD is an unsigned long, which works fine on 32/64 bit 
platforms with current DDX drivers and doesn't produce warnings.

robert.

> Dave.

  reply	other threads:[~2010-04-14 17:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-03  1:59 [PATCH] typdef uintptr_t drm_handle_t; unsigned int is wrong on 64-bit Matthew W. S. Bell
2010-04-03  7:49 ` Dave Airlie
2010-04-03 13:09   ` Matthew W. S. Bell
2010-04-05  7:46     ` Dave Airlie
2010-04-06 20:14       ` Robert Noland
2010-04-09  2:05       ` [PATCH] drm_handle_t type Matthew W. S. Bell
2010-04-10 18:30       ` Matthew W. S. Bell
2010-04-11 14:10         ` Robert Noland
2010-04-13 23:19           ` Matthew W. S. Bell
2010-04-14  3:26             ` Robert Noland
2010-04-14  3:32             ` Robert Noland
2010-04-14  3:46               ` Dave Airlie
2010-04-14 17:36                 ` Robert Noland [this message]
2010-04-14 16:15               ` Matthew W. S. Bell
2010-04-03 21:57   ` [PATCH] typdef uintptr_t drm_handle_t; unsigned int is wrong on 64-bit Matthew W. S. Bell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC5FD31.8020306@2hip.net \
    --to=rnoland@2hip.net \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=matthew@bells23.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.