mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
gpu: host1x-nvhost: Update syncpt helper functions
- add get aperture API - add get syncpt offset api Bug 3768126 Change-Id: I95ae6a149e8a362317f4f1c89e7a1eac3c596fe4 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2782259 Tested-by: Omar Nemri <onemri@nvidia.com> Reviewed-by: Omar Nemri <onemri@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
b5c5a485da
commit
2e94a90e1d
@@ -12,6 +12,7 @@
|
|||||||
#include <linux/iommu.h>
|
#include <linux/iommu.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/nvhost.h>
|
#include <linux/nvhost.h>
|
||||||
|
#include <linux/nvhost_t194.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
@@ -389,6 +390,27 @@ static int nvhost_syncpt_get_page_size(struct device_node *np, uint32_t *size)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 nvhost_syncpt_unit_interface_get_byte_offset_ext(struct platform_device *pdev,
|
||||||
|
u32 syncpt_id)
|
||||||
|
{
|
||||||
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
|
struct nvhost_syncpt_interface *syncpt_if = pdata->syncpt_unit_interface;
|
||||||
|
|
||||||
|
if (WARN_ON(!syncpt_if))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return syncpt_id * syncpt_if->page_size;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(nvhost_syncpt_unit_interface_get_byte_offset_ext);
|
||||||
|
|
||||||
|
int nvhost_syncpt_unit_interface_get_aperture(struct platform_device *pdev,
|
||||||
|
u64 *base, size_t *size)
|
||||||
|
{
|
||||||
|
return nvhost_syncpt_get_aperture(pdev->dev.parent->of_node, base,
|
||||||
|
size);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(nvhost_syncpt_unit_interface_get_aperture);
|
||||||
|
|
||||||
int nvhost_syncpt_unit_interface_init(struct platform_device *pdev)
|
int nvhost_syncpt_unit_interface_init(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
|
||||||
|
|||||||
@@ -24,6 +24,19 @@ int nvhost_syncpt_unit_interface_get_aperture(
|
|||||||
phys_addr_t *base,
|
phys_addr_t *base,
|
||||||
size_t *size);
|
size_t *size);
|
||||||
|
|
||||||
|
#ifdef CONFIG_TEGRA_HOST1X
|
||||||
|
u32 nvhost_syncpt_unit_interface_get_byte_offset_ext(
|
||||||
|
struct platform_device *host_pdev,
|
||||||
|
u32 syncpt_id);
|
||||||
|
#else
|
||||||
u32 nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id);
|
u32 nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id);
|
||||||
|
|
||||||
|
static inline u32 nvhost_syncpt_unit_interface_get_byte_offset_ext(
|
||||||
|
struct platform_device *host_pdev,
|
||||||
|
u32 syncpt_id)
|
||||||
|
{
|
||||||
|
return nvhost_syncpt_unit_interface_get_byte_offset(syncpt_id);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __LINUX_NVHOST_T194_H__ */
|
#endif /* __LINUX_NVHOST_T194_H__ */
|
||||||
|
|||||||
Reference in New Issue
Block a user