[igt-dev] [PATCH i-g-t 8/8] lib: Add support for rendering into packed YCbCr framebuffers
Chris Wilson
chris at chris-wilson.co.uk
Tue Feb 27 21:36:54 UTC 2018
Quoting Ville Syrjala (2018-02-27 21:21:20)
> +static void convert_yuyv_to_rgb24(struct igt_fb *fb, struct fb_convert_blit_upload *blit,
> + const unsigned char swz[4])
> +{
> + int i, j;
> + const uint8_t *yuyv;
> + uint8_t *rgb24 = blit->rgb24.map;
> + unsigned rgb24_stride = blit->rgb24.stride, yuyv_stride = blit->linear.stride;
> + uint8_t *buf = malloc(blit->linear.size);
> + bool full_range = false; /* FIXME */
> + const struct igt_color_encoding *e = &igt_ycbcr_bt601; /* FIXME */
> + struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(e, full_range);
> +
> + igt_assert((fb->width & 1) == 0);
> +
> + /*
> + * Reading from the BO is awfully slow because of lack of read caching,
> + * it's faster to copy the whole BO to a temporary buffer and convert
> + * from there.
> + */
> + memcpy(buf, blit->linear.map, blit->linear.size);
Frequent enough to do memcpy_from_wc?
-Chris
More information about the igt-dev
mailing list