public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/3] tests/kms_available_modes_crc: Initialize fb struct
Date: Fri, 18 Jan 2019 00:58:17 -0800	[thread overview]
Message-ID: <20190118085818.10124-2-dhinakaran.pandiyan@intel.com> (raw)
In-Reply-To: <20190118085818.10124-1-dhinakaran.pandiyan@intel.com>

The test does not initialize data->fb, initializing stride and offset is
necessary to fill NV12 planes correctly. We should ideally be using
library functions in place handrolled code in this test, but let's start
with fixing the failures.

Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 tests/kms_available_modes_crc.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 0c0282f8..fbc40297 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -254,8 +254,6 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 	uint64_t w, h;
 	signed ret, gemsize = 0;
 	unsigned tile_width, tile_height;
-	uint32_t strides[4] = {};
-	uint32_t offsets[4] = {};
 	int num_planes = 1;
 	uint64_t tiling;
 	int bpp = 0;
@@ -296,24 +294,25 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 
 	igt_get_fb_tile_size(data->gfx_fd, tiling, bpp,
 			     &tile_width, &tile_height);
-	strides[0] = ALIGN(w * bpp / 8, tile_width);
-	gemsize = data->size = strides[0] * ALIGN(h, tile_height);
+	data->fb.offsets[0] = 0;
+	data->fb.strides[0] = ALIGN(w * bpp / 8, tile_width);
+	gemsize = data->size = data->fb.strides[0] * ALIGN(h, tile_height);
 
 	if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
-		offsets[1] = data->size;
-		strides[1] = strides[0];
+		data->fb.offsets[1] = data->size;
+		data->fb.strides[1] = data->fb.strides[0];
 		gemsize = data->size * 2;
 		num_planes = 2;
 	}
 
 	data->gem_handle = gem_create(data->gfx_fd, gemsize);
 	ret = __gem_set_tiling(data->gfx_fd, data->gem_handle,
-			       igt_fb_mod_to_tiling(tiling), strides[0]);
+			       igt_fb_mod_to_tiling(tiling), data->fb.strides[0]);
 
 	igt_assert_eq(ret, 0);
 
 	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
-			  format, tiling, strides, offsets,
+			  format, tiling, data->fb.strides, data->fb.offsets,
 			  num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
 			  &data->fb.fb_id);
 
-- 
2.14.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-01-18  9:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18  8:58 [igt-dev] [PATCH i-g-t 1/3] tests/kms_available_modes_crc: Reset output->pipe after testing it Dhinakaran Pandiyan
2019-01-18  8:58 ` Dhinakaran Pandiyan [this message]
2019-01-18 22:24   ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_available_modes_crc: Initialize fb struct Souza, Jose
2019-01-18 22:42     ` Souza, Jose
2019-01-18  8:58 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_modes_available_crc: Fix NV12 failure Dhinakaran Pandiyan
2019-01-18 22:44   ` Souza, Jose
2019-01-18 23:37     ` Dhinakaran Pandiyan
2019-01-18  9:57 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] tests/kms_available_modes_crc: Reset output->pipe after testing it Patchwork
2019-01-18 15:59 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-21  7:44 ` [igt-dev] [PATCH i-g-t 1/3] " Kahola, Mika

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190118085818.10124-2-dhinakaran.pandiyan@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox