drm-tests: draw.c: add support for 4:2:2 YUV formats
Our subsampling logic was not correct. There were a few issues:
a) YUYV is 16 bits per pixel, not 32.
b) We skip components corresponding to an odd pixel index when subsampling.
This happens to work for NV12 but breaks down for YUYV.
c) plane->stride doesn't need subsampled since gbm already reports
the correct plane stride.
We should:
1) Convert the RGB format to 4:4:4 YUV format and place the result in
a temporary buffer
2) Average the appropriate components in the temporary buffer when
subsampling.
BUG=b:37526302
TEST=./plane_test -f YUYV on Cyan draws the striped pattern
Change-Id: I2b2ef72cd68925c97489c9f9865cf35e97e8ccef
Reviewed-on: https://chromium-review.googlesource.com/489809
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Dongseong Hwang <dongseong.hwang@intel.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Dongseong Hwang <dongseong.hwang@intel.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
1 file changed