Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the paddings in this data structure?
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
On 16/10/14 15:33, Cheng, Yao wrote:
Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the paddings in this data structure?
Afaict for compatibility reasons the struct size have to be "aligned" (multiple of 8 bytes), or if you prefer - the struct is missing the required padding :) I've only skimmed through the patch so it may be that other structs are having this issue.
Cheers, Emil
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
Thx Emil. Understood now. Will re-scan the data structures and update.
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Thursday, October 16, 2014 11:20 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
On 16/10/14 15:33, Cheng, Yao wrote:
Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the paddings
in this data structure?
Afaict for compatibility reasons the struct size have to be "aligned" (multiple of 8 bytes), or if you prefer - the struct is missing the required padding :) I've only skimmed through the patch so it may be that other structs are having this issue.
Cheers, Emil
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
Thanks for Emil's suggestion. You are right, we need make sure structure size aligned on 8 bytes, which is important for 32bit-64bit compatible case.
Fei -----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Thursday, October 16, 2014 11:20 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
On 16/10/14 15:33, Cheng, Yao wrote:
Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the paddings in this data structure?
Afaict for compatibility reasons the struct size have to be "aligned" (multiple of 8 bytes), or if you prefer - the struct is missing the required padding :) I've only skimmed through the patch so it may be that other structs are having this issue.
Cheers, Emil
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
Hi,
On 17 October 2014 01:36, Jiang, Fei fei.jiang@intel.com wrote:
Thanks for Emil's suggestion. You are right, we need make sure structure size aligned on 8 bytes, which is important for 32bit-64bit compatible case.
While you're at it, please don't use enum as a type inside ioctls, since the size can vary by compiler. Please use a uint32_t or whatever instead, assigning enum values to that.
Cheers, Daniel
Fei
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Thursday, October 16, 2014 11:20 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
On 16/10/14 15:33, Cheng, Yao wrote:
Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the
paddings in this data structure?
Afaict for compatibility reasons the struct size have to be "aligned" (multiple of 8 bytes), or if you prefer - the struct is missing the required padding :) I've only skimmed through the patch so it may be that other structs are having this issue.
Cheers, Emil
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel, we’ve resolved this in patch v2.
From: Daniel Stone [mailto:daniel@fooishbar.org] Sent: Wednesday, October 29, 2014 0:56 To: Jiang, Fei Cc: Emil Velikov; Cheng, Yao; intel-gfx@lists.freedesktop.org; Vetter, Daniel; dri-devel@lists.freedesktop.org Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi,
On 17 October 2014 01:36, Jiang, Fei <fei.jiang@intel.commailto:fei.jiang@intel.com> wrote: Thanks for Emil's suggestion. You are right, we need make sure structure size aligned on 8 bytes, which is important for 32bit-64bit compatible case.
While you're at it, please don't use enum as a type inside ioctls, since the size can vary by compiler. Please use a uint32_t or whatever instead, assigning enum values to that.
Cheers, Daniel
Fei -----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.commailto:emil.l.velikov@gmail.com] Sent: Thursday, October 16, 2014 11:20 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.orgmailto:intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.commailto:emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.orgmailto:dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
On 16/10/14 15:33, Cheng, Yao wrote:
Hi Emil, Sorry, what do you mean by "correctly aligned"? does it mean the paddings in this data structure?
Afaict for compatibility reasons the struct size have to be "aligned" (multiple of 8 bytes), or if you prefer - the struct is missing the required padding :) I've only skimmed through the patch so it may be that other structs are having this issue.
Cheers, Emil
-----Original Message----- From: Emil Velikov [mailto:emil.l.velikov@gmail.commailto:emil.l.velikov@gmail.com] Sent: Wednesday, October 15, 2014 5:24 PM To: Cheng, Yao; intel-gfx@lists.freedesktop.orgmailto:intel-gfx@lists.freedesktop.org Cc: emil.l.velikov@gmail.commailto:emil.l.velikov@gmail.com; Jiang, Fei; dri-devel@lists.freedesktop.orgmailto:dri-devel@lists.freedesktop.org; Vetter, Daniel Subject: Re: [RFC PATCH 3/3] libdrm: user mode helper for ipvr drm driver
Hi Yao,
struct drm_ipvr_gem_userptr does not seem to be correctly aligned - is that intentional ? Might be worth checking if anything else in ipvr_drm.h and ipvr_bufmgr.h is in the same boat.
Cheers, Emil
_______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.orgmailto:dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
On Tue, Oct 28, 2014 at 04:56:03PM +0000, Daniel Stone wrote:
Hi,
On 17 October 2014 01:36, Jiang, Fei fei.jiang@intel.com wrote:
Thanks for Emil's suggestion. You are right, we need make sure structure size aligned on 8 bytes, which is important for 32bit-64bit compatible case.
While you're at it, please don't use enum as a type inside ioctls, since the size can vary by compiler. Please use a uint32_t or whatever instead, assigning enum values to that.
Quick correction: You must use __u32 and friends, since using the standard C typesdef might collide with some program which defines them a different way. The double underscore ones are explicit ok per the C standard as private types for the system library. So they're the only ones we can use in userspace headers.
I've thought checkpatch would bitch about this if you get it wrong, now that we have the uapi split ... -Daniel
dri-devel@lists.freedesktop.org