gpu: nvgpu: Move CDE code to Linux module

CDE is only used in Linux platforms, and the code is highly dependent
on Linux APIs. Move the common CDE code to Linux module and leave only
the chip specific parts to HAL.

Change-Id: I507fe7eceaf7607303dfdddcf438449a5f582ea7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1554755
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-09-07 10:43:47 -07:00
committed by mobile promotions
parent 17451138cf
commit c37c9baae6
13 changed files with 171 additions and 136 deletions

View File

@@ -39,6 +39,7 @@
#include "pci.h"
#include "module.h"
#include "intr.h"
#include "cde.h"
#ifdef CONFIG_TEGRA_19x_GPU
#include "nvgpu_gpuid_t19x.h"
#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
@@ -185,7 +186,7 @@ int gk20a_pm_finalize_poweron(struct device *dev)
gk20a_scale_resume(dev_from_gk20a(g));
if (platform->has_cde)
gk20a_init_cde_support(g);
gk20a_init_cde_support(l);
done:
if (err)
@@ -197,6 +198,7 @@ done:
static int gk20a_pm_prepare_poweroff(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
int ret = 0;
struct gk20a_platform *platform = gk20a_get_platform(dev);
@@ -207,8 +209,15 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
if (!g->power_on)
goto done;
if (gk20a_fifo_is_engine_busy(g)) {
ret = -EBUSY;
goto done;
}
gk20a_scale_suspend(dev);
gk20a_cde_suspend(l);
ret = gk20a_prepare_poweroff(g);
if (ret)
goto error;
@@ -974,6 +983,7 @@ static int __exit gk20a_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct gk20a *g = get_gk20a(dev);
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
struct gk20a_platform *platform = gk20a_get_platform(dev);
gk20a_dbg_fn("");
@@ -982,7 +992,7 @@ static int __exit gk20a_remove(struct platform_device *pdev)
return vgpu_remove(pdev);
if (platform->has_cde)
gk20a_cde_destroy(g);
gk20a_cde_destroy(l);
gk20a_ctxsw_trace_cleanup(g);