All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64
@ 2016-09-13 21:20 Kristian H. Kristensen
  2016-09-14 17:00 ` Rob Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Kristian H. Kristensen @ 2016-09-13 21:20 UTC (permalink / raw)
  To: dri-devel; +Cc: Kristian H. Kristensen

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.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
---
 drivers/gpu/drm/drm_ioc32.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 57676f8..a628975 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -1015,6 +1015,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;
@@ -1071,6 +1072,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,
@@ -1104,7 +1106,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
 };
 
 /**
-- 
2.8.0.rc3.226.g39d4020

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64
  2016-09-13 21:20 [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64 Kristian H. Kristensen
@ 2016-09-14 17:00 ` Rob Clark
  2016-09-15 14:44   ` Sean Paul
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Clark @ 2016-09-14 17:00 UTC (permalink / raw)
  To: Kristian H. Kristensen; +Cc: Kristian H. Kristensen, dri-devel

On Tue, Sep 13, 2016 at 5:20 PM, Kristian H. Kristensen
<hoegsberg@gmail.com> wrote:
> 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.

might not hurt to mention that this only effects stuff using modifiers
in commit msg

Reviewed-by: Rob Clark <robdclark@gmail.com>

> Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
> ---
>  drivers/gpu/drm/drm_ioc32.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
> index 57676f8..a628975 100644
> --- a/drivers/gpu/drm/drm_ioc32.c
> +++ b/drivers/gpu/drm/drm_ioc32.c
> @@ -1015,6 +1015,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;
> @@ -1071,6 +1072,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,
> @@ -1104,7 +1106,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
>  };
>
>  /**
> --
> 2.8.0.rc3.226.g39d4020
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64
  2016-09-14 17:00 ` Rob Clark
@ 2016-09-15 14:44   ` Sean Paul
  0 siblings, 0 replies; 3+ messages in thread
From: Sean Paul @ 2016-09-15 14:44 UTC (permalink / raw)
  To: Rob Clark; +Cc: Kristian H. Kristensen, Kristian H. Kristensen, dri-devel

On Wed, Sep 14, 2016 at 1:00 PM, Rob Clark <robdclark@gmail.com> wrote:
> On Tue, Sep 13, 2016 at 5:20 PM, Kristian H. Kristensen
> <hoegsberg@gmail.com> wrote:
>> 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.
>
> might not hurt to mention that this only effects stuff using modifiers
> in commit msg
>
> Reviewed-by: Rob Clark <robdclark@gmail.com>


Added the note to the commit msg and applied to drm-misc

Sean

>
>> Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
>> ---
>>  drivers/gpu/drm/drm_ioc32.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
>> index 57676f8..a628975 100644
>> --- a/drivers/gpu/drm/drm_ioc32.c
>> +++ b/drivers/gpu/drm/drm_ioc32.c
>> @@ -1015,6 +1015,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;
>> @@ -1071,6 +1072,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,
>> @@ -1104,7 +1106,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
>>  };
>>
>>  /**
>> --
>> 2.8.0.rc3.226.g39d4020
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-15 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13 21:20 [PATCH] drm: Only use compat ioctl for addfb2 on X86/IA64 Kristian H. Kristensen
2016-09-14 17:00 ` Rob Clark
2016-09-15 14:44   ` Sean Paul

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.