diff options
author | Kristian H. Kristensen <hoegsberg@gmail.com> | 2016-09-13 14:20:45 -0700 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2016-09-15 10:42:11 -0400 |
commit | a988588b1806b40ae115fe1c9ab38706fd1a7c2b (patch) | |
tree | 468e8a20c642a6f40bea2f1e5668e10d47942985 /drivers/gpu/drm/drm_ioc32.c | |
parent | 96c594ba4f98ac957f4e597c77410a8132013a2d (diff) | |
download | linux-a988588b1806b40ae115fe1c9ab38706fd1a7c2b.tar.gz linux-a988588b1806b40ae115fe1c9ab38706fd1a7c2b.tar.bz2 linux-a988588b1806b40ae115fe1c9ab38706fd1a7c2b.zip |
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 <robdclark@gmail.com>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
[seanpaul added not at bottom of commit msg re: modifier]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1473801645-116011-1-git-send-email-hoegsberg@chromium.org
Diffstat (limited to 'drivers/gpu/drm/drm_ioc32.c')
-rw-r--r-- | drivers/gpu/drm/drm_ioc32.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 32a489b0faff..5f896e723f73 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -1016,6 +1016,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, return 0; } +#if defined(CONFIG_X86) || defined(CONFIG_IA64) typedef struct drm_mode_fb_cmd232 { u32 fb_id; u32 width; @@ -1072,6 +1073,7 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd, return 0; } +#endif static drm_ioctl_compat_t *drm_compat_ioctls[] = { [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version, @@ -1105,7 +1107,9 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = { [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw, #endif [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank, +#if defined(CONFIG_X86) || defined(CONFIG_IA64) [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2, +#endif }; /** |