diff options
author | Thomas Wood <thomas.wood@intel.com> | 2014-10-10 11:20:35 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2014-10-17 15:34:43 +0100 |
commit | be4710a541b517b5f8663448bffed5656d59b47b (patch) | |
tree | 65b5f7c23c98c52f0972e5a43d518292757f9b3e /tests/kms_flip.c | |
parent | d4e3b6a0f5cd759182a53e2bc51a3d3f317a81f0 (diff) |
lib: add common min and max macros
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'tests/kms_flip.c')
-rw-r--r-- | tests/kms_flip.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 901f0133..f6c25a28 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -84,8 +84,6 @@ #define DRM_CAP_TIMESTAMP_MONOTONIC 6 #endif -#define max(a, b) ((a) > (b) ? (a) : (b)) - drmModeRes *resources; int drm_fd; static drm_intel_bufmgr *bufmgr; @@ -925,7 +923,7 @@ static unsigned int run_test_step(struct test_output *o) if (o->flags & TEST_PAN) { int count = do_flip ? o->flip_state.count : o->vblank_state.count; - int x_ofs = count * 10 > o->fb_width - o->kmode[0].hdisplay ? o->fb_width - o->kmode[0].hdisplay : count * 10; + int x_ofs = min(count * 10, o->fb_width - o->kmode[0].hdisplay); /* Make sure DSPSURF changes value */ if (o->flags & TEST_HANG) @@ -1396,7 +1394,7 @@ static int run_test(int duration, int flags) igt_require(modes); duration = duration * 1000 / modes; - duration = duration < 500 ? 500 : duration; + duration = max(500, duration); /* Find any connected displays */ for (i = 0; i < resources->count_connectors; i++) { @@ -1460,7 +1458,7 @@ static int run_pair(int duration, int flags) * configuration at all. So skip in that case. */ igt_require(modes); duration = duration * 1000 / modes; - duration = duration < 500 ? 500 : duration; + duration = max(duration, 500); /* Find a pair of connected displays */ for (i = 0; i < resources->count_connectors; i++) { |