From 23d545f2508cc541b51bf965b4bbcfac4a2dfb23 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Thu, 9 Apr 2020 11:04:41 +0530 Subject: [PATCH] gpu: nvgpu: dma_buf_ops map unavailable in upstream This function op is deprecated after kernel version 5.5. Compile the corresponding code under version check. Bug 2925664 Change-Id: Ice1b02a3d6c7942ec63a609c515436d2622c3575 Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2326512 Reviewed-by: automaticguardword Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c index 7fc0a32b5..3e8f4962e 100644 --- a/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -92,11 +92,13 @@ static void gk20a_vidbuf_release(struct dma_buf *dmabuf) nvgpu_put(g); } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0) static void *gk20a_vidbuf_kmap(struct dma_buf *dmabuf, unsigned long page_num) { WARN_ON("Not supported"); return NULL; } +#endif #if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 16, 0) static void *gk20a_vidbuf_kmap_atomic(struct dma_buf *dmabuf, @@ -143,7 +145,9 @@ static const struct dma_buf_ops gk20a_vidbuf_ops = { #if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 16, 0) .map_atomic = gk20a_vidbuf_kmap_atomic, #endif +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0) .map = gk20a_vidbuf_kmap, +#endif #else .kmap_atomic = gk20a_vidbuf_kmap_atomic, .kmap = gk20a_vidbuf_kmap,