[igt-dev] [PATCH i-g-t v1] lib/igt_fb: Remove unused variable buf.
Stanislav Lisovskiy
stanislav.lisovskiy at intel.com
Fri Oct 26 10:44:27 UTC 2018
Despite the comment temporary buf is not
used anywhere in convert_nv12_to_rgb24,
so it has to be either removed or used instead
of cvt->src.ptr.
Currently removing it as other functions seem
not to use it either, to make the code more consistent.
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>
---
lib/igt_fb.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 4700b152..d92769a9 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1528,16 +1528,9 @@ static void convert_nv12_to_rgb24(struct fb_convert *cvt)
uint8_t *rgb24 = cvt->dst.ptr;
unsigned int rgb24_stride = cvt->dst.fb->strides[0];
unsigned int planar_stride = cvt->src.fb->strides[0];
- uint8_t *buf = malloc(cvt->src.fb->size);
struct igt_mat4 m = igt_ycbcr_to_rgb_matrix(cvt->src.fb->color_encoding,
cvt->src.fb->color_range);
- /*
- * 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.
- */
- igt_memcpy_from_wc(buf, cvt->src.ptr, cvt->src.fb->size);
y = cvt->src.ptr + cvt->src.fb->offsets[0];
uv = cvt->src.ptr + cvt->src.fb->offsets[1];
@@ -1626,8 +1619,6 @@ static void convert_nv12_to_rgb24(struct fb_convert *cvt)
write_rgb(&rgb24[j * 8 + 0], &rgb);
}
}
-
- free(buf);
}
static void convert_yuv444_to_rgb24(struct fb_convert *cvt)
--
2.17.1
More information about the igt-dev
mailing list