From 95a271905918d91468134728079c3025ea58b537 Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Tue, 18 Aug 2015 19:34:51 +0300 Subject: gpu: nvgpu: Add CDE program number selection for GP10B Add CDE program number selection for GP10B. Bug 1604102 Change-Id: I0054e670e3bc6b8c2380124eb58204088aaae275 Signed-off-by: Sami Kiminki Reviewed-on: http://git-master/r/785459 Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp10b/cde_gp10b.c | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 drivers/gpu/nvgpu/gp10b/cde_gp10b.c (limited to 'drivers/gpu/nvgpu/gp10b/cde_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/cde_gp10b.c b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c new file mode 100644 index 00000000..acb8aee3 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/cde_gp10b.c @@ -0,0 +1,64 @@ +/* + * GP10B CDE + * + * Copyright (c) 2015, 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. + */ + +#include "gk20a/gk20a.h" +#include "cde_gp10b.h" + +enum gp10b_programs { + GP10B_PROG_HPASS = 0, + GP10B_PROG_HPASS_4K = 1, + GP10B_PROG_VPASS = 2, + GP10B_PROG_VPASS_4K = 3, + GP10B_PROG_HPASS_DEBUG = 4, + GP10B_PROG_HPASS_4K_DEBUG = 5, + GP10B_PROG_VPASS_DEBUG = 6, + GP10B_PROG_VPASS_4K_DEBUG = 7, + GP10B_PROG_PASSTHROUGH = 8, +}; + +static void gp10b_cde_get_program_numbers(struct gk20a *g, + u32 block_height_log2, + int *hprog_out, int *vprog_out) +{ + int hprog, vprog; + + if (g->cde_app.shader_parameter == 1) { + hprog = GP10B_PROG_PASSTHROUGH; + vprog = GP10B_PROG_PASSTHROUGH; + } else { + hprog = GP10B_PROG_HPASS; + vprog = GP10B_PROG_VPASS; + if (g->cde_app.shader_parameter == 2) { + hprog = GP10B_PROG_HPASS_DEBUG; + vprog = GP10B_PROG_VPASS_DEBUG; + } + if (g->mm.bypass_smmu) { + if (!g->mm.disable_bigpage) { + gk20a_warn(&g->dev->dev, + "when bypass_smmu is 1, disable_bigpage must be 1 too"); + } + hprog |= 1; + vprog |= 1; + } + } + + *hprog_out = hprog; + *vprog_out = vprog; +} + +void gp10b_init_cde_ops(struct gpu_ops *gops) +{ + gops->cde.get_program_numbers = gp10b_cde_get_program_numbers; +} -- cgit v1.2.2