backend-drm: use format db for fallback too

Replace one more open-coded pixel format translation map with a call to our
central pixel format database, reducing duplication of format information.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2019-09-13 14:44:24 +03:00
committed by Pekka Paalanen
parent b766dbe3ac
commit 8ba775d96d
3 changed files with 36 additions and 7 deletions
+6 -7
View File
@@ -723,14 +723,13 @@ create_gbm_device(int fd)
static int
fallback_format_for(uint32_t format)
{
switch (format) {
case GBM_FORMAT_XRGB8888:
return GBM_FORMAT_ARGB8888;
case GBM_FORMAT_XRGB2101010:
return GBM_FORMAT_ARGB2101010;
default:
const struct pixel_format_info *pf;
pf = pixel_format_get_info_by_opaque_substitute(format);
if (!pf)
return 0;
}
return pf->format;
}
static int