From 366386d1898af61eb425aa8b37cfb656ff898c1a Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 2 Jun 2017 14:47:20 +0530 Subject: gpu: nvgpu: add t19x specific nvhost abstraction files Add new abstraction file common/linux/nvhost_t19x.c for all nvhost APIs exported from linux/nvhost_t194.h This file will be compiled only if config CONFIG_TEGRA_GK20A_NVHOST is set Export the new headers from file Also add dummy private header file nvhost_priv_t19x.h to store definition of private structure nvgpu_nvhost_dev This file should be deleted when nvgpu-t19x repo is merged into common nvhost repo Jira NVGPU-29 Change-Id: I8c08c9242b08cc45f7c99cc400b3e1a720f9439c Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1493792 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- drivers/gpu/nvgpu/common/linux/nvhost_priv_t19x.h | 29 ++++++++++++++++++ drivers/gpu/nvgpu/common/linux/nvhost_t19x.c | 36 +++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 drivers/gpu/nvgpu/common/linux/nvhost_priv_t19x.h create mode 100644 drivers/gpu/nvgpu/common/linux/nvhost_t19x.c (limited to 'drivers/gpu/nvgpu/common/linux') diff --git a/drivers/gpu/nvgpu/common/linux/nvhost_priv_t19x.h b/drivers/gpu/nvgpu/common/linux/nvhost_priv_t19x.h new file mode 100644 index 00000000..7ff6184d --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/nvhost_priv_t19x.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __NVGPU_NVHOST_PRIV_T19X_H__ +#define __NVGPU_NVHOST_PRIV_T19X_H__ + +/* + * This file is copy of common/linux/nvhost_priv.h in nvgpu repo + * This file should be removed when nvgpu-t19x repo is merged + * into common nvgpu repo + */ +struct nvgpu_nvhost_dev { + struct platform_device *host1x_pdev; +}; + +#endif /* __NVGPU_NVHOST_PRIV_T19X_H__ */ diff --git a/drivers/gpu/nvgpu/common/linux/nvhost_t19x.c b/drivers/gpu/nvgpu/common/linux/nvhost_t19x.c new file mode 100644 index 00000000..0bbb3d72 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/nvhost_t19x.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017, 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include + +#include "nvhost_priv_t19x.h" + +int nvgpu_nvhost_syncpt_unit_interface_get_aperture( + struct nvgpu_nvhost_dev *nvhost_dev, + phys_addr_t *base, + size_t *size) +{ + return nvhost_syncpt_unit_interface_get_aperture( + nvhost_dev->host1x_pdev, base, size); +} + +u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id) +{ + return nvhost_syncpt_unit_interface_get_byte_offset(syncpt_id); +} -- cgit v1.2.2