Skip to content

Commit 47a66e4

Browse files
krhairlied
authored andcommitted
drm: Only use compat ioctl for addfb2 on X86/IA64
Similar to struct drm_update_draw, struct drm_mode_fb_cmd2 has an unaligned 64 bit field (modifier). This get packed differently between 32 bit and 64 bit modes on architectures that can handle unaligned 64 bit access (X86 and IA64). Other architectures pack the structs the same and don't need the compat wrapper. Use the same condition for drm_mode_fb_cmd2 as we use for drm_update_draw. Note that only the modifier will be packed differently between compat and non-compat versions. Reviewed-by: Rob Clark <[email protected]> Signed-off-by: Kristian H. Kristensen <[email protected]> [seanpaul added not at bottom of commit msg re: modifier] Signed-off-by: Sean Paul <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
1 parent f254324 commit 47a66e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/drm_ioc32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
10151015
return 0;
10161016
}
10171017

1018+
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
10181019
typedef struct drm_mode_fb_cmd232 {
10191020
u32 fb_id;
10201021
u32 width;
@@ -1071,6 +1072,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd,
10711072

10721073
return 0;
10731074
}
1075+
#endif
10741076

10751077
static drm_ioctl_compat_t *drm_compat_ioctls[] = {
10761078
[DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version,
@@ -1104,7 +1106,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = {
11041106
[DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw,
11051107
#endif
11061108
[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank,
1109+
#if defined(CONFIG_X86) || defined(CONFIG_IA64)
11071110
[DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2,
1111+
#endif
11081112
};
11091113

11101114
/**

0 commit comments

Comments
 (0)