From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 16/25] lib/kms: Pass the number of planes explicitly to __kms_addfb()
Date: Fri, 21 Sep 2018 15:54:39 -0700 [thread overview]
Message-ID: <1537570479.3945.45.camel@intel.com> (raw)
In-Reply-To: <20180719150415.935-16-ville.syrjala@linux.intel.com>
Em Qui, 2018-07-19 às 18:04 +0300, Ville Syrjala escreveu:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Currently __kms_addfb() assumes that only the first plane can be
> at offset 0. I don't particularly like such assumptions so let's
> just pass in the number of planes explicitly.
>
> We'll also require offsets[] to be passed in always. Nothing really
> to gain by making it optional.
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> lib/igt_fb.c | 1 +
> lib/ioctl_wrappers.c | 9 +++------
> lib/ioctl_wrappers.h | 2 +-
> tests/kms_available_modes_crc.c | 5 ++++-
> tests/kms_draw_crc.c | 3 ++-
> tests/prime_vgem.c | 3 ++-
> 6 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 5e687b95e265..77611b593a7e 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -884,6 +884,7 @@ igt_create_fb_with_bo_size(int fd, int width, int
> height,
>
> do_or_die(__kms_addfb(fd, fb->gem_handle, width,
> height,
> format, tiling, pitches, fb-
> >offsets,
> + fb_num_planes(f),
> LOCAL_DRM_MODE_FB_MODIFIERS,
> &fb_id));
> } else {
> uint32_t handles[4];
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index a34857266d92..d992e015b9c8 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -1674,7 +1674,7 @@ int __kms_addfb(int fd, uint32_t handle,
> uint32_t width, uint32_t height,
> uint32_t pixel_format, uint64_t modifier,
> uint32_t strides[4], uint32_t offsets[4],
> - uint32_t flags, uint32_t *buf_id)
> + int num_planes, uint32_t flags, uint32_t *buf_id)
> {
> struct drm_mode_fb_cmd2 f;
> int ret, i;
> @@ -1687,14 +1687,11 @@ int __kms_addfb(int fd, uint32_t handle,
> f.height = height;
> f.pixel_format = pixel_format;
> f.flags = flags;
> - f.handles[0] = handle;
> - f.pitches[0] = strides[0];
> - f.modifier[0] = modifier;
>
> - for (i = 1; i < 4 && offsets && offsets[i]; i++) {
> + for (i = 0; i < num_planes; i++) {
> f.handles[i] = handle;
> - f.pitches[i] = strides[i];
> f.modifier[i] = modifier;
> + f.pitches[i] = strides[i];
> f.offsets[i] = offsets[i];
> }
>
> diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
> index 67bf50562bf3..872e3056314b 100644
> --- a/lib/ioctl_wrappers.h
> +++ b/lib/ioctl_wrappers.h
> @@ -239,7 +239,7 @@ int __kms_addfb(int fd, uint32_t handle,
> uint32_t width, uint32_t height,
> uint32_t pixel_format, uint64_t modifier,
> uint32_t strides[4], uint32_t offsets[4],
> - uint32_t flags, uint32_t *buf_id);
> + int num_planes, uint32_t flags, uint32_t *buf_id);
>
> /**
> * to_user_pointer:
> diff --git a/tests/kms_available_modes_crc.c
> b/tests/kms_available_modes_crc.c
> index 1c843c6cf691..14170ef711e3 100644
> --- a/tests/kms_available_modes_crc.c
> +++ b/tests/kms_available_modes_crc.c
> @@ -258,6 +258,7 @@ static bool setup_fb(data_t *data, igt_output_t
> *output, igt_plane_t *plane,
> unsigned tile_width, tile_height;
> uint32_t strides[4] = {};
> uint32_t offsets[4] = {};
> + int num_planes = 1;
> uint64_t tiling;
> int bpp = 0;
> int i;
> @@ -303,6 +304,7 @@ static bool setup_fb(data_t *data, igt_output_t
> *output, igt_plane_t *plane,
> if (fillers[i].bpp == P010 || fillers[i].bpp == NV12) {
> offsets[1] = data->size;
> gemsize = data->size * 2;
> + num_planes = 2;
> }
>
> data->gem_handle = gem_create(data->gfx_fd, gemsize);
> @@ -313,7 +315,8 @@ static bool setup_fb(data_t *data, igt_output_t
> *output, igt_plane_t *plane,
>
> ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
> format, tiling, strides, offsets,
> - LOCAL_DRM_MODE_FB_MODIFIERS, &data-
> >fb.fb_id);
> + num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
> + &data->fb.fb_id);
>
> if(ret < 0) {
> igt_info("Creating fb for format %s failed, return
> code %d\n",
> diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
> index fb10d7ccf8bc..90904714283c 100644
> --- a/tests/kms_draw_crc.c
> +++ b/tests/kms_draw_crc.c
> @@ -156,6 +156,7 @@ static void get_method_crc(enum igt_draw_method
> method, uint32_t drm_format,
> static bool format_is_supported(uint32_t format, uint64_t modifier)
> {
> uint32_t gem_handle, fb_id;
> + unsigned int offsets[4] = {};
> unsigned int strides[4] = {};
> int ret;
>
> @@ -163,7 +164,7 @@ static bool format_is_supported(uint32_t format,
> uint64_t modifier)
> format, modifier,
> 0, NULL,
> &strides[0], NULL);
> ret = __kms_addfb(drm_fd, gem_handle, 64, 64,
> - format, modifier, strides, NULL,
> + format, modifier, strides, offsets, 1,
> LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id);
> drmModeRmFB(drm_fd, fb_id);
> gem_close(drm_fd, gem_handle);
> diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
> index 1b7d8fb293ef..d06aa24b5ef2 100644
> --- a/tests/prime_vgem.c
> +++ b/tests/prime_vgem.c
> @@ -710,6 +710,7 @@ static void test_flip(int i915, int vgem,
> unsigned hang)
>
> for (int i = 0; i < 2; i++) {
> uint32_t strides[4] = {};
> + uint32_t offsets[4] = {};
> int fd;
>
> bo[i].width = 1024;
> @@ -727,7 +728,7 @@ static void test_flip(int i915, int vgem,
> unsigned hang)
> do_or_die(__kms_addfb(i915, handle[i],
> bo[i].width, bo[i].height,
> DRM_FORMAT_XRGB8888,
> I915_TILING_NONE,
> - strides, NULL,
> + strides, offsets, 1,
> LOCAL_DRM_MODE_FB_MODIFIERS,
> &fb_id[i]));
> igt_assert(fb_id[i]);
> }
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-09-21 22:54 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 15:03 [igt-dev] [PATCH i-g-t 01/25] lib/igt_kms: Fill the plane format/mod information for pre-blobifier drivers Ville Syrjala
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 02/25] tests/kms_ccs: Use igt_plane_has_format_mod() Ville Syrjala
2018-09-20 20:56 ` Paulo Zanoni
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 03/25] tests/kms_plane: Add validate-in-formats subtest Ville Syrjala
2018-09-20 21:10 ` Paulo Zanoni
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 04/25] tests/kms_addfb_basic: Check that addfb2 accepts/rejects the expected formats Ville Syrjala
2018-09-20 23:36 ` Paulo Zanoni
2018-09-21 13:37 ` Ville Syrjälä
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 05/25] tests/gem_render_copy: Fix clipped height Ville Syrjala
2018-08-24 3:17 ` Dhinakaran Pandiyan
2018-08-28 14:21 ` Ville Syrjälä
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 06/25] lib/igt_fb: Respect the users choice of stride Ville Syrjala
2018-09-21 0:04 ` Paulo Zanoni
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 07/25] lib: Add DIV_ROUND_UP() Ville Syrjala
2018-09-18 21:17 ` Paulo Zanoni
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 08/25] lib/igt_fb: Use fb_blit_upload as the base class for fb_convert_blit_upload Ville Syrjala
2018-09-21 0:15 ` Paulo Zanoni
2018-07-19 15:03 ` [igt-dev] [PATCH i-g-t 09/25] lib/igt_fb: Pass fb_blit_upload to free_linear_mapping() Ville Syrjala
2018-09-21 0:20 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 10/25] lib/igt_fb: s/planar_foo/fb_plane_foo/ Ville Syrjala
2018-09-21 21:58 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 11/25] lib/igt_fb: Add fb_plane_bpp() Ville Syrjala
2018-09-21 22:02 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 12/25] lib/igt_fb: Add fb_num_planes() Ville Syrjala
2018-09-21 22:05 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 13/25] lib/igt_fb: Extract calc_plane_stride() Ville Syrjala
2018-09-21 22:33 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 14/25] lib/igt_fb: Consolidate fb size calculation to one function Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 15/25] lib/kms: Pass strides[] to __kms_addfb Ville Syrjala
2018-09-21 22:45 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 16/25] lib/kms: Pass the number of planes explicitly to __kms_addfb() Ville Syrjala
2018-09-21 22:54 ` Paulo Zanoni [this message]
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 17/25] lib/igt_fb: Remove the hand rolled addfb2 Ville Syrjala
2018-09-21 23:15 ` Paulo Zanoni
2018-10-03 10:56 ` Petri Latvala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 18/25] lib/igt_fb: Constify format_desc_struct Ville Syrjala
2018-09-21 23:20 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 19/25] lib/igt_fb: Pass around igt_fb internally Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 20/25] lib/igt_fb: Refactor blitter usage Ville Syrjala
2018-09-21 23:48 ` Paulo Zanoni
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 21/25] lib/igt_fb: Don't use blitter for large buffers Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 22/25] lib/rendercopy: Add support for Yf/Ys tiling to gen9 rendercopy Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 23/25] tests/gem_render_copy: Test Yf tiling Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 24/25] lib/igt_fb: Use rendercopy for rendering into compressed buffers Ville Syrjala
2018-07-19 15:04 ` [igt-dev] [PATCH i-g-t 25/25] tests/kms_plane: Test all modifiers as well Ville Syrjala
2018-07-19 15:26 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/25] lib/igt_kms: Fill the plane format/mod information for pre-blobifier drivers Patchwork
2018-07-19 17:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-09-20 20:26 ` [igt-dev] [PATCH i-g-t 01/25] " Paulo Zanoni
2018-09-21 13:26 ` Ville Syrjälä
2018-09-21 21:39 ` Paulo Zanoni
2018-11-27 20:30 ` Kazlauskas, Nicholas
2018-11-27 21:20 ` Ville Syrjälä
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=1537570479.3945.45.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.