From: Damien Lespiau Subject: [PATCH i-g-t 05/12] testdisplay: Move the code sanitizing depth into main() Date: Fri, 6 Sep 2013 20:08:43 +0100 Message-ID: <1378494530-3600-6-git-send-email-damien.lespiau@intel.com> References: <1378494530-3600-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 mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C7C2E766C for ; Fri, 6 Sep 2013 12:09:36 -0700 (PDT) In-Reply-To: <1378494530-3600-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org It'll be shared by the set_mode() and set_3d_mode() functions. Signed-off-by: Damien Lespiau --- tests/testdisplay.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 6c39b68..c3a0d04 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; -- 1.8.3.1