diff mbox

drm: Fix plane type uabi breakage

Message ID 1474612525-9488-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Sept. 23, 2016, 6:35 a.m. UTC
Turns out assuming that only stuff in uabi is uabi is a bit naive, and
we have a bunch of properties for which the enum values are placed in
random headers. A proper fix would be to split out uapi include
headers, but meanwhile sprinkle at least some warning over them.

Fixes: 532b36712ddf ("drm/doc: Polish for drm_plane.[hc]")
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 include/drm/drm_blend.h |  3 +++
 include/drm/drm_plane.h | 19 +++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

Comments

Jani Nikula Sept. 23, 2016, 6:44 a.m. UTC | #1
On Fri, 23 Sep 2016, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Turns out assuming that only stuff in uabi is uabi is a bit naive, and
> we have a bunch of properties for which the enum values are placed in
> random headers. A proper fix would be to split out uapi include
> headers, but meanwhile sprinkle at least some warning over them.
>
> Fixes: 532b36712ddf ("drm/doc: Polish for drm_plane.[hc]")
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> ---
>  include/drm/drm_blend.h |  3 +++
>  include/drm/drm_plane.h | 19 +++++++++++--------
>  2 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h
> index 868f0364e939..36baa175de99 100644
> --- a/include/drm/drm_blend.h
> +++ b/include/drm/drm_blend.h
> @@ -33,6 +33,9 @@ struct drm_atomic_state;
>   * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the
>   * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and
>   * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation
> + *
> + * WARNING: These defines are UABI since they're exposed in the rotation
> + * property.
>   */
>  #define DRM_ROTATE_0	BIT(0)
>  #define DRM_ROTATE_90	BIT(1)
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> index 256219bfd07b..43cf193e54d6 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -333,9 +333,20 @@ struct drm_plane_funcs {
>   * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
>   * wish to receive a universal plane list containing all plane types. See also
>   * drm_for_each_legacy_plane().
> + *
> + * WARNING: The values of this enum is UABI since they're exposed in the "type"
> + * property.
>   */
>  enum drm_plane_type {
>  	/**
> +	 * @DRM_PLANE_TYPE_OVERLAY:
> +	 *
> +	 * Overlay planes represent all non-primary, non-cursor planes. Some
> +	 * drivers refer to these types of planes as "sprites" internally.
> +	 */
> +	DRM_PLANE_TYPE_OVERLAY,
> +
> +	/**
>  	 * @DRM_PLANE_TYPE_PRIMARY:
>  	 *
>  	 * Primary planes represent a "main" plane for a CRTC.  Primary planes
> @@ -353,14 +364,6 @@ enum drm_plane_type {
>  	 * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
>  	 */
>  	DRM_PLANE_TYPE_CURSOR,
> -
> -	/**
> -	 * @DRM_PLANE_TYPE_OVERLAY:
> -	 *
> -	 * Overlay planes represent all non-primary, non-cursor planes. Some
> -	 * drivers refer to these types of planes as "sprites" internally.
> -	 */
> -	DRM_PLANE_TYPE_OVERLAY,
>  };
Archit Taneja Sept. 23, 2016, 6:53 a.m. UTC | #2
On 09/23/2016 12:05 PM, Daniel Vetter wrote:
> Turns out assuming that only stuff in uabi is uabi is a bit naive, and
> we have a bunch of properties for which the enum values are placed in
> random headers. A proper fix would be to split out uapi include
> headers, but meanwhile sprinkle at least some warning over them.
>
> Fixes: 532b36712ddf ("drm/doc: Polish for drm_plane.[hc]")
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Archit Taneja <architt@codeaurora.org>

> ---
>  include/drm/drm_blend.h |  3 +++
>  include/drm/drm_plane.h | 19 +++++++++++--------
>  2 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h
> index 868f0364e939..36baa175de99 100644
> --- a/include/drm/drm_blend.h
> +++ b/include/drm/drm_blend.h
> @@ -33,6 +33,9 @@ struct drm_atomic_state;
>   * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the
>   * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and
>   * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation
> + *
> + * WARNING: These defines are UABI since they're exposed in the rotation
> + * property.
>   */
>  #define DRM_ROTATE_0	BIT(0)
>  #define DRM_ROTATE_90	BIT(1)
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> index 256219bfd07b..43cf193e54d6 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -333,9 +333,20 @@ struct drm_plane_funcs {
>   * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
>   * wish to receive a universal plane list containing all plane types. See also
>   * drm_for_each_legacy_plane().
> + *
> + * WARNING: The values of this enum is UABI since they're exposed in the "type"
> + * property.
>   */
>  enum drm_plane_type {
>  	/**
> +	 * @DRM_PLANE_TYPE_OVERLAY:
> +	 *
> +	 * Overlay planes represent all non-primary, non-cursor planes. Some
> +	 * drivers refer to these types of planes as "sprites" internally.
> +	 */
> +	DRM_PLANE_TYPE_OVERLAY,
> +
> +	/**
>  	 * @DRM_PLANE_TYPE_PRIMARY:
>  	 *
>  	 * Primary planes represent a "main" plane for a CRTC.  Primary planes
> @@ -353,14 +364,6 @@ enum drm_plane_type {
>  	 * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
>  	 */
>  	DRM_PLANE_TYPE_CURSOR,
> -
> -	/**
> -	 * @DRM_PLANE_TYPE_OVERLAY:
> -	 *
> -	 * Overlay planes represent all non-primary, non-cursor planes. Some
> -	 * drivers refer to these types of planes as "sprites" internally.
> -	 */
> -	DRM_PLANE_TYPE_OVERLAY,
>  };
>
>
>
Sean Paul Sept. 23, 2016, 7:02 a.m. UTC | #3
On Thu, Sep 22, 2016 at 11:44 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Fri, 23 Sep 2016, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> Turns out assuming that only stuff in uabi is uabi is a bit naive, and
>> we have a bunch of properties for which the enum values are placed in
>> random headers. A proper fix would be to split out uapi include
>> headers, but meanwhile sprinkle at least some warning over them.
>>
>> Fixes: 532b36712ddf ("drm/doc: Polish for drm_plane.[hc]")
>> Cc: Archit Taneja <architt@codeaurora.org>
>> Cc: Sean Paul <seanpaul@chromium.org>
>> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>

Thanks, applied to drm-misc

Sean

>
>> ---
>>  include/drm/drm_blend.h |  3 +++
>>  include/drm/drm_plane.h | 19 +++++++++++--------
>>  2 files changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h
>> index 868f0364e939..36baa175de99 100644
>> --- a/include/drm/drm_blend.h
>> +++ b/include/drm/drm_blend.h
>> @@ -33,6 +33,9 @@ struct drm_atomic_state;
>>   * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the
>>   * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and
>>   * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation
>> + *
>> + * WARNING: These defines are UABI since they're exposed in the rotation
>> + * property.
>>   */
>>  #define DRM_ROTATE_0 BIT(0)
>>  #define DRM_ROTATE_90        BIT(1)
>> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
>> index 256219bfd07b..43cf193e54d6 100644
>> --- a/include/drm/drm_plane.h
>> +++ b/include/drm/drm_plane.h
>> @@ -333,9 +333,20 @@ struct drm_plane_funcs {
>>   * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
>>   * wish to receive a universal plane list containing all plane types. See also
>>   * drm_for_each_legacy_plane().
>> + *
>> + * WARNING: The values of this enum is UABI since they're exposed in the "type"
>> + * property.
>>   */
>>  enum drm_plane_type {
>>       /**
>> +      * @DRM_PLANE_TYPE_OVERLAY:
>> +      *
>> +      * Overlay planes represent all non-primary, non-cursor planes. Some
>> +      * drivers refer to these types of planes as "sprites" internally.
>> +      */
>> +     DRM_PLANE_TYPE_OVERLAY,
>> +
>> +     /**
>>        * @DRM_PLANE_TYPE_PRIMARY:
>>        *
>>        * Primary planes represent a "main" plane for a CRTC.  Primary planes
>> @@ -353,14 +364,6 @@ enum drm_plane_type {
>>        * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
>>        */
>>       DRM_PLANE_TYPE_CURSOR,
>> -
>> -     /**
>> -      * @DRM_PLANE_TYPE_OVERLAY:
>> -      *
>> -      * Overlay planes represent all non-primary, non-cursor planes. Some
>> -      * drivers refer to these types of planes as "sprites" internally.
>> -      */
>> -     DRM_PLANE_TYPE_OVERLAY,
>>  };
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h
index 868f0364e939..36baa175de99 100644
--- a/include/drm/drm_blend.h
+++ b/include/drm/drm_blend.h
@@ -33,6 +33,9 @@  struct drm_atomic_state;
  * Rotation property bits. DRM_ROTATE_<degrees> rotates the image by the
  * specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and
  * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation
+ *
+ * WARNING: These defines are UABI since they're exposed in the rotation
+ * property.
  */
 #define DRM_ROTATE_0	BIT(0)
 #define DRM_ROTATE_90	BIT(1)
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 256219bfd07b..43cf193e54d6 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -333,9 +333,20 @@  struct drm_plane_funcs {
  * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
  * wish to receive a universal plane list containing all plane types. See also
  * drm_for_each_legacy_plane().
+ *
+ * WARNING: The values of this enum is UABI since they're exposed in the "type"
+ * property.
  */
 enum drm_plane_type {
 	/**
+	 * @DRM_PLANE_TYPE_OVERLAY:
+	 *
+	 * Overlay planes represent all non-primary, non-cursor planes. Some
+	 * drivers refer to these types of planes as "sprites" internally.
+	 */
+	DRM_PLANE_TYPE_OVERLAY,
+
+	/**
 	 * @DRM_PLANE_TYPE_PRIMARY:
 	 *
 	 * Primary planes represent a "main" plane for a CRTC.  Primary planes
@@ -353,14 +364,6 @@  enum drm_plane_type {
 	 * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
 	 */
 	DRM_PLANE_TYPE_CURSOR,
-
-	/**
-	 * @DRM_PLANE_TYPE_OVERLAY:
-	 *
-	 * Overlay planes represent all non-primary, non-cursor planes. Some
-	 * drivers refer to these types of planes as "sprites" internally.
-	 */
-	DRM_PLANE_TYPE_OVERLAY,
 };