On 2 May 2017 at 19:49, Daniel Stone <[email protected]> wrote:
> 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]>
> Cc: Ben Widawsky <[email protected]>
> ---
> src/gbm/backends/dri/gbm_dri.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
> index 71590d7110..8cca35e0e0 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);
>
I was itching to suggest the following from the start, but your patch
also works ;-)
Fixes: 8378c576abd ("gbm: Export a get modifiers")
Reviewed-by: Emil Velikov <[email protected]>
return (uint64_t)mod_hi << 32 | (uint64_t)mod_lo & 0xffffffff;
-Emil
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev