From e2d8bdc38d3f7d8d54a9ad9dca6eb8544bc1866b Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 8 Jun 2021 18:32:23 -0700 Subject: [PATCH] gpu: nvgpu: unify nvgpu_get_gpfifo_entry_size moved nvgpu_get_gpfifo_entry_size implementation to common code. Jira GVSCI-10880 Signed-off-by: Richard Zhao Change-Id: Ia6ccee5e26836662f7c2196ff41658ff41e3a570 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2541575 Reviewed-by: svcacv Reviewed-by: svc_kernel_abi Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/include/nvgpu/channel.h | 5 ++++- drivers/gpu/nvgpu/os/linux/linux-channel.c | 5 ----- drivers/gpu/nvgpu/os/posix/posix-channel.c | 11 +---------- libs/dgpu/libnvgpu-drv-dgpu_safe.export | 1 - libs/igpu/libnvgpu-drv-igpu_safe.export | 1 - 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h index b844ec333..e8d754ba0 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/channel.h +++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h @@ -1026,7 +1026,10 @@ void nvgpu_channel_free_usermode_buffers(struct nvgpu_channel *c); * * @return Size of a gpfifo entry in bytes. */ -u32 nvgpu_get_gpfifo_entry_size(void); +static inline u32 nvgpu_get_gpfifo_entry_size(void) +{ + return sizeof(struct nvgpu_gpfifo_entry); +} #ifdef CONFIG_DEBUG_FS void trace_write_pushbuffers(struct nvgpu_channel *c, u32 count); diff --git a/drivers/gpu/nvgpu/os/linux/linux-channel.c b/drivers/gpu/nvgpu/os/linux/linux-channel.c index 69aa859c0..732cbafb0 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-channel.c +++ b/drivers/gpu/nvgpu/os/linux/linux-channel.c @@ -625,11 +625,6 @@ void nvgpu_channel_remove_support_linux(struct nvgpu_os_linux *l) g->os_channel.destroy_os_fence_framework = NULL; } -u32 nvgpu_get_gpfifo_entry_size(void) -{ - return sizeof(struct nvgpu_gpfifo_entry); -} - u32 nvgpu_channel_get_max_subctx_count(struct nvgpu_channel *ch) { struct nvgpu_channel_linux *priv = ch->os_priv; diff --git a/drivers/gpu/nvgpu/os/posix/posix-channel.c b/drivers/gpu/nvgpu/os/posix/posix-channel.c index 8309aaacf..b714ade5c 100644 --- a/drivers/gpu/nvgpu/os/posix/posix-channel.c +++ b/drivers/gpu/nvgpu/os/posix/posix-channel.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,15 +22,6 @@ #include -u32 nvgpu_get_gpfifo_entry_size(void) -{ - /* - * There is no struct nvgpu_gpfifo for us to use yet. But when it's - * defined in userspace this is how big it will be. - */ - return 8; -} - u32 nvgpu_channel_get_max_subctx_count(struct nvgpu_channel *ch) { return 64; diff --git a/libs/dgpu/libnvgpu-drv-dgpu_safe.export b/libs/dgpu/libnvgpu-drv-dgpu_safe.export index 6ae8b8d4c..a49caad61 100644 --- a/libs/dgpu/libnvgpu-drv-dgpu_safe.export +++ b/libs/dgpu/libnvgpu-drv-dgpu_safe.export @@ -401,7 +401,6 @@ nvgpu_free_enabled_flags nvgpu_free_fixed nvgpu_free_gr_ctx_struct nvgpu_get -nvgpu_get_gpfifo_entry_size nvgpu_channel_get_max_subctx_count nvgpu_get_pte nvgpu_gmmu_default_big_page_size diff --git a/libs/igpu/libnvgpu-drv-igpu_safe.export b/libs/igpu/libnvgpu-drv-igpu_safe.export index 3ded6ec32..0564a2bf3 100644 --- a/libs/igpu/libnvgpu-drv-igpu_safe.export +++ b/libs/igpu/libnvgpu-drv-igpu_safe.export @@ -417,7 +417,6 @@ nvgpu_free_enabled_flags nvgpu_free_fixed nvgpu_free_gr_ctx_struct nvgpu_get -nvgpu_get_gpfifo_entry_size nvgpu_channel_get_max_subctx_count nvgpu_get_pte nvgpu_gmmu_default_big_page_size