From patchwork Thu Aug 16 17:54:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 10777 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BBB1F23E37 for ; Thu, 16 Aug 2012 17:54:15 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6BC79A18D68 for ; Thu, 16 Aug 2012 17:54:15 +0000 (UTC) Received: by yhpp61 with SMTP id p61so3375299yhp.11 for ; Thu, 16 Aug 2012 10:54:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=HAZWiNIFWAcYDsmQMaA1SsXK2wlDlFZHRi2XggF8bck=; b=mBYN3KrZ/B4fyTb/c9ghRHyIR3zirOnCIPV9Kvi+a20hx1IqPOjkZkZAz6SPmYnOLn gB/EnJqlpCduITVVqrgxNoWr+wLupQe2QdczLFBL6vapAUWywJ2yGrMFrjCjNfBg5vKI 6Lhy3SbjFNbvtSFOBrveGdKfeVGndHEbJ2hhd8eRgEfNmAHij91uJ42mTxgGFNucIxvl YuVPRGwhsL6FVcnC0zCggoQrlfB4x2d2tye7rKuWjstWouVxYgYzxb3ervOOcxZQVjnZ QfQmWkiHEoHlQqGfisM2vAOEeKPNGlMVVRZbZrucqco3RwD1EwVDCN2PTG6BBIAKwi9s 5Y2Q== Received: by 10.50.154.132 with SMTP id vo4mr2678910igb.31.1345139654819; Thu, 16 Aug 2012 10:54:14 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp141191igc; Thu, 16 Aug 2012 10:54:12 -0700 (PDT) Received: by 10.180.82.230 with SMTP id l6mr7843845wiy.21.1345139651419; Thu, 16 Aug 2012 10:54:11 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id p20si6542338wiv.37.2012.08.16.10.54.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 10:54:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1T24Go-00029n-IA for ; Thu, 16 Aug 2012 17:54:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 76509E01D5 for ; Thu, 16 Aug 2012 17:54:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 247 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 247: MainLoop, Android: Exclude from score calculations benchmarks that weren't set up correctly. Message-Id: <20120816175410.28714.83123.launchpad@ackee.canonical.com> Date: Thu, 16 Aug 2012 17:54:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15810"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: bceddde1a211b3af5eb62eb6f56a69742ebe92ec X-Gm-Message-State: ALoCoQltCoAMAXE4RSnPbGWmltxjbTI1oQp/S8PhVv3ihwUGF2ayUKM10K9pHVsnzu+U564khcZ1 Merge authors: Alexandros Frantzis (afrantzis) Related merge proposals: https://code.launchpad.net/~linaro-graphics-wg/glmark2/ignore-failed-test-scores/+merge/119527 proposed by: Alexandros Frantzis (afrantzis) review: Approve - Jesse Barker (jesse-barker) ------------------------------------------------------------ revno: 247 [merge] committer: Alexandros Frantzis branch nick: trunk timestamp: Thu 2012-08-16 20:53:31 +0300 message: MainLoop,Android: Exclude from score calculations benchmarks that weren't set up correctly. modified: src/android.cpp src/main-loop.cpp src/main-loop.h --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'src/android.cpp' --- src/android.cpp 2012-08-13 10:09:08 +0000 +++ src/android.cpp 2012-08-16 17:17:07 +0000 @@ -49,10 +49,20 @@ virtual void log_scene_result() { - Log::info("%s FPS: %u FrameTime: %.3f ms\n", - scene_->info_string().c_str(), - scene_->average_fps(), - 1000.0 / scene_->average_fps()); + if (scene_setup_status_ == SceneSetupStatusSuccess) { + Log::info("%s FPS: %u FrameTime: %.3f ms\n", + scene_->info_string().c_str(), + scene_->average_fps(), + 1000.0 / scene_->average_fps()); + } + else if (scene_setup_status_ == SceneSetupStatusUnsupported) { + Log::info("%s Unsupported\n", + scene_->info_string().c_str()); + } + else { + Log::info("%s Set up failed\n", + scene_->info_string().c_str()); + } } }; @@ -66,8 +76,20 @@ virtual void log_scene_result() { - Log::info("%s FPS: %u", scene_->info_string().c_str(), - scene_->average_fps()); + if (scene_setup_status_ == SceneSetupStatusSuccess) { + Log::info("%s FPS: %u FrameTime: %.3f ms\n", + scene_->info_string().c_str(), + scene_->average_fps(), + 1000.0 / scene_->average_fps()); + } + else if (scene_setup_status_ == SceneSetupStatusUnsupported) { + Log::info("%s Unsupported\n", + scene_->info_string().c_str()); + } + else { + Log::info("%s Set up failed\n", + scene_->info_string().c_str()); + } } }; === modified file 'src/main-loop.cpp' --- src/main-loop.cpp 2012-08-13 10:09:08 +0000 +++ src/main-loop.cpp 2012-08-16 17:17:07 +0000 @@ -42,6 +42,7 @@ MainLoop::reset() { scene_ = 0; + scene_setup_status_ = SceneSetupStatusUnknown; score_ = 0; benchmarks_run_ = 0; bench_iter_ = benchmarks_.begin(); @@ -83,6 +84,15 @@ canvas_.reset(); before_scene_setup(); scene_ = &(*bench_iter_)->setup_scene(); + if (!scene_->running()) { + if (!scene_->supported(false)) + scene_setup_status_ = SceneSetupStatusUnsupported; + else + scene_setup_status_ = SceneSetupStatusFailure; + } + else { + scene_setup_status_ = SceneSetupStatusSuccess; + } after_scene_setup(); log_scene_info(); } @@ -102,12 +112,14 @@ * in draw() may have changed the state. */ if (!scene_->running() || should_quit) { - score_ += scene_->average_fps(); + if (scene_setup_status_ == SceneSetupStatusSuccess) { + score_ += scene_->average_fps(); + benchmarks_run_++; + } log_scene_result(); (*bench_iter_)->teardown_scene(); scene_ = 0; next_benchmark(); - benchmarks_run_++; } return !should_quit; @@ -134,11 +146,23 @@ void MainLoop::log_scene_result() { - static const std::string format_fps(Log::continuation_prefix + " FPS: %u"); - static const std::string format_ms(Log::continuation_prefix + " FrameTime: %.3f ms\n"); + static const std::string format_fps(Log::continuation_prefix + + " FPS: %u FrameTime: %.3f ms\n"); + static const std::string format_unsupported(Log::continuation_prefix + + " Unsupported\n"); + static const std::string format_fail(Log::continuation_prefix + + " Set up failed\n"); - Log::info(format_fps.c_str(), scene_->average_fps()); - Log::info(format_ms.c_str(), 1000.0 / scene_->average_fps()); + if (scene_setup_status_ == SceneSetupStatusSuccess) { + Log::info(format_fps.c_str(), scene_->average_fps(), + 1000.0 / scene_->average_fps()); + } + else if (scene_setup_status_ == SceneSetupStatusUnsupported) { + Log::info(format_unsupported.c_str()); + } + else { + Log::info(format_fail.c_str()); + } } void === modified file 'src/main-loop.h' --- src/main-loop.h 2012-02-15 17:09:14 +0000 +++ src/main-loop.h 2012-08-16 17:03:09 +0000 @@ -84,12 +84,19 @@ virtual void log_scene_result(); protected: + enum SceneSetupStatus { + SceneSetupStatusUnknown, + SceneSetupStatusSuccess, + SceneSetupStatusFailure, + SceneSetupStatusUnsupported + }; void next_benchmark(); Canvas &canvas_; Scene *scene_; const std::vector &benchmarks_; unsigned int score_; unsigned int benchmarks_run_; + SceneSetupStatus scene_setup_status_; std::vector::const_iterator bench_iter_; };