Commit 3f40465e authored by Tapani Pälli's avatar Tapani Pälli
Browse files

EGL_EXT_image_dma_buf_import: fix p010, p012 input

We made some wrong assumptions about the format layout, this fixes
input given to formats, input can be identical.

v2: clear out 6 lsb from P010 and 4 lsb from P012

Fixes: 3ce4e483

 "EGL_EXT_image_dma_buf_import: add P12, P16 format support"
Signed-off-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
parent 6e8c7b08
Pipeline #23938 failed with stage
...@@ -56,29 +56,7 @@ format_has_alpha(int fourcc) ...@@ -56,29 +56,7 @@ format_has_alpha(int fourcc)
enum piglit_result enum piglit_result
piglit_display(void) piglit_display(void)
{ {
static const uint16_t p010[] = { uint16_t p0xx[] = {
/* Y */
201, 281, 361, 441,
201, 281, 361, 441,
201, 281, 361, 441,
201, 281, 361, 441,
/* UV */
481, 522, 562, 522,
481, 642, 562, 642,
};
static const uint16_t p012[] = {
/* Y */
803, 1124, 1445, 1766,
803, 1124, 1445, 1766,
803, 1124, 1445, 1766,
803, 1124, 1445, 1766,
/* UV */
1927, 2088, 2248, 2088,
1927, 2569, 2248, 2569,
};
static const uint16_t p016[] = {
/* Y */ /* Y */
12850, 17990, 23130, 28270, 12850, 17990, 23130, 28270,
12850, 17990, 23130, 28270, 12850, 17990, 23130, 28270,
...@@ -172,13 +150,17 @@ piglit_display(void) ...@@ -172,13 +150,17 @@ piglit_display(void)
enum piglit_result res; enum piglit_result res;
switch (fourcc) { switch (fourcc) {
case DRM_FORMAT_P010: case DRM_FORMAT_P010:
t = (unsigned char *) p010; for (uint32_t i = 0; i < ARRAY_SIZE(p0xx); i++)
p0xx[i] &= (1023 << 6);
t = (unsigned char *) p0xx;
break; break;
case DRM_FORMAT_P012: case DRM_FORMAT_P012:
t = (unsigned char *) p012; for (uint32_t i = 0; i < ARRAY_SIZE(p0xx); i++)
p0xx[i] &= (4095 << 4);
t = (unsigned char *) p0xx;
break; break;
case DRM_FORMAT_P016: case DRM_FORMAT_P016:
t = (unsigned char *) p016; t = (unsigned char *) p0xx;
break; break;
case DRM_FORMAT_NV12: case DRM_FORMAT_NV12:
t = nv12; t = nv12;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment