Re: [PATCH 01/10] dma-buf: make fence sequence numbers 64 bit v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Christian König (2018-12-04 11:59:39)
> -static inline bool __dma_fence_is_later(u32 f1, u32 f2)
> +static inline bool __dma_fence_is_later(u64 f1, u64 f2)
>  {
> -       return (int)(f1 - f2) > 0;
> +       /* This is for backward compatibility with drivers which can only handle
> +        * 32bit sequence numbers. Use a 64bit compare when any of the higher
> +        * bits are none zero, otherwise use a 32bit compare with wrap around
> +        * handling.
> +        */
> +       if (upper_32_bits(f1) || upper_32_bits(f2))
> +               return f1 > f2;
> +
> +       return (int)(lower_32_bits(f1) - lower_32_bits(f2)) > 0;

Or just "(int64_t)(f1 - f2) > 0", works if drivers are only using the low
32b and if they use the full 64b.
-Chris
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux