Skip to contentSkip to conversation

xf86drm: Add signed32 rectangle

PATCH In review Deepak Rawat 2 participants 2 messages Sep 5, 2018 – Sep 7, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xf86drm: Add signed32 rectangle

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.

---
 include/drm/drm_mode.h | 19 +++++++++++++++++++
 xf86drmMode.h          |  2 ++
 2 files changed, 21 insertions(+)
include/drm/drm_mode.h +19 -0
index 5f9fadbd..9e7bdc26 100644
@@ -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
xf86drmMode.h +2 -0
index 3cd27aee..a066e2b8 100644
@@ -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 );
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

Hi Deepak,

include/drm/drm_mode.h

Quoted 8 lines · Deepak Rawat

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.

include/drm/drm_mode.h +0 -0

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

xf86drmMode.h typedef struct _drmModePlaneRes { · line 342

Quoted 8 lines
xf86drmMode.h +2 -0
@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel