From patchwork Mon Jun 30 23:44:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Roper X-Patchwork-Id: 4455351 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36600BEEAA for ; Mon, 30 Jun 2014 23:44:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58F3D202F0 for ; Mon, 30 Jun 2014 23:44:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7911A201FA for ; Mon, 30 Jun 2014 23:44:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E62C76E4E7; Mon, 30 Jun 2014 16:44:16 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A1BE6E4E7 for ; Mon, 30 Jun 2014 16:44:15 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 30 Jun 2014 16:44:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,578,1400050800"; d="scan'208";a="555518994" Received: from mdroper-hswdev.fm.intel.com (HELO mdroper-hswdev) ([10.1.134.215]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2014 16:44:13 -0700 Received: from mattrope by mdroper-hswdev with local (Exim 4.82) (envelope-from ) id 1X1lFr-0002fb-KS; Mon, 30 Jun 2014 16:44:59 -0700 From: Matt Roper To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Jun 2014 16:44:24 -0700 Message-Id: <1404171870-10206-4-git-send-email-matthew.d.roper@intel.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1404171870-10206-1-git-send-email-matthew.d.roper@intel.com> References: <1404171870-10206-1-git-send-email-matthew.d.roper@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 3/9] lib/kms: Add igt_display_commit2() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new commit interface, igt_display_commit2(), that allows tests to specify which programming API should be used to perform hardware updates. COMMIT_LEGACY is the only option for now, but universal and atomic interfaces will be added as additional options in the future. igt_display_commit() remains unchanged for existing tests that wish to place the hardware in a specific state, but that don't care which API is used to achieve that state. The legacy API will be used by default for now, but in the future we may decide to make the default API configurable via an environment variable. Signed-off-by: Matt Roper --- lib/igt_kms.c | 32 +++++++++++++++++++++++++++++++- lib/igt_kms.h | 7 +++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 3f561e9..064b741 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -946,7 +946,21 @@ static int igt_output_commit(igt_output_t *output) return 0; } -int igt_display_commit(igt_display_t *display) +/** + * igt_display_commit2: + * @display: DRM device handle + * @s: Commit style + * + * Commits framebuffer and positioning changes to all planes of each display + * pipe, using a specific API to perform the programming. This function should + * be used to exercise a specific driver programming API; igt_display_commit + * should be used instead if the API used is unimportant to the test being run. + * + * Returns: 0 upon success. This function will never return upon failure + * since igt_fail() at lower levels will longjmp out of it. + */ +int igt_display_commit2(igt_display_t *display, + enum igt_commit_style s) { int i; @@ -971,6 +985,22 @@ int igt_display_commit(igt_display_t *display) return 0; } +/** + * igt_display_commit: + * @display: DRM device handle + * @s: Commit style + * + * Commits framebuffer and positioning changes to all planes of each display + * pipe. + * + * Returns: 0 upon success. This function will never return upon failure + * since igt_fail() at lower levels will longjmp out of it. + */ +int igt_display_commit(igt_display_t *display) +{ + return igt_display_commit2(display, COMMIT_LEGACY); +} + const char *igt_output_name(igt_output_t *output) { return output->name; diff --git a/lib/igt_kms.h b/lib/igt_kms.h index a9a4236..62dc73c 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -65,6 +65,12 @@ enum port { }; #define port_name(p) ((p) + 'A') +enum igt_commit_style { + COMMIT_LEGACY = 0, + COMMIT_UNIVERSAL, + /* We'll add atomic here eventually. */ +}; + #include "igt_fb.h" struct kmstest_connector_config { @@ -150,6 +156,7 @@ void igt_set_vt_graphics_mode(void); void igt_display_init(igt_display_t *display, int drm_fd); void igt_display_fini(igt_display_t *display); +int igt_display_commit2(igt_display_t *display, enum igt_commit_style s); int igt_display_commit(igt_display_t *display); int igt_display_get_n_pipes(igt_display_t *display);