summaryrefslogtreecommitdiff
path: root/tests/kms_rotation_crc.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-07-10 18:39:17 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2014-07-11 15:12:23 +0100
commit92a2b292df74408c42a3668c9f4d1a3aed194bfc (patch)
treef2fced7d726f572497cb02a27157cdeea1684a3e /tests/kms_rotation_crc.c
parenta58f8b93b41db4061b3a931feaae2f2c57fb8616 (diff)
kms_rotation_crc: Use the igt_kms enum to encode the plane rotation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests/kms_rotation_crc.c')
-rw-r--r--tests/kms_rotation_crc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 2005b2af..5041f906 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -29,11 +29,6 @@
#include "igt_kms.h"
#include "igt_core.h"
-#define DRM_ROTATE_0 0
-#define DRM_ROTATE_90 1
-#define DRM_ROTATE_180 2
-#define DRM_ROTATE_270 3
-
typedef struct {
int gfx_fd;
igt_display_t display;
@@ -44,7 +39,7 @@ typedef struct {
static void
paint_squares(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
- uint32_t rotation)
+ igt_rotation_t rotation)
{
cairo_t *cr;
int w, h;
@@ -54,7 +49,7 @@ paint_squares(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
cr = igt_get_cairo_ctx(data->gfx_fd, &data->fb);
- if (rotation == DRM_ROTATE_180) {
+ if (rotation == IGT_ROTATION_180) {
cairo_translate(cr, w, h);
cairo_rotate(cr, M_PI);
}
@@ -98,7 +93,7 @@ static bool prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
/* Step 1: create a reference CRC for a software-rotated fb */
- paint_squares(data, &data->fb, mode, DRM_ROTATE_180);
+ paint_squares(data, &data->fb, mode, IGT_ROTATION_180);
/*
* XXX: We always set the primary plane to actually enable the pipe as
@@ -121,7 +116,7 @@ static bool prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
* Step 2: prepare the plane with an non-rotated fb let the hw
* rotate it.
*/
- paint_squares(data, &data->fb, mode, DRM_ROTATE_0);
+ paint_squares(data, &data->fb, mode, IGT_ROTATION_0);
igt_plane_set_fb(plane, &data->fb);
igt_display_commit(display);