Since the EGL attributes are signed integers, a straight OR would
also perform sign extension,
Fixes:
6f10e7c37a ("egl/dri2: Create EGLImages with dmabuf modifiers")
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* will be present in attrs.DMABufPlaneModifiersLo[0] and
* attrs.DMABufPlaneModifiersHi[0] */
if (attrs.DMABufPlaneModifiersLo[0].IsPresent) {
- modifier =
- ((uint64_t) attrs.DMABufPlaneModifiersHi[0].Value << 32) |
- attrs.DMABufPlaneModifiersLo[0].Value;
+ modifier = (uint64_t) attrs.DMABufPlaneModifiersHi[0].Value << 32;
+ modifier |= (uint64_t) (attrs.DMABufPlaneModifiersLo[0].Value & 0xffffffff);
has_modifier = true;
} else {
modifier = DRM_FORMAT_MOD_INVALID;