diff mbox

drm/i915: fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl

Message ID 1427399236-14012-1-git-send-email-tt.rantala@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tommi Rantala March 26, 2015, 7:47 p.m. UTC
Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
---
 include/uapi/drm/i915_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula March 27, 2015, 6:39 a.m. UTC | #1
On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
> Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
> is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
>
> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>

Whoa. Broken since its introduction in

commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Tue Jan 3 08:05:39 2012 -0800

    drm/i915: add color key support v4

Cc: stable@vger.kernel.org

BR,
Jani.


> ---
>  include/uapi/drm/i915_drm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 6eed16b..0e9c835 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -270,7 +270,7 @@ typedef struct _drm_i915_sarea {
>  #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE	DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
>  #define DRM_IOCTL_I915_OVERLAY_ATTRS	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
>  #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
> -#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
> +#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
>  #define DRM_IOCTL_I915_GEM_WAIT		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
>  #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
>  #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
> -- 
> 2.1.0
>
Daniel Vetter March 27, 2015, 8:04 a.m. UTC | #2
On Fri, Mar 27, 2015 at 08:39:56AM +0200, Jani Nikula wrote:
> On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
> > Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
> > is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
> >
> > Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> 
> Whoa. Broken since its introduction in
> 
> commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Tue Jan 3 08:05:39 2012 -0800
> 
>     drm/i915: add color key support v4
> 
> Cc: stable@vger.kernel.org

Nope, we'll just rip it out and replace it all with the drm_noop ioctl. At
least I didn't find any userspace anywhere and only broken definitions.
Proof enough this isn't useful.

Even more so since that means we don't have to convert the get ioctl over
to atomic, yay! I'll send patches.
-Daniel
Jesse Barnes March 27, 2015, 3:17 p.m. UTC | #3
On 03/26/2015 11:39 PM, Jani Nikula wrote:
> On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
>> Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
>> is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
>>
>> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> 
> Whoa. Broken since its introduction in
> 
> commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Tue Jan 3 08:05:39 2012 -0800
> 
>     drm/i915: add color key support v4
> 
> Cc: stable@vger.kernel.org
> 
> BR,
> Jani.
> 
> 
>> ---
>>  include/uapi/drm/i915_drm.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
>> index 6eed16b..0e9c835 100644
>> --- a/include/uapi/drm/i915_drm.h
>> +++ b/include/uapi/drm/i915_drm.h
>> @@ -270,7 +270,7 @@ typedef struct _drm_i915_sarea {
>>  #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE	DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
>>  #define DRM_IOCTL_I915_OVERLAY_ATTRS	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
>>  #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
>> -#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
>> +#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
>>  #define DRM_IOCTL_I915_GEM_WAIT		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
>>  #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
>>  #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)

Hah, I guess that must be a well used ioctl!  Not even the test program
does a get call!

Jesse
Jesse Barnes March 27, 2015, 3:18 p.m. UTC | #4
On 03/27/2015 01:04 AM, Daniel Vetter wrote:
> On Fri, Mar 27, 2015 at 08:39:56AM +0200, Jani Nikula wrote:
>> On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
>>> Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
>>> is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
>>>
>>> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
>>
>> Whoa. Broken since its introduction in
>>
>> commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
>> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
>> Date:   Tue Jan 3 08:05:39 2012 -0800
>>
>>     drm/i915: add color key support v4
>>
>> Cc: stable@vger.kernel.org
> 
> Nope, we'll just rip it out and replace it all with the drm_noop ioctl. At
> least I didn't find any userspace anywhere and only broken definitions.
> Proof enough this isn't useful.
> 
> Even more so since that means we don't have to convert the get ioctl over
> to atomic, yay! I'll send patches.

Can we just skip the noop part and delete it altogether?  It was only
added speculatively and obviously never used at all...
Daniel Vetter March 30, 2015, 6:54 a.m. UTC | #5
On Fri, Mar 27, 2015 at 08:18:28AM -0700, Jesse Barnes wrote:
> On 03/27/2015 01:04 AM, Daniel Vetter wrote:
> > On Fri, Mar 27, 2015 at 08:39:56AM +0200, Jani Nikula wrote:
> >> On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
> >>> Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
> >>> is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
> >>>
> >>> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> >>
> >> Whoa. Broken since its introduction in
> >>
> >> commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
> >> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> >> Date:   Tue Jan 3 08:05:39 2012 -0800
> >>
> >>     drm/i915: add color key support v4
> >>
> >> Cc: stable@vger.kernel.org
> > 
> > Nope, we'll just rip it out and replace it all with the drm_noop ioctl. At
> > least I didn't find any userspace anywhere and only broken definitions.
> > Proof enough this isn't useful.
> > 
> > Even more so since that means we don't have to convert the get ioctl over
> > to atomic, yay! I'll send patches.
> 
> Can we just skip the noop part and delete it altogether?  It was only
> added speculatively and obviously never used at all...

The table is indexed, we need a dummy entry. I guess we could do a
drm_invalid_ioctl function too for these, but then whether you get an
error or not doesn't really matter for unused ioctls. Hence I've stuck
with drm_noop for all these removed ioctl (except when we need a more
tailore-made lie to keep userspace happy).
-Daniel
Ville Syrjala March 30, 2015, 8 a.m. UTC | #6
On Mon, Mar 30, 2015 at 08:54:55AM +0200, Daniel Vetter wrote:
> On Fri, Mar 27, 2015 at 08:18:28AM -0700, Jesse Barnes wrote:
> > On 03/27/2015 01:04 AM, Daniel Vetter wrote:
> > > On Fri, Mar 27, 2015 at 08:39:56AM +0200, Jani Nikula wrote:
> > >> On Thu, 26 Mar 2015, Tommi Rantala <tt.rantala@gmail.com> wrote:
> > >>> Fix definition of the DRM_IOCTL_I915_GET_SPRITE_COLORKEY ioctl, so that it
> > >>> is different from the DRM_IOCTL_I915_SET_SPRITE_COLORKEY ioctl.
> > >>>
> > >>> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> > >>
> > >> Whoa. Broken since its introduction in
> > >>
> > >> commit 8ea30864229e54b01ac0e9fe88c4b733a940ec4e
> > >> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> > >> Date:   Tue Jan 3 08:05:39 2012 -0800
> > >>
> > >>     drm/i915: add color key support v4
> > >>
> > >> Cc: stable@vger.kernel.org
> > > 
> > > Nope, we'll just rip it out and replace it all with the drm_noop ioctl. At
> > > least I didn't find any userspace anywhere and only broken definitions.
> > > Proof enough this isn't useful.
> > > 
> > > Even more so since that means we don't have to convert the get ioctl over
> > > to atomic, yay! I'll send patches.
> > 
> > Can we just skip the noop part and delete it altogether?  It was only
> > added speculatively and obviously never used at all...
> 
> The table is indexed, we need a dummy entry.

We shouldn't need any dummies. Any missing entry in the table will
be zeroed, so we should simply return -EINVAL due to ioctl->func==NULL.
diff mbox

Patch

diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 6eed16b..0e9c835 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -270,7 +270,7 @@  typedef struct _drm_i915_sarea {
 #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE	DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
 #define DRM_IOCTL_I915_OVERLAY_ATTRS	DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
 #define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
-#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
+#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
 #define DRM_IOCTL_I915_GEM_WAIT		DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
 #define DRM_IOCTL_I915_GEM_CONTEXT_CREATE	DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
 #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY	DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)