diff mbox series

[libdrm] xf86drm: Add signed32 rectangle

Message ID 20180905234751.2400-1-drawat@vmware.com (mailing list archive)
State New, archived
Headers show
Series [libdrm] xf86drm: Add signed32 rectangle | expand

Commit Message

Deepak Singh Rawat Sept. 5, 2018, 11:47 p.m. UTC
With drm subsystem using struct drm_rect to manage rectangular area this
export it to user-space.

Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
---
 include/drm/drm_mode.h | 19 +++++++++++++++++++
 xf86drmMode.h          |  2 ++
 2 files changed, 21 insertions(+)

Comments

Emil Velikov Sept. 7, 2018, 2:27 p.m. UTC | #1
Hi Deepak,

On 6 September 2018 at 00:47, Deepak Rawat <drawat@vmware.com> wrote:
> With drm subsystem using struct drm_rect to manage rectangular area this
> export it to user-space.
>
> Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.
>

> --- a/include/drm/drm_mode.h
> +++ b/include/drm/drm_mode.h

Please see include/drm/README for details how include/drm/ should be updated.


> --- a/xf86drmMode.h
> +++ b/xf86drmMode.h
> @@ -338,6 +338,8 @@ typedef struct _drmModePlaneRes {
>         uint32_t *planes;
>  } drmModePlaneRes, *drmModePlaneResPtr;
>
> +typedef struct drm_mode_rect drmModeRect, *drmModeRectPtr;
> +
Since there's no API which (directly) uses drmModeRect I'd stick with
the original name and drop the typedef?
Otherwise it's fairly confusing to have it as-is.

HTH
Emil
diff mbox series

Patch

diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index 5f9fadbd..9e7bdc26 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -855,6 +855,25 @@  struct drm_mode_revoke_lease {
 	__u32 lessee_id;
 };
 
+/**
+ * struct drm_mode_rect - two dimensional rectangle
+ * @x1: horizontal starting coordinate (inclusive)
+ * @y1: vertical starting coordinate (inclusive)
+ * @x2: horizontal ending coordinate (exclusive)
+ * @y2: vertical ending coordinate (exclusive)
+ *
+ * With drm subsystem using struct drm_rect to manage rectangular area this
+ * export it to user-space.
+ *
+ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS.
+ */
+struct drm_mode_rect {
+	__s32 x1;
+	__s32 y1;
+	__s32 x2;
+	__s32 y2;
+};
+
 #if defined(__cplusplus)
 }
 #endif
diff --git a/xf86drmMode.h b/xf86drmMode.h
index 3cd27aee..a066e2b8 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -338,6 +338,8 @@  typedef struct _drmModePlaneRes {
 	uint32_t *planes;
 } drmModePlaneRes, *drmModePlaneResPtr;
 
+typedef struct drm_mode_rect drmModeRect, *drmModeRectPtr;
+
 extern void drmModeFreeModeInfo( drmModeModeInfoPtr ptr );
 extern void drmModeFreeResources( drmModeResPtr ptr );
 extern void drmModeFreeFB( drmModeFBPtr ptr );