diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2015-11-27 19:59:56 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-12-01 10:48:21 +1000 |
commit | 8a3dcd4c7b23ee24cecf0dab2b5b18b0864d256f (patch) | |
tree | bdc5efb8df04a520dfcac96a40d0dcc01849ebd2 /tests | |
parent | 031d582bc12399b085de2ec7dd50ba77ccff1d5a (diff) |
tests: fix fourcc check (on intel at least)
- virgl maps VIRGL_FORMAT_B8G8R8X8_UNORM to GL_RGBA8
- _mesa_choose_tex_format() maps GL_RGBA8 to
MESA_FORMAT_R8G8B8A8_UNORM or MESA_FORMAT_A8B8G8R8_UNORM or
MESA_FORMAT_B8G8R8A8_UNORM.
- it ends up in (gl_texture_image *)img->TexFormat
- then in intel (_DRIImage *) image->format.
- on create image, image->dri_format = driGLFormatToImageFormat() (to
ex: MESA_FORMAT_R8G8B8A8_UNORM -> __DRI_IMAGE_FORMAT_ABGR8888)
- on query, intel_lookup_fourcc() -> __DRI_IMAGE_FOURCC_ABGR8888 == GBM_FORMAT_ABGR8888.
For some reason, driGLFormatToImageFormat() doesn't map
MESA_FORMAT_A8B8G8R8_UNORM, so I only check the two possible values I
could find.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_virgl_init.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_virgl_init.c b/tests/test_virgl_init.c index ba946b2..0fdb65f 100644 --- a/tests/test_virgl_init.c +++ b/tests/test_virgl_init.c @@ -328,7 +328,9 @@ START_TEST(virgl_test_get_resource_info) ret = virgl_renderer_resource_get_info(res.handle, &info); ck_assert_int_eq(ret, 0); - ck_assert_int_eq(info.drm_fourcc, GBM_FORMAT_XRGB8888); + + ck_assert_int(info.drm_fourcc == GBM_FORMAT_ABGR8888 || + info.drm_fourcc == GBM_FORMAT_ARGB8888); ck_assert_int_eq(info.virgl_format, res.format); ck_assert_int_eq(res.width, info.width); ck_assert_int_eq(res.height, info.height); |