summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLevend Sayar <[email protected]>2023-08-03 19:25:12 +0300
committerDavid Marchand <[email protected]>2023-10-06 12:05:15 +0200
commitcda3d17609c2cb81af67d5babbd0c1702b503fca (patch)
treef557f88bb63a0796c750178823b4dbf550b066b6 /drivers/gpu
parenta52d472c5c948d2af8da6ae97f1d5593bcafa002 (diff)
gpu/cuda: fix build with external GDRCopy
If gdrapi.h is available, meson sets DRIVERS_GPU_CUDA_GDRCOPY_H as 1. This causes gdrcopy.c build to give an error; because compiler can not find signature of getenv. stdlib.h is included for the definition of getenv function. Bugzilla ID: 1133 Fixes: ca12f5e8a7db ("gpu/cuda: mark unused GDRCopy functions parameters") Cc: [email protected] Reported-by: John Romein <[email protected]> Signed-off-by: Levend Sayar <[email protected]> Acked-by: Elena Agostini <[email protected]>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/cuda/gdrcopy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/cuda/gdrcopy.c b/drivers/gpu/cuda/gdrcopy.c
index 322a5dbeb2..bd56b73ce4 100644
--- a/drivers/gpu/cuda/gdrcopy.c
+++ b/drivers/gpu/cuda/gdrcopy.c
@@ -6,6 +6,8 @@
#ifdef DRIVERS_GPU_CUDA_GDRCOPY_H
+#include <stdlib.h>
+
static void *gdrclib;
static gdr_t (*sym_gdr_open)(void);
static int (*sym_gdr_pin_buffer)(gdr_t g, unsigned long addr, size_t size,