mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
Add CDE program number selection for GP10B. Bug 1604102 Change-Id: I0054e670e3bc6b8c2380124eb58204088aaae275 Signed-off-by: Sami Kiminki <skiminki@nvidia.com> Reviewed-on: http://git-master/r/785459 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
/*
|
|
* 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;
|
|
}
|