From: Damien Lespiau Subject: [PATCH i-g-t 04/43] igt_kms: Add a way to query of the plane supports rotation Date: Thu, 10 Jul 2014 19:00:05 +0100 Message-ID: <1405015244-11370-5-git-send-email-damien.lespiau@intel.com> References: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 9516C6E1F3 for ; Thu, 10 Jul 2014 11:01:12 -0700 (PDT) In-Reply-To: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Signed-off-by: Damien Lespiau --- lib/igt_kms.c | 7 +++++++ lib/igt_kms.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 5c8a3cc..87f5109 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -592,6 +592,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) /* add the planes that can be used with that pipe */ for (j = 0; j < plane_resources->count_planes; j++) { drmModePlane *drm_plane; + uint64_t prop_value; drm_plane = drmModeGetPlane(display->drm_fd, plane_resources->planes[j]); @@ -632,6 +633,12 @@ void igt_display_init(igt_display_t *display, int drm_fd) plane->pipe = pipe; plane->drm_plane = drm_plane; + + get_plane_property(display, drm_plane->plane_id, + "rotation", + &plane->rotation_property, + &prop_value); + plane->rotation = (igt_rotation_t)prop_value; } if (display->has_universal_planes) { diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 058114a..4f3474e 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -109,8 +109,10 @@ typedef struct { /*< private >*/ igt_pipe_t *pipe; int index; + /* capabilities */ unsigned int is_primary : 1; unsigned int is_cursor : 1; + /* state tracking */ unsigned int fb_changed : 1; unsigned int position_changed : 1; unsigned int panning_changed : 1; @@ -120,6 +122,9 @@ typedef struct { */ drmModePlane *drm_plane; struct igt_fb *fb; + + uint32_t rotation_property; + /* position within pipe_src_w x pipe_src_h */ int crtc_x, crtc_y; /* panning offset within the fb */ @@ -171,6 +176,11 @@ drmModeModeInfo *igt_output_get_mode(igt_output_t *output); void igt_output_set_pipe(igt_output_t *output, enum pipe pipe); igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane); +static inline bool igt_plane_supports_rotation(igt_plane_t *plane) +{ + return plane->rotation_property != 0; +} + void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb); void igt_plane_set_position(igt_plane_t *plane, int x, int y); void igt_plane_set_panning(igt_plane_t *plane, int x, int y); -- 1.8.3.1