From 76b78b6fdcb0bbed72645aaa85de6013e2b135c3 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 7 Feb 2017 16:29:51 -0800 Subject: gpu: nvgpu: Remove nvgpu_gpuid_t18x.h Remove nvgpu_gpuid_t18x.h since this file is now visible. Migrate the relevant definitions and defines into their expected places and make the code use the real defines. No longer is hiding t18x specific stuff necessary. Bug 1799159 Change-Id: I47fa2392e46fdb7aacc70aeb0cc8c3f5ca0dc22f Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1300976 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 10 ++---- drivers/gpu/nvgpu/gk20a/gk20a.h | 7 +++- drivers/gpu/nvgpu/gk20a/hal.c | 16 ++++----- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 12 ++----- drivers/gpu/nvgpu/gp106/acr_gp106.c | 1 - drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c | 1 - drivers/gpu/nvgpu/gp106/hal_gp106.c | 2 -- drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c | 2 +- drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h | 45 -------------------------- drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 1 - drivers/gpu/nvgpu/vgpu/vgpu.c | 11 ++----- drivers/gpu/nvgpu/vgpu/vgpu.h | 1 + include/uapi/linux/nvgpu-t18x.h | 7 ---- include/uapi/linux/nvgpu.h | 9 ++++-- 15 files changed, 31 insertions(+), 95 deletions(-) delete mode 100644 drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index e2795fbf..3504a32f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -65,10 +65,6 @@ #define CREATE_TRACE_POINTS #include -#ifdef CONFIG_ARCH_TEGRA_18x_SOC -#include "nvgpu_gpuid_t18x.h" -#endif - #ifdef CONFIG_TEGRA_19x_GPU #include "nvgpu_gpuid_t19x.h" #endif @@ -1133,8 +1129,8 @@ static struct of_device_id tegra_gk20a_of_match[] = { { .compatible = "nvidia,tegra210-gm20b", .data = &gm20b_tegra_platform }, #ifdef CONFIG_ARCH_TEGRA_18x_SOC - { .compatible = TEGRA_18x_GPU_COMPAT_TEGRA, - .data = &t18x_gpu_tegra_platform }, + { .compatible = "nvidia,tegra186-gp10b", + .data = &gp10b_tegra_platform }, #endif #ifdef CONFIG_TEGRA_19x_GPU { .compatible = TEGRA_19x_GPU_COMPAT_TEGRA, @@ -1160,7 +1156,7 @@ static struct of_device_id tegra_gk20a_of_match[] = { { .compatible = "nvidia,generic-gm20b", .data = &gk20a_generic_platform }, #ifdef CONFIG_ARCH_TEGRA_18x_SOC - { .compatible = TEGRA_18x_GPU_COMPAT_GENERIC, + { .compatible = "nvidia,generic-gp10b", .data = &gk20a_generic_platform }, #endif { }, diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index c79cc6c8..8006a4fe 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1363,9 +1363,14 @@ int gk20a_wait_for_idle(struct device *dev); #define GK20A_GPUID_GK20A \ GK20A_GPUID(NVGPU_GPU_ARCH_GK100, NVGPU_GPU_IMPL_GK20A) - #define GK20A_GPUID_GM20B \ GK20A_GPUID(NVGPU_GPU_ARCH_GM200, NVGPU_GPU_IMPL_GM20B) +#define NVGPU_GPUID_GP10B \ + GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP10B) +#define NVGPU_GPUID_GP104 \ + GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP104) +#define NVGPU_GPUID_GP106 \ + GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP106) int gk20a_init_gpu_characteristics(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gk20a/hal.c b/drivers/gpu/nvgpu/gk20a/hal.c index d4bd0ddc..dc4fcf1c 100644 --- a/drivers/gpu/nvgpu/gk20a/hal.c +++ b/drivers/gpu/nvgpu/gk20a/hal.c @@ -16,10 +16,8 @@ #include "gk20a.h" #include "hal_gk20a.h" #include "gm20b/hal_gm20b.h" - -#ifdef CONFIG_ARCH_TEGRA_18x_SOC -#include "nvgpu_gpuid_t18x.h" -#endif +#include "gp10b/hal_gp10b.h" +#include "gp106/hal_gp106.h" #ifdef CONFIG_TEGRA_19x_GPU #include "nvgpu_gpuid_t19x.h" @@ -39,13 +37,13 @@ int gpu_init_hal(struct gk20a *g) return -ENODEV; break; #if defined(CONFIG_ARCH_TEGRA_18x_SOC) - case TEGRA_18x_GPUID: - if (TEGRA_18x_GPUID_HAL(g)) + case NVGPU_GPUID_GP10B: + if (gp10b_init_hal(g)) return -ENODEV; break; - case TEGRA_18x_GPUID2: - case TEGRA_18x_GPUID3: - if (TEGRA_18x_GPUID2_HAL(g)) + case NVGPU_GPUID_GP104: + case NVGPU_GPUID_GP106: + if (gp106_init_hal(g)) return -ENODEV; break; #endif diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index c841c8e6..42be2271 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -274,6 +274,7 @@ extern struct gk20a_platform gk20a_generic_platform; #ifdef CONFIG_TEGRA_GK20A extern struct gk20a_platform gk20a_tegra_platform; extern struct gk20a_platform gm20b_tegra_platform; +extern struct gk20a_platform gp10b_tegra_platform; #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION extern struct gk20a_platform vgpu_tegra_platform; #endif diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index a5664a0e..1322460c 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -34,10 +34,6 @@ #include #include -#ifdef CONFIG_ARCH_TEGRA_18x_SOC -#include "nvgpu_gpuid_t18x.h" -#endif - #ifdef CONFIG_TEGRA_19x_GPU #include "nvgpu_gpuid_t19x.h" #endif @@ -3707,13 +3703,11 @@ static u8 get_perfmon_id(struct pmu_gk20a *pmu) case GK20A_GPUID_GM20B: unit_id = PMU_UNIT_PERFMON; break; -#if defined(CONFIG_ARCH_TEGRA_18x_SOC) - case TEGRA_18x_GPUID: - case TEGRA_18x_GPUID2: - case TEGRA_18x_GPUID3: + case NVGPU_GPUID_GP10B: + case NVGPU_GPUID_GP104: + case NVGPU_GPUID_GP106: unit_id = PMU_UNIT_PERFMON_T18X; break; -#endif #if defined(CONFIG_TEGRA_19x_GPU) case TEGRA_19x_GPUID: unit_id = PMU_UNIT_PERFMON_T18X; diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index a4dfd07f..37a3d152 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -31,7 +31,6 @@ #include "gp106/pmu_gp106.h" #include "sec2_gp106.h" -#include "nvgpu_gpuid_t18x.h" #include #include diff --git a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c index 1f47cc5a..419c71df 100644 --- a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c +++ b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c @@ -15,7 +15,6 @@ #include "gk20a/gk20a.h" #include "gr_ctx_gp106.h" -#include "nvgpu_gpuid_t18x.h" static int gr_gp106_get_netlist_name(struct gk20a *g, int index, char *name) { diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index cece5dd6..d07223c9 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -52,8 +52,6 @@ #include "gp106/fb_gp106.h" #include "gp106/gp106_gating_reglist.h" -#include "nvgpu_gpuid_t18x.h" - #include static struct gpu_ops gp106_ops = { diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c index 6795c99a..3a232402 100644 --- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c @@ -401,7 +401,7 @@ static int gp10b_clk_get_freqs(struct device *dev, return 0; } -struct gk20a_platform t18x_gpu_tegra_platform = { +struct gk20a_platform gp10b_tegra_platform = { .has_syncpoints = true, /* power management configuration */ diff --git a/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h b/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h deleted file mode 100644 index 84da4b96..00000000 --- a/drivers/gpu/nvgpu/nvgpu_gpuid_t18x.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * NVIDIA GPU ID functions, definitions. - * - * Copyright (c) 2014-2016, 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_T18X_H_ -#define _NVGPU_GPUID_T18X_H_ - -#define NVGPU_GPUID_GP10B \ - GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP10B) -#define NVGPU_GPUID_GP104 \ - GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP104) -#define NVGPU_GPUID_GP106 \ - GK20A_GPUID(NVGPU_GPU_ARCH_GP100, NVGPU_GPU_IMPL_GP106) - -#define NVGPU_COMPAT_TEGRA_GP10B "nvidia,tegra186-gp10b" -#define NVGPU_COMPAT_GENERIC_GP10B "nvidia,generic-gp10b" - -#define TEGRA_18x_GPUID NVGPU_GPUID_GP10B -#define TEGRA_18x_GPUID_HAL gp10b_init_hal -#define TEGRA_18x_GPU_COMPAT_TEGRA NVGPU_COMPAT_TEGRA_GP10B -#define TEGRA_18x_GPU_COMPAT_GENERIC NVGPU_COMPAT_GENERIC_GP10B -#define TEGRA_18x_GPUID2 NVGPU_GPUID_GP104 -#define TEGRA_18x_GPUID2_HAL gp106_init_hal -#define TEGRA_18x_GPUID3 NVGPU_GPUID_GP106 -#define TEGRA_18x_GPUID3_HAL gp106_init_hal -struct gpu_ops; -extern int gp10b_init_hal(struct gk20a *); -extern int gp106_init_hal(struct gk20a *); -extern struct gk20a_platform t18x_gpu_tegra_platform; - -#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION -#define TEGRA_18x_GPUID_VGPU_HAL vgpu_gp10b_init_hal -extern int vgpu_gp10b_init_hal(struct gk20a *); -#endif -#endif diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index b665a8dd..14a7768a 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -16,7 +16,6 @@ #include "vgpu_gr_gp10b.h" #include "vgpu_fifo_gp10b.h" #include "vgpu_mm_gp10b.h" -#include "nvgpu_gpuid_t18x.h" int vgpu_gp10b_init_hal(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index c8ab23f1..d8e0dfa1 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -31,10 +31,6 @@ #include -#ifdef CONFIG_ARCH_TEGRA_18x_SOC -#include "nvgpu_gpuid_t18x.h" -#endif - static inline int vgpu_comm_init(struct platform_device *pdev) { size_t queue_sizes[] = { TEGRA_VGPU_QUEUE_SIZES }; @@ -374,11 +370,10 @@ static int vgpu_init_hal(struct gk20a *g) gk20a_dbg_info("gm20b detected"); err = vgpu_gm20b_init_hal(g); break; -#if defined(CONFIG_ARCH_TEGRA_18x_SOC) - case TEGRA_18x_GPUID: - err = TEGRA_18x_GPUID_VGPU_HAL(g); + case NVGPU_GPUID_GP10B: + gk20a_dbg_info("gp10b detected"); + err = vgpu_gp10b_init_hal(g); break; -#endif default: gk20a_err(g->dev, "no support for %x", ver); err = -ENODEV; diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h index 098c7dbd..7883abc1 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/vgpu.h @@ -101,6 +101,7 @@ int vgpu_comm_sendrecv(struct tegra_vgpu_cmd_msg *msg, size_t size_in, void vgpu_init_hal_common(struct gk20a *g); int vgpu_gk20a_init_hal(struct gk20a *g); int vgpu_gm20b_init_hal(struct gk20a *g); +int vgpu_gp10b_init_hal(struct gk20a *g); void vgpu_init_dbg_session_ops(struct gpu_ops *gops); diff --git a/include/uapi/linux/nvgpu-t18x.h b/include/uapi/linux/nvgpu-t18x.h index 777f1553..16cbd81e 100644 --- a/include/uapi/linux/nvgpu-t18x.h +++ b/include/uapi/linux/nvgpu-t18x.h @@ -24,11 +24,6 @@ #ifndef _UAPI__LINUX_NVGPU_T18X_IOCTL_H_ #define _UAPI__LINUX_NVGPU_T18X_IOCTL_H_ -#define NVGPU_GPU_ARCH_GP100 0x00000130 -#define NVGPU_GPU_IMPL_GP104 0x00000004 -#define NVGPU_GPU_IMPL_GP106 0x00000006 -#define NVGPU_GPU_IMPL_GP10B 0x0000000B - /* * this flag is used in struct nvgpu_as_map_buffer_ex_args * to specify IO coherence @@ -70,5 +65,3 @@ #define NVGPU_IOCTL_CHANNEL_EVENT_ID_CILP_PREEMPTION_COMPLETE 4 #endif /* _UAPI__LINUX_NVGPU_T18X_IOCTL_H_ */ - - diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 6101774f..3f358558 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -81,14 +81,17 @@ struct nvgpu_gpu_zbc_query_table_args { /* This contains the minimal set by which the userspace can determine all the properties of the GPU */ - #define NVGPU_GPU_ARCH_GK100 0x000000E0 -#define NVGPU_GPU_IMPL_GK20A 0x0000000A - #define NVGPU_GPU_ARCH_GM200 0x00000120 +#define NVGPU_GPU_ARCH_GP100 0x00000130 + +#define NVGPU_GPU_IMPL_GK20A 0x0000000A #define NVGPU_GPU_IMPL_GM204 0x00000004 #define NVGPU_GPU_IMPL_GM206 0x00000006 #define NVGPU_GPU_IMPL_GM20B 0x0000000B +#define NVGPU_GPU_IMPL_GP104 0x00000004 +#define NVGPU_GPU_IMPL_GP106 0x00000006 +#define NVGPU_GPU_IMPL_GP10B 0x0000000B #ifdef CONFIG_ARCH_TEGRA_18x_SOC #include -- cgit v1.2.2