public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bing Bu Cao <bingbu.cao@linux.intel.com>
To: "Zhang, Ning A" <ning.a.zhang@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: question about V4L2_MEMORY_USERPTR on 64bit applications
Date: Fri, 12 Oct 2018 11:25:56 +0800	[thread overview]
Message-ID: <91f5d31a-d60e-c810-6b0c-23edddef6f1c@linux.intel.com> (raw)
In-Reply-To: <1539313441.21249.3.camel@intel.com>

Hi, Ning,

unsigned long   userptr; <<<--- this is a 32bit addr.

I think it's wrong here,for LP64 data modelmachine(unix-like systems), the
actual size ofdata type 'unsigned long'is 8(64bits value)whichis equal
to pointer.
 

On 10/12/2018 11:04 AM, Zhang, Ning A wrote:
> Hi,
>
> I have question about V4L2_MEMORY_USERPTR on 64bit applications.
>
> struct v4l2_buffer {
> 	__u32			index;
> 	__u32			type;
> 	__u32			bytesused;
> 	__u32			flags;
> 	__u32			field;
> 	struct timeval		timestamp;
> 	struct v4l2_timecode	timecode;
> 	__u32			sequence;
>
> 	/* memory location */
> 	__u32			memory;
> 	union {
> 		__u32           offset;
> 		unsigned long   userptr;   <<<--- this is a 32bit addr.
> 		struct v4l2_plane *planes;
> 		__s32		fd;
> 	} m;
> 	__u32			length;
> 	__u32			reserved2;
> 	__u32			reserved;
> };
>
> when use a 64bit application, memory from malloc is 64bit address.
> memory from GPU (eg, intel i915) are also 64bit address.
>
> when use these kind of memory as V4L2_MEMORY_USERPTR, address will be
> truncated into 32bit.
>
> this would be error, but actually not. I really don't understand.
>
> BR.
> Ning.


  reply	other threads:[~2018-10-12  3:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12  3:04 question about V4L2_MEMORY_USERPTR on 64bit applications Zhang, Ning A
2018-10-12  3:25 ` Bing Bu Cao [this message]
2018-10-12  4:33 ` Zhang, Ning A
2018-10-12  5:22   ` tbhardwa
2018-10-14  0:11     ` Eugene Syromiatnikov

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=91f5d31a-d60e-c810-6b0c-23edddef6f1c@linux.intel.com \
    --to=bingbu.cao@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=ning.a.zhang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox