drm_hwcomposer: avoid using signed errno on uint32 type
DrmGenericImporter::ConvertHalFormatToDrm() should not return negative values.
- Use DRM_FORMAT_INVALID instead of -EINVAL
- Check DrmGenericImporter::ConvertHalFormatToDrm() result value in
DrmGenericImporter::ImportBuffer()
Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
diff --git a/platform/platformhisi.cpp b/platform/platformhisi.cpp
index 64b410b..874a31c 100644
--- a/platform/platformhisi.cpp
+++ b/platform/platformhisi.cpp
@@ -121,9 +121,9 @@
return ret;
}
- int32_t fmt = ConvertHalFormatToDrm(hnd->req_format);
- if (fmt < 0)
- return fmt;
+ uint32_t fmt = ConvertHalFormatToDrm(hnd->req_format);
+ if (fmt == DRM_FORMAT_INVALID)
+ return -EINVAL;
is_rgb = IsDrmFormatRgb(fmt);
modifiers[0] = ConvertGrallocFormatToDrmModifiers(hnd->internal_format,