mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: add gr utils function for simple checksum
Added following gr utils function for simple u32 checksum:
static inline u32 nvgpu_gr_checksum_u32(u32 a, u32 b)
{
return (u32)(((u64)a + (u64)b) % (U32_MAX));
}
JIRA NVGPU-3622
Change-Id: I9798fd3b21750c34a040639c7793e65123935d41
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2133795
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d17b2b9622
commit
fd2fb6dbc7
@@ -23,6 +23,8 @@
|
||||
#ifndef NVGPU_GR_UTILS_H
|
||||
#define NVGPU_GR_UTILS_H
|
||||
|
||||
#include <nvgpu/types.h>
|
||||
|
||||
struct gk20a;
|
||||
struct nvgpu_gr_falcon;
|
||||
struct nvgpu_gr_obj_ctx_golden_image;
|
||||
@@ -36,6 +38,11 @@ struct nvgpu_gr_hwpm_map;
|
||||
struct nvgpu_gr_intr;
|
||||
struct nvgpu_gr_global_ctx_buffer_desc;
|
||||
|
||||
static inline u32 nvgpu_gr_checksum_u32(u32 a, u32 b)
|
||||
{
|
||||
return (u32)(((u64)a + (u64)b) % (U32_MAX));
|
||||
}
|
||||
|
||||
/* gr struct pointers */
|
||||
struct nvgpu_gr_falcon *nvgpu_gr_get_falcon_ptr(struct gk20a *g);
|
||||
struct nvgpu_gr_obj_ctx_golden_image *nvgpu_gr_get_golden_image_ptr(
|
||||
|
||||
Reference in New Issue
Block a user