forked from thesofproject/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPSTREAM: dma-buf: make fence sequence numbers 64 bit v2
For a lot of use cases we need 64bit sequence numbers. Currently drivers overload the dma_fence structure to store the additional bits. Stop doing that and make the sequence number in the dma_fence always 64bit. For compatibility with hardware which can do only 32bit sequences the comparisons in __dma_fence_is_later only takes the lower 32bits as significant when the upper 32bits are all zero. v2: change the logic in __dma_fence_is_later Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Link: https://patchwork.freedesktop.org/patch/266927/ (cherry picked from commit b312d8c) Context: 0day reports: drivers/gpu/drm/virtio/virtgpu_fence.c:50:26: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'unsigned int' Analysis shows that commit 2f22ba2 ("UPSTREAM: drm/virtio: set seqno for dma-fence") moved sequence numbers from struct virtio_gpu_fence to struct dma_fence. In the upstream kernel, the sequence number in struct dma_fence is 64 bit wide. In chromeos-4.19, it is 32 bit, effecively reducing the sequence number space. We could "fix" the problem reported by 0day by replacing "%llu" with "%u", but that seems wrong. Backporting this commit, which introduces 64 bit sequence numbers in struct dma_fence, seems to be more appropriate. BUG=chromium:924405 TEST=glxgears in Crostini Reported-by: kbuild test robot <lkp@intel.com> Change-Id: Ib00eeefed33e97785b202249c03ab1155008afd5 Signed-off-by: Guenter Roeck <groeck@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1704173 Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
- Loading branch information
1 parent
1472299
commit 88445be
Showing
8 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters