From patchwork Sun May 14 17:26:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 9725827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29FFF60231 for ; Sun, 14 May 2017 17:26:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 064BD28936 for ; Sun, 14 May 2017 17:26:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB16828952; Sun, 14 May 2017 17:26:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1865828936 for ; Sun, 14 May 2017 17:26:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A5E989EFF; Sun, 14 May 2017 17:26:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4710389EFF for ; Sun, 14 May 2017 17:26:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: robertfoss) with ESMTPSA id 2798C26128C From: Robert Foss To: dri-devel@lists.freedesktop.org, Tomeu Vizoso , Emil Velikov , Daniel Vetter , =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Subject: [PATCH v1] drm: Add DRM_ROTATE_ and DRM_REFLECT_ defines to UAPI Date: Sun, 14 May 2017 13:26:37 -0400 Message-Id: <20170514172637.28937-1-robert.foss@collabora.com> X-Mailer: git-send-email 2.11.0.453.g787f75f05 Cc: Robert Foss , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add DRM_ROTATE_ and DRM_REFLECT_ defines to the UAPI as a convenience. Ideally the DRM_ROTATE_ and DRM_REFLECT_ property ids are looked up through the atomic API, but realizing that userspace is likely to take shortcuts and assume that the enum values are what is sent over the wire. As a result these defines are provided purely as a convenience to userspace applications. Signed-off-by: Robert Foss --- drivers/gpu/drm/drm_rect.c | 1 + include/drm/drm_blend.h | 18 ------------ include/uapi/drm/drm.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c index bc5575960ebc..bdb27434bb10 100644 --- a/drivers/gpu/drm/drm_rect.c +++ b/drivers/gpu/drm/drm_rect.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h index 13221cf9b3eb..d149a63b893b 100644 --- a/include/drm/drm_blend.h +++ b/include/drm/drm_blend.h @@ -29,24 +29,6 @@ struct drm_device; struct drm_atomic_state; -/* - * Rotation property bits. DRM_ROTATE_ 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) -#define DRM_ROTATE_180 BIT(2) -#define DRM_ROTATE_270 BIT(3) -#define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ - DRM_ROTATE_180 | DRM_ROTATE_270) -#define DRM_REFLECT_X BIT(4) -#define DRM_REFLECT_Y BIT(5) -#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y) - static inline bool drm_rotation_90_or_270(unsigned int rotation) { return rotation & (DRM_ROTATE_90 | DRM_ROTATE_270); diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index 42d9f64ce416..d7140b0091bc 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -697,6 +697,79 @@ struct drm_prime_handle { __s32 fd; }; +/** DRM_ROTATE_0 + * + * Signals that a drm plane has been rotated 0 degrees. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_ROTATE_0 BIT(0) + +/** DRM_ROTATE_90 + * + * Signals that a drm plane has been rotated 90 degrees in counter clockwise + * direction. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_ROTATE_90 BIT(1) + +/** DRM_ROTATE_180 + * + * Signals that a drm plane has been rotated 180 degrees in counter clockwise + * direction. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_ROTATE_180 BIT(2) + +/** DRM_ROTATE_270 + * + * Signals that a drm plane has been rotated 270 degrees in counter clockwise + * direction. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_ROTATE_270 BIT(3) + + +/** DRM_ROTATE_MASK + * + * Bitmask used to look for drm plane rotations. + */ +#define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ + DRM_ROTATE_180 | DRM_ROTATE_270) + +/** DRM_REFLECT_X + * + * Signals that a drm plane has been reflected in the X axis. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_REFLECT_X BIT(4) + +/** DRM_REFLECT_Y + * + * Signals that a drm plane has been reflected in the Y axis. + * + * This define is provided as a convenience, looking up the property id + * using the name->prop id lookup is the preferred method. + */ +#define DRM_REFLECT_Y BIT(5) + + +/** DRM_REFLECT_MASK + * + * Bitmask used to look for drm plane reflections. + */ +#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y) + + #if defined(__cplusplus) } #endif