From 2d5ff668cbc6a932df2c9cf79627d1d340e5c2c0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 27 Oct 2014 11:06:59 +0200 Subject: gpu: nvgpu: GR and LTC HAL to use const structs Convert GR and LTC HALs to use const structs, and initialize them with macros. Bug 1567274 Change-Id: Ia3f24a5eccb27578d9cba69755f636818d11275c Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/590371 --- drivers/gpu/nvgpu/nvgpu_gpuid.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 drivers/gpu/nvgpu/nvgpu_gpuid.h (limited to 'drivers/gpu/nvgpu/nvgpu_gpuid.h') diff --git a/drivers/gpu/nvgpu/nvgpu_gpuid.h b/drivers/gpu/nvgpu/nvgpu_gpuid.h new file mode 100644 index 00000000..391d286e --- /dev/null +++ b/drivers/gpu/nvgpu/nvgpu_gpuid.h @@ -0,0 +1,30 @@ +/* + * NVIDIA GPU ID functions, definitions. + * + * Copyright (c) 2014, 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, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ +#ifndef _NVGPU_GPUID_H_ +#define _NVGPU_GPUID_H_ + +#define NVGPU_GPU_ARCHITECTURE_SHIFT 4 + +/* constructs unique and compact GPUID from nvgpu_gpu_characteristics + * arch/impl fields */ +#define NVGPU_GPUID(arch, impl) ((u32) ((arch) | (impl))) + +#define NVGPU_GPUID_GK20A \ + NVGPU_GPUID(NVGPU_GPU_ARCH_GK100, NVGPU_GPU_IMPL_GK20A) + +#define NVGPU_GPUID_GM20B \ + NVGPU_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B) + +#endif /* _NVGPU_GPU_ID_H_ */ -- cgit v1.2.2