From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [CI 05/16] fb: convert: Remove swizzle from the arguments
Date: Mon, 8 Oct 2018 17:04:22 +0300 [thread overview]
Message-ID: <20181008140433.32399-5-arkadiusz.hiler@intel.com> (raw)
In-Reply-To: <20181008140433.32399-1-arkadiusz.hiler@intel.com>
From: Maxime Ripard <maxime.ripard@bootlin.com>
Since it can be inferred from the framebuffer that is already given as an
argument, it is redundant and can be removed.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
lib/igt_fb.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 804fef6a..cc1089aa 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1682,8 +1682,7 @@ static const unsigned char *yuyv_swizzle(uint32_t format)
}
}
-static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit,
- const unsigned char swz[4])
+static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
{
int i, j;
const uint8_t *yuyv;
@@ -1693,6 +1692,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
uint8_t *buf = malloc(blit->base.linear.fb.size);
struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(fb->color_encoding,
fb->color_range);
+ const unsigned char *swz = yuyv_swizzle(fb->drm_format);
/*
* Reading from the BO is awfully slow because of lack of read caching,
@@ -1742,8 +1742,7 @@ static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_uplo
free(buf);
}
-static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_upload *blit,
- const unsigned char swz[4])
+static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_upload *blit)
{
int i, j;
uint8_t *yuyv = blit->base.linear.map;
@@ -1752,6 +1751,7 @@ static void convert_rgb24_to_yuyv(struct igt_fb *fb, struct fb_convert_blit_uplo
unsigned yuyv_stride = blit->base.linear.fb.strides[0];
struct igt_mat4 m = igt_rgb_to_ycbcr_matrix(fb->color_encoding,
fb->color_range);
+ const unsigned char *swz = yuyv_swizzle(fb->drm_format);
igt_assert_f(fb->drm_format == DRM_FORMAT_YUYV ||
fb->drm_format == DRM_FORMAT_YVYU ||
@@ -1809,7 +1809,7 @@ static void destroy_cairo_surface__convert(void *arg)
case DRM_FORMAT_YVYU:
case DRM_FORMAT_UYVY:
case DRM_FORMAT_VYUY:
- convert_rgb24_to_yuyv(fb, blit, yuyv_swizzle(fb->drm_format));
+ convert_rgb24_to_yuyv(fb, blit);
break;
default:
igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
@@ -1863,7 +1863,7 @@ static void create_cairo_surface__convert(int fd, struct igt_fb *fb)
case DRM_FORMAT_YVYU:
case DRM_FORMAT_UYVY:
case DRM_FORMAT_VYUY:
- convert_yuyv_to_rgb24(fb, blit, yuyv_swizzle(fb->drm_format));
+ convert_yuyv_to_rgb24(fb, blit);
break;
default:
igt_assert_f(false, "Conversion not implemented for formats 0x%x\n",
--
2.17.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-10-08 14:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 14:04 [igt-dev] [CI 01/16] fb: Add buffer map/unmap functions Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 02/16] fb: Only set the GEM domain on intel platforms Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 03/16] fb: Add RGB888 format Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 04/16] fb: Use an igt_fb for the cairo shadow buffer Arkadiusz Hiler
2018-10-08 14:04 ` Arkadiusz Hiler [this message]
2018-10-08 14:04 ` [igt-dev] [CI 06/16] fb: Create common function to convert frame formats Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 07/16] fb: Add format conversion routine Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 08/16] igt: Make pixman mandatory Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 09/16] tests: kms_plane: Disable XBGR8888 Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 10/16] fb: Add support for conversions through pixman Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 11/16] fb: Add more formats Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 12/16] chamelium: Split CRC test function in two Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 13/16] chamelium: Change our pattern for a custom one if needed Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 14/16] chamelium: Add format support Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 15/16] chamelium: Add format subtests Arkadiusz Hiler
2018-10-08 14:04 ` [igt-dev] [CI 16/16] tests: Add chamelium formats subtests to vc4 test lists Arkadiusz Hiler
2018-10-08 14:56 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [CI,01/16] fb: Add buffer map/unmap functions Patchwork
2018-10-08 16:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20181008140433.32399-5-arkadiusz.hiler@intel.com \
--to=arkadiusz.hiler@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