From patchwork Wed Mar 23 11:38:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 8649361 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 AF09A9F36E for ; Wed, 23 Mar 2016 11:38:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C46C203B0 for ; Wed, 23 Mar 2016 11:38:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3892E20374 for ; Wed, 23 Mar 2016 11:38:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 141936E844; Wed, 23 Mar 2016 11:38:26 +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 0B7606E844 for ; Wed, 23 Mar 2016 11:38:20 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 23 Mar 2016 04:38:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,382,1455004800"; d="scan'208";a="71754822" 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:19 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Wed, 23 Mar 2016 11:38:09 +0000 Message-Id: <1458733090-25768-7-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 6/7] lib/igt_kms: rename igt_crtc_set_background 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 We're a bit inconsistent with functions named igt_crtc_* and other named igt_pipe_* even though they apply to the same objects. It seems most of the kernel/igt is using the pipe denomination. Let's rename the igt_crtc_* into igt_pipe_*. Signed-off-by: Lionel Landwerlin --- lib/igt_kms.c | 28 ++++++++++++++-------------- lib/igt_kms.h | 29 ++++++++++++++--------------- tests/kms_crtc_background_color.c | 18 +++++++++--------- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index e3488f1..1e0585f 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -160,7 +160,7 @@ static const char *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = { "rotation" }; -static const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = { +static const char *igt_pipe_prop_names[IGT_NUM_PIPE_PROPS] = { "background_color", "DEGAMMA_LUT", "CTM", @@ -1262,8 +1262,8 @@ void igt_display_init(igt_display_t *display, int drm_fd) pipe->n_planes = p + 1; igt_atomic_fill_props(display, pipe->crtc_id, DRM_MODE_OBJECT_CRTC, - pipe->properties, igt_crtc_prop_names, - IGT_NUM_CRTC_PROPS); + pipe->properties, igt_pipe_prop_names, + IGT_NUM_PIPE_PROPS); if (pipe->crtc_id) { uint64_t prop_value; @@ -1835,7 +1835,7 @@ static int igt_output_commit(igt_output_t *output, if (pipe->background_changed) { igt_crtc_set_property(output, - pipe->properties[IGT_CRTC_BACKGROUND], + pipe->properties[IGT_PIPE_BACKGROUND], pipe->background); pipe->background_changed = false; @@ -1843,11 +1843,11 @@ static int igt_output_commit(igt_output_t *output, if (pipe->color_mgmt_changed) { igt_crtc_set_property(output, - pipe->properties[IGT_CRTC_DEGAMMA_LUT], + pipe->properties[IGT_PIPE_DEGAMMA_LUT], pipe->degamma_blob); - igt_crtc_set_property(output, pipe->properties[IGT_CRTC_CTM], + igt_crtc_set_property(output, pipe->properties[IGT_PIPE_CTM], pipe->ctm_blob); - igt_crtc_set_property(output, pipe->properties[IGT_CRTC_GAMMA_LUT], + igt_crtc_set_property(output, pipe->properties[IGT_PIPE_GAMMA_LUT], pipe->gamma_blob); pipe->color_mgmt_changed = false; @@ -1881,12 +1881,12 @@ static int igt_output_commit(igt_output_t *output, static void igt_atomic_prepare_pipe_commit(igt_pipe_t *pipe, drmModeAtomicReq *req) { if (pipe->background_changed) - igt_atomic_populate_pipe_req(req, pipe, IGT_CRTC_BACKGROUND, pipe->background); + igt_atomic_populate_pipe_req(req, pipe, IGT_PIPE_BACKGROUND, pipe->background); if (pipe->color_mgmt_changed) { - igt_atomic_populate_pipe_req(req, pipe, IGT_CRTC_DEGAMMA_LUT, pipe->degamma_blob); - igt_atomic_populate_pipe_req(req, pipe, IGT_CRTC_CTM, pipe->ctm_blob); - igt_atomic_populate_pipe_req(req, pipe, IGT_CRTC_GAMMA_LUT, pipe->gamma_blob); + igt_atomic_populate_pipe_req(req, pipe, IGT_PIPE_DEGAMMA_LUT, pipe->degamma_blob); + igt_atomic_populate_pipe_req(req, pipe, IGT_PIPE_CTM, pipe->ctm_blob); + igt_atomic_populate_pipe_req(req, pipe, IGT_PIPE_GAMMA_LUT, pipe->gamma_blob); } pipe->background_changed = false; @@ -2316,7 +2316,7 @@ igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length) } /** - * igt_crtc_set_background: + * igt_pipe_set_background: * @pipe: pipe pointer to which background color to be set * @background: background color value in BGR 16bpc * @@ -2325,11 +2325,11 @@ igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length) * property. * For example to get red as background, set background = 0x00000000FFFF. */ -void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background) +void igt_pipe_set_background(igt_pipe_t *pipe, uint64_t background) { igt_display_t *display = pipe->display; - LOG(display, "%s.%d: crtc_set_background(%"PRIx64")\n", + LOG(display, "%s.%d: pipe_set_background(%"PRIx64")\n", kmstest_pipe_name(pipe->pipe), pipe->pipe, background); diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 4d3abf6..27c87ea 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -106,12 +106,12 @@ int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id); void kmstest_set_vt_graphics_mode(void); void kmstest_restore_vt_mode(void); -enum igt_atomic_crtc_properties { - IGT_CRTC_BACKGROUND = 0, - IGT_CRTC_CTM, - IGT_CRTC_DEGAMMA_LUT, - IGT_CRTC_GAMMA_LUT, - IGT_NUM_CRTC_PROPS +enum igt_atomic_pipe_properties { + IGT_PIPE_BACKGROUND = 0, + IGT_PIPE_CTM, + IGT_PIPE_DEGAMMA_LUT, + IGT_PIPE_GAMMA_LUT, + IGT_NUM_PIPE_PROPS }; enum igt_atomic_connector_properties { @@ -262,7 +262,7 @@ struct igt_pipe { uint32_t crtc_id; - uint32_t properties[IGT_NUM_CRTC_PROPS]; + uint32_t properties[IGT_NUM_PIPE_PROPS]; }; typedef struct { @@ -305,6 +305,12 @@ igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane); bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name, uint32_t *prop_id, uint64_t *value, drmModePropertyPtr *prop); +void igt_pipe_set_background(igt_pipe_t *pipe, uint64_t background); + +static inline bool igt_pipe_supports_background(igt_pipe_t *pipe) +{ + return pipe->properties[IGT_PIPE_BACKGROUND] != 0; +} static inline bool igt_plane_supports_rotation(igt_plane_t *plane) { @@ -320,18 +326,11 @@ void igt_plane_set_position(igt_plane_t *plane, int x, int y); void igt_plane_set_size(igt_plane_t *plane, int w, int h); void igt_plane_set_panning(igt_plane_t *plane, int x, int y); void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation); -void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background); void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane, uint32_t x, uint32_t y); 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) \ @@ -362,7 +361,7 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe); * igt_atomic_populate_pipe_req: * @req: A pointer to drmModeAtomicReq * @pipe: A pointer igt_pipe_t - * @prop: one of igt_atomic_crtc_properties + * @prop: one of igt_atomic_pipe_properties * @value: the value to add */ #define igt_atomic_populate_pipe_req(req, pipe, prop, value) \ diff --git a/tests/kms_crtc_background_color.c b/tests/kms_crtc_background_color.c index 055f935..0bf205e 100644 --- a/tests/kms_crtc_background_color.c +++ b/tests/kms_crtc_background_color.c @@ -97,7 +97,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_assert(fb_id); /* To make FB pixel win with background color, set alpha as full opaque */ - igt_crtc_set_background(plane->pipe, pipe_background_color); + igt_pipe_set_background(plane->pipe, pipe_background_color); if (opaque_buffer) alpha = 1.0; /* alpha 1 is fully opque */ else @@ -117,7 +117,7 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) igt_remove_fb(data->gfx_fd, &data->fb); - igt_crtc_set_background(plane->pipe, BLACK64); + igt_pipe_set_background(plane->pipe, BLACK64); igt_plane_set_fb(plane, NULL); igt_output_set_pipe(output, PIPE_ANY); @@ -147,26 +147,26 @@ static void test_crtc_background(data_t *data) /* Now set background without using a plane, i.e., * Disable the plane to let hw background color win blend. */ igt_plane_set_fb(plane, NULL); - igt_crtc_set_background(plane->pipe, PURPLE64); + igt_pipe_set_background(plane->pipe, PURPLE64); igt_display_commit2(display, COMMIT_UNIVERSAL); /* Try few other background colors */ - igt_crtc_set_background(plane->pipe, CYAN64); + igt_pipe_set_background(plane->pipe, CYAN64); igt_display_commit2(display, COMMIT_UNIVERSAL); - igt_crtc_set_background(plane->pipe, YELLOW64); + igt_pipe_set_background(plane->pipe, YELLOW64); igt_display_commit2(display, COMMIT_UNIVERSAL); - igt_crtc_set_background(plane->pipe, RED64); + igt_pipe_set_background(plane->pipe, RED64); igt_display_commit2(display, COMMIT_UNIVERSAL); - igt_crtc_set_background(plane->pipe, GREEN64); + igt_pipe_set_background(plane->pipe, GREEN64); igt_display_commit2(display, COMMIT_UNIVERSAL); - igt_crtc_set_background(plane->pipe, BLUE64); + igt_pipe_set_background(plane->pipe, BLUE64); igt_display_commit2(display, COMMIT_UNIVERSAL); - igt_crtc_set_background(plane->pipe, WHITE64); + igt_pipe_set_background(plane->pipe, WHITE64); igt_display_commit2(display, COMMIT_UNIVERSAL); valid_tests++;