diff options
author | Daniel Stone <[email protected]> | 2017-05-02 19:44:38 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-05-18 18:24:06 +0100 |
commit | 15338b0d1903a85abc2dec14c76e87893627e992 (patch) | |
tree | 6d320e0e4f3de6748b75100987af2ffd4f1ca640 /src | |
parent | 700dcb9ab4a22e36f1de16187f6f6b2c61464edb (diff) |
gbm/dri: Fix sign-extension in modifier query
When we were assembling the unsigned 64-bit query return from its
two signed 32-bit component parts, the lower half was getting
sign-extended into the top half. Be more explicit about what we want to
do.
Fixes gbm_bo_get_modifier() returning ((1 << 64) - 1) rather than
((1 << 56) - 1), i.e. DRM_FORMAT_MOD_INVALID.
Signed-off-by: Daniel Stone <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
(cherry picked from commit 80ac89a952930f068a058a9eee3c2536832b10c9)
Fixes: 8378c576abd ("gbm: Export a get modifiers")
Diffstat (limited to 'src')
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 71590d71103..8cca35e0e06 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -772,7 +772,7 @@ gbm_dri_bo_get_modifier(struct gbm_bo *_bo) &mod)) return DRM_FORMAT_MOD_INVALID; - ret |= mod; + ret |= (uint64_t)(mod & 0xffffffff); return ret; } |