summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2017-06-05 14:30:02 +0100
committerDaniel Stone <daniels@collabora.com>2017-06-08 22:27:30 +0100
commit11e549ae3f3ce022fb22af933a7d16bbb23e3882 (patch)
tree5929e37fb3bc852e286d05392e04ee4fd737fc97 /src/egl
parent142536a0e32455a485d979d11188fd861882f437 (diff)
egl/dri2: Avoid sign extension when building modifier
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>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d31a0bf8e09..7175e827c9f 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -2278,9 +2278,8 @@ dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
* 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;