From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id A98D110E3AF for ; Wed, 17 May 2023 05:50:02 +0000 (UTC) Message-ID: Date: Wed, 17 May 2023 11:19:47 +0530 To: Arun R Murthy , References: <20230516062206.1064604-1-arun.r.murthy@intel.com> <20230517035052.1099227-1-arun.r.murthy@intel.com> Content-Language: en-US From: Karthik B S In-Reply-To: <20230517035052.1099227-1-arun.r.murthy@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Subject: Re: [igt-dev] [PATCHv2 i-g-t 1/4] tests/kms_async_flips: Get rid of i915 specific fb creation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: On 5/17/2023 9:20 AM, Arun R Murthy wrote: > No idea why the test wants to create the fb differently between i915 > vs. others. Unify it. > > v2: some correction in commit message > > Signed-off-by: Ville Syrjälä > Signed-off-by: Arun R Murthy Reviewed-by: Karthik B S > --- > tests/kms_async_flips.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c > index 51ffa523..fe27a9ec 100644 > --- a/tests/kms_async_flips.c > +++ b/tests/kms_async_flips.c > @@ -115,6 +115,15 @@ static void wait_flip_event(data_t *data) > } > } > > +static uint64_t default_modifier(data_t *data) > +{ > + if (igt_display_has_format_mod(&data->display, DRM_FORMAT_XRGB8888, > + I915_FORMAT_MOD_X_TILED)) > + return I915_FORMAT_MOD_X_TILED; > + else > + return DRM_FORMAT_MOD_LINEAR; > +} > + > static void make_fb(data_t *data, struct igt_fb *fb, > uint32_t width, uint32_t height, int index) > { > @@ -123,14 +132,8 @@ static void make_fb(data_t *data, struct igt_fb *fb, > > rec_width = width / (ARRAY_SIZE(data->bufs) * 2); > > - if (is_i915_device(data->drm_fd)) { > - igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888, > - I915_FORMAT_MOD_X_TILED, fb); > - igt_draw_fill_fb(data->drm_fd, fb, 0x88); > - } else { > - igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888, > - DRM_FORMAT_MOD_LINEAR, 0.0, 0.0, 0.5, fb); > - } > + igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888, > + default_modifier(data), 0.0, 0.0, 0.5, fb); > > cr = igt_get_cairo_ctx(data->drm_fd, fb); > igt_paint_color_rand(cr, rec_width * 2 + rec_width * index, 0, rec_width, height);