From patchwork Wed Mar 23 11:38:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 8649341 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 508CD9F36E for ; Wed, 23 Mar 2016 11:38:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E51420340 for ; Wed, 23 Mar 2016 11:38:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7D7BE20374 for ; Wed, 23 Mar 2016 11:38:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A537B6E847; Wed, 23 Mar 2016 11:38:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C46F6E845 for ; Wed, 23 Mar 2016 11:38:18 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 23 Mar 2016 04:38:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,382,1455004800"; d="scan'208";a="71754809" Received: from twilberg-mobl3.ger.corp.intel.com (HELO ivy.ger.corp.intel.com) ([10.252.35.168]) by fmsmga004.fm.intel.com with ESMTP; 23 Mar 2016 04:38:17 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Wed, 23 Mar 2016 11:38:07 +0000 Message-Id: <1458733090-25768-5-git-send-email-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1458733090-25768-1-git-send-email-lionel.g.landwerlin@intel.com> References: <1458733090-25768-1-git-send-email-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 4/7] lib/igt_kms: don't store background property id twice X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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 Now that we load all properties regardless of atomic, the background color property id is redundant. Signed-off-by: Lionel Landwerlin --- lib/igt_kms.c | 7 ++++--- lib/igt_kms.h | 7 ++++++- tests/kms_crtc_background_color.c | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index c82ba3f..c3d389a 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -1269,7 +1269,7 @@ void igt_display_init(igt_display_t *display, int drm_fd) get_crtc_property(display->drm_fd, pipe->crtc_id, "background_color", - &pipe->background_property, + NULL, &prop_value, NULL); pipe->background = (uint32_t)prop_value; @@ -1849,8 +1849,9 @@ static int igt_output_commit(igt_output_t *output, pipe = igt_output_get_driving_pipe(output); if (pipe->background_changed) { - igt_crtc_set_property(output, pipe->background_property, - pipe->background); + igt_crtc_set_property(output, + pipe->properties[IGT_CRTC_BACKGROUND], + pipe->background); pipe->background_changed = false; } diff --git a/lib/igt_kms.h b/lib/igt_kms.h index ac2ca11..8e8b240 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -254,7 +254,6 @@ struct igt_pipe { igt_plane_t planes[IGT_MAX_PLANES]; uint64_t background; /* Background color MSB BGR 16bpc LSB */ uint32_t background_changed : 1; - uint32_t background_property; uint64_t degamma_blob; uint32_t degamma_property; @@ -330,6 +329,12 @@ void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane, void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane, uint32_t w, uint32_t h); +static inline bool igt_pipe_supports_background(igt_pipe_t *pipe) +{ + return pipe->properties[IGT_CRTC_BACKGROUND] != 0; +} + + void igt_wait_for_vblank(int drm_fd, enum pipe pipe); #define for_each_connected_output(display, output) \ diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c index b496625..055f935 100644 --- a/tests/kms_crtc_background_color.c +++ b/tests/kms_crtc_background_color.c @@ -140,7 +140,7 @@ static void test_crtc_background(data_t *data) igt_output_set_pipe(output, pipe); plane = igt_output_get_plane(output, IGT_PLANE_PRIMARY); - igt_require(plane->pipe->background_property); + igt_require(igt_pipe_supports_background (plane->pipe)); prepare_crtc(data, output, pipe, plane, 1, PURPLE, BLACK64);