From 42359edda12e5ebf715f2a978944a18baaba6490 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Tue, 17 Jul 2018 18:50:13 +0300 Subject: lib/kms: Pass strides[] to __kms_addfb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make __kms_addfb() usable with planar formats by passing in the stride for each plane. v2: Handle strides[1] for planar formats in kms_available_modes_crc Signed-off-by: Ville Syrjälä Reviewed-by: Paulo Zanoni --- lib/ioctl_wrappers.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/ioctl_wrappers.c') diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c index d5d2a4e4..a3485726 100644 --- a/lib/ioctl_wrappers.c +++ b/lib/ioctl_wrappers.c @@ -1670,9 +1670,11 @@ void igt_require_fb_modifiers(int fd) igt_require(has_modifiers); } -int __kms_addfb(int fd, uint32_t handle, uint32_t width, uint32_t height, - uint32_t stride, uint32_t pixel_format, uint64_t modifier, - uint32_t *offsets, uint32_t flags, uint32_t *buf_id) +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) { struct drm_mode_fb_cmd2 f; int ret, i; @@ -1686,12 +1688,12 @@ int __kms_addfb(int fd, uint32_t handle, uint32_t width, uint32_t height, f.pixel_format = pixel_format; f.flags = flags; f.handles[0] = handle; - f.pitches[0] = stride; + f.pitches[0] = strides[0]; f.modifier[0] = modifier; for (i = 1; i < 4 && offsets && offsets[i]; i++) { f.handles[i] = handle; - f.pitches[i] = stride; + f.pitches[i] = strides[i]; f.modifier[i] = modifier; f.offsets[i] = offsets[i]; } -- cgit v1.2.3