summaryrefslogtreecommitdiff
path: root/tests/testdisplay.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2013-09-03 14:57:31 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2013-09-30 18:04:21 +0100
commit0396273972076909f92429503232cff1be38e640 (patch)
treea94fe4cacdb0014d181b0cc7d313546c0c3597fe /tests/testdisplay.c
parent79f4cfedbf8f4249291c0915d040d79af97d1389 (diff)
testdisplay: Move the code sanitizing depth into main()
It'll be shared by the set_mode() and set_3d_mode() functions. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'tests/testdisplay.c')
-rw-r--r--tests/testdisplay.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 6c39b68b..c3a0d049 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -334,13 +334,6 @@ set_mode(struct connector *c)
unsigned int fb_id = 0;
int j, test_mode_num;
- if (depth <= 8)
- bpp = 8;
- else if (depth > 8 && depth <= 16)
- bpp = 16;
- else if (depth > 16 && depth <= 32)
- bpp = 32;
-
test_mode_num = 1;
if (force_mode){
memcpy( &c->mode, &force_timing, sizeof(force_timing));
@@ -585,6 +578,14 @@ int main(int argc, char **argv)
break;
}
}
+
+ if (depth <= 8)
+ bpp = 8;
+ else if (depth <= 16)
+ bpp = 16;
+ else if (depth <= 32)
+ bpp = 32;
+
if (!test_all_modes && !force_mode && !dump_info &&
!test_preferred_mode && specified_mode_num == -1)
test_all_modes = 1;