mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-25 10:42:21 +03:00
DCE-KMD: Add OS abstraction
- Add OS abstraction for DCE-KMD driver as it will be used
for Linux as well as HVRTOS.
- The original OS abstraction headers are maintined under
display/drivers repo (display/drivers/server/os/include/).
- From that copy, only linux-kmd relevant headers
are mirrored here as there's no need to mirror HVRTOS
related headers.
- But we need a copy here as we cannot include external paths
in kernel builds.
JIRA TDS-16126
Change-Id: Iabebef33719c38a8aa4db8573a0dd7dd7e5f83f6
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3194862
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -14,6 +14,7 @@ endif # CONFIG_TEGRA_OOT_MODULE
|
||||
|
||||
ccflags-y += -I$(srctree.nvidia-oot)/include
|
||||
ccflags-y += -I$(srctree.nvidia-oot)/drivers/platform/tegra/dce/include
|
||||
ccflags-y += -I$(srctree.nvidia-oot)/drivers/platform/tegra/dce/os/include
|
||||
obj-$(CONFIG_TEGRA_DCE) += tegra-dce.o
|
||||
|
||||
tegra-dce-$(CONFIG_TEGRA_DCE) += dce-ast.o
|
||||
|
||||
24
drivers/platform/tegra/dce/os/include/atomic.h
Normal file
24
drivers/platform/tegra/dce/os/include/atomic.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_ATOMIC_H
|
||||
#define NVDISPLAY_SERVER_ATOMIC_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux-kmd/atomic.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/atomic.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_ATOMIC_H */
|
||||
37
drivers/platform/tegra/dce/os/include/linux-kmd/atomic.h
Normal file
37
drivers/platform/tegra/dce/os/include/linux-kmd/atomic.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_ATOMIC_LINUX_H
|
||||
#define NVDISPLAY_SERVER_ATOMIC_LINUX_H
|
||||
|
||||
#include <linux/atomic.h>
|
||||
|
||||
/** 32 bit atomic variable. */
|
||||
typedef atomic_t os_atomic_t;
|
||||
|
||||
static inline void os_atomic_set(os_atomic_t *v, int i)
|
||||
{
|
||||
atomic_set(v, i);
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int os_atomic_read(os_atomic_t *v)
|
||||
{
|
||||
return atomic_read(v);
|
||||
}
|
||||
|
||||
static inline int os_atomic_add_unless(os_atomic_t *v, int a, int u)
|
||||
{
|
||||
return atomic_add_unless(v, a, u);
|
||||
}
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_ATOMIC_LINUX_H */
|
||||
132
drivers/platform/tegra/dce/os/include/linux-kmd/os-cond.h
Normal file
132
drivers/platform/tegra/dce/os/include/linux-kmd/os-cond.h
Normal file
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_COND_LINUX_H
|
||||
#define NVDISPLAY_SERVER_OS_COND_LINUX_H
|
||||
|
||||
#include <linux/wait.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
struct dce_cond {
|
||||
bool initialized;
|
||||
wait_queue_head_t wq;
|
||||
};
|
||||
|
||||
/**
|
||||
* DCE_COND_WAIT - Wait for a condition to be true
|
||||
*
|
||||
* @c - The condition variable to sleep on
|
||||
* @condition - The condition that needs to be true
|
||||
*
|
||||
* Wait for a condition to become true.
|
||||
*/
|
||||
#define DCE_COND_WAIT(c, condition) \
|
||||
({\
|
||||
int ret = 0; \
|
||||
wait_event((c)->wq, condition); \
|
||||
ret;\
|
||||
})
|
||||
|
||||
/**
|
||||
* DCE_COND_WAIT_INTERRUPTIBLE - Wait for a condition to be true
|
||||
*
|
||||
* @c - The condition variable to sleep on
|
||||
* @condition - The condition that needs to be true
|
||||
*
|
||||
* Wait for a condition to become true. Returns -ERESTARTSYS
|
||||
* on signal.
|
||||
*/
|
||||
#define DCE_COND_WAIT_INTERRUPTIBLE(c, condition) \
|
||||
({ \
|
||||
int ret = 0; \
|
||||
ret = wait_event_interruptible((c)->wq, condition); \
|
||||
ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
* DCE_COND_WAIT_TIMEOUT - Wait for a condition to be true
|
||||
*
|
||||
* @c - The condition variable to sleep on
|
||||
* @condition - The condition that needs to be true
|
||||
* @timeout_ms - Timeout in milliseconds, or 0 for infinite wait.
|
||||
* This parameter must be a u32. Since this is a macro, this is
|
||||
* enforced by assigning a typecast NULL pointer to a u32 tmp
|
||||
* variable which will generate a compiler warning (or error if
|
||||
* the warning is configured as an error).
|
||||
*
|
||||
* Wait for a condition to become true. Returns -ETIMEOUT if
|
||||
* the wait timed out with condition false.
|
||||
*/
|
||||
#define DCE_COND_WAIT_TIMEOUT(c, condition, timeout_ms) \
|
||||
({\
|
||||
int ret = 0; \
|
||||
/* This is the assignment to enforce a u32 for timeout_ms */ \
|
||||
u32 *tmp = (typeof(timeout_ms) *)NULL; \
|
||||
(void)tmp; \
|
||||
if (timeout_ms > 0U) { \
|
||||
long _ret = wait_event_timeout((c)->wq, condition, \
|
||||
msecs_to_jiffies(timeout_ms)); \
|
||||
if (_ret == 0) \
|
||||
ret = -ETIMEDOUT; \
|
||||
} else { \
|
||||
wait_event((c)->wq, condition); \
|
||||
} \
|
||||
ret;\
|
||||
})
|
||||
|
||||
/**
|
||||
* DCE_COND_WAIT_INTERRUPTIBLE_TIMEOUT - Wait for a condition to be true
|
||||
*
|
||||
* @c - The condition variable to sleep on
|
||||
* @condition - The condition that needs to be true
|
||||
* @timeout_ms - Timeout in milliseconds, or 0 for infinite wait.
|
||||
* This parameter must be a u32. Since this is a macro, this is
|
||||
* enforced by assigning a typecast NULL pointer to a u32 tmp
|
||||
* variable which will generate a compiler warning (or error if
|
||||
* the warning is configured as an error).
|
||||
*
|
||||
* Wait for a condition to become true. Returns -ETIMEOUT if
|
||||
* the wait timed out with condition false or -ERESTARTSYS on
|
||||
* signal.
|
||||
*/
|
||||
#define DCE_COND_WAIT_INTERRUPTIBLE_TIMEOUT(c, condition, timeout_ms) \
|
||||
({ \
|
||||
int ret = 0; \
|
||||
/* This is the assignment to enforce a u32 for timeout_ms */ \
|
||||
u32 *tmp = (typeof(timeout_ms) *)NULL; \
|
||||
(void)tmp; \
|
||||
if (timeout_ms > 0U) { \
|
||||
long _ret = wait_event_interruptible_timeout((c)->wq, \
|
||||
condition, msecs_to_jiffies(timeout_ms)); \
|
||||
if (_ret == 0) \
|
||||
ret = -ETIMEDOUT; \
|
||||
else if (_ret == -ERESTARTSYS) \
|
||||
ret = -ERESTARTSYS; \
|
||||
} else { \
|
||||
ret = wait_event_interruptible((c)->wq, condition); \
|
||||
} \
|
||||
ret; \
|
||||
})
|
||||
|
||||
int dce_cond_init(struct dce_cond *cond);
|
||||
|
||||
void dce_cond_signal(struct dce_cond *cond);
|
||||
|
||||
void dce_cond_signal_interruptible(struct dce_cond *cond);
|
||||
|
||||
int dce_cond_broadcast(struct dce_cond *cond);
|
||||
|
||||
int dce_cond_broadcast_interruptible(struct dce_cond *cond);
|
||||
|
||||
void dce_cond_destroy(struct dce_cond *cond);
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_COND_LINUX_H */
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_DEVICE_LINUX_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_DEVICE_LINUX_H
|
||||
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/types.h>
|
||||
#include <dce.h>
|
||||
|
||||
/**
|
||||
* struct dce_device - DCE data structure for storing
|
||||
* linux device specific info.
|
||||
*/
|
||||
struct dce_device {
|
||||
/**
|
||||
* @d : OS agnostic dce struct. Stores all runitme info for dce cluster
|
||||
* elements.
|
||||
*/
|
||||
struct tegra_dce d;
|
||||
/**
|
||||
* @dev : Pointer to DCE Cluster's Linux device struct.
|
||||
*/
|
||||
struct device *dev;
|
||||
/**
|
||||
* @pdata : Pointer to dce platform data struct.
|
||||
*/
|
||||
struct dce_platform_data *pdata;
|
||||
/**
|
||||
* @max_cpu_irqs : stores maximum no. os irqs from DCE cluster to CPU
|
||||
* for this platform.
|
||||
*/
|
||||
u8 max_cpu_irqs;
|
||||
/**
|
||||
* @regs : Stores the cpu-mapped base address of DCE Cluster. Will be
|
||||
* used for MMIO transactions to DCE elements.
|
||||
*/
|
||||
void __iomem *regs;
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
/**
|
||||
* @debugfs : Debugfs node for DCE Linux device.
|
||||
*/
|
||||
struct dentry *debugfs;
|
||||
/**
|
||||
* @ext_test_status : Return code for external client tests run via
|
||||
* debugfs
|
||||
*/
|
||||
s32 ext_test_status;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* dce_device_from_dce - inline function to get linux os data from the
|
||||
* os agnostic struct tegra_dc
|
||||
* @d : Pointer to the os agnostic tegra_dce data structure.
|
||||
*
|
||||
* Return : pointer to struct dce_device
|
||||
*/
|
||||
static inline struct dce_device *dce_device_from_dce(struct tegra_dce *d)
|
||||
{
|
||||
return container_of(d, struct dce_device, d);
|
||||
}
|
||||
|
||||
/**
|
||||
* dev_from_dce - inline function to get linux device from the
|
||||
* os agnostic struct tegra_dce
|
||||
* @d : Pointer to the os agnostic tegra_dce data structure.
|
||||
*
|
||||
* Return : pointer to struct device
|
||||
*/
|
||||
static inline struct device *dev_from_dce(struct tegra_dce *d)
|
||||
{
|
||||
return dce_device_from_dce(d)->dev;
|
||||
}
|
||||
|
||||
/**
|
||||
* pdata_from_dce - inline function to get dce platform data from
|
||||
* the os agnostic struct tegra_dc.
|
||||
*
|
||||
* @d : Pointer to the os agnostic tegra_dce data structure.
|
||||
*
|
||||
* Return : pointer to struct device
|
||||
*/
|
||||
static inline struct dce_platform_data *pdata_from_dce(struct tegra_dce *d)
|
||||
{
|
||||
return ((struct dce_device *)dev_get_drvdata(dev_from_dce(d)))->pdata;
|
||||
}
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_DEVICE_LINUX_H */
|
||||
33
drivers/platform/tegra/dce/os/include/linux-kmd/os-dce-log.h
Normal file
33
drivers/platform/tegra/dce/os/include/linux-kmd/os-dce-log.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Linux implementation for logging support.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_LOG_LINUX_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_LOG_LINUX_H
|
||||
|
||||
struct tegra_dce;
|
||||
|
||||
enum dce_log_type {
|
||||
DCE_ERROR,
|
||||
DCE_WARNING,
|
||||
DCE_INFO,
|
||||
DCE_DEBUG,
|
||||
};
|
||||
|
||||
__printf(5, 6)
|
||||
void dce_log_msg(struct tegra_dce *d, const char *func_name, int line,
|
||||
enum dce_log_type type, const char *fmt, ...);
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_LOG_LINUX_H */
|
||||
155
drivers/platform/tegra/dce/os/include/linux-kmd/os-ivc.h
Normal file
155
drivers/platform/tegra/dce/os/include/linux-kmd/os-ivc.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_IVC_LINUX_H
|
||||
#define NVDISPLAY_SERVER_OS_IVC_LINUX_H
|
||||
|
||||
#include <soc/tegra/ivc.h>
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
typedef struct tegra_ivc os_ivc_t;
|
||||
|
||||
/*
|
||||
* Kernel API tegra_ivc_init() needs notify function as non NULL.
|
||||
* We don't have a usecase for notify function as we handle it
|
||||
* separately in our signaling module.
|
||||
*/
|
||||
static void ivc_signal_target(struct tegra_ivc *ivc, void *data)
|
||||
{
|
||||
// Empty function.
|
||||
}
|
||||
|
||||
|
||||
/* Returns 0 on success, or a negative error value if failed. */
|
||||
static inline int os_ivc_init(os_ivc_t *ivc,
|
||||
void *recv_base, void *send_base,
|
||||
dma_addr_t rx_phys, dma_addr_t tx_phys, /* TODO: Confirm if it's ok to remove IOVA args. These shouldn't be required here. */
|
||||
unsigned int num_frames, size_t frame_size)
|
||||
{
|
||||
#if defined(NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP) /* Linux v6.2 */
|
||||
struct iosys_map rx, tx;
|
||||
struct iosys_map *prx = &rx, *ptx = &tx;
|
||||
iosys_map_set_vaddr(prx, recv_base);
|
||||
iosys_map_set_vaddr(ptx, send_base);
|
||||
#else
|
||||
void *prx = recv_base;
|
||||
void *ptx = send_base;
|
||||
#endif
|
||||
|
||||
return tegra_ivc_init(ivc, NULL,
|
||||
prx, rx_phys,
|
||||
ptx, tx_phys,
|
||||
num_frames, frame_size,
|
||||
ivc_signal_target, NULL);
|
||||
}
|
||||
|
||||
static inline void os_ivc_reset(os_ivc_t *ivc)
|
||||
{
|
||||
return tegra_ivc_reset(ivc);
|
||||
}
|
||||
|
||||
/* Returns 0 on success, or a negative error value if failed. */
|
||||
static inline int os_ivc_notified(os_ivc_t *ivc)
|
||||
{
|
||||
return tegra_ivc_notified(ivc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return negative err code on Failure, or 0 on Success.
|
||||
* This function will populate address of next write frame
|
||||
* info functions ppframe input argument.
|
||||
*/
|
||||
static inline int os_ivc_get_next_write_frame(os_ivc_t *ivc, void **ppframe)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
#if defined(NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP) /* Linux v6.2 */
|
||||
struct iosys_map pframe;
|
||||
|
||||
err = tegra_ivc_write_get_next_frame(ivc, &pframe);
|
||||
if (err) {
|
||||
iosys_map_clear(&pframe);
|
||||
goto done;
|
||||
}
|
||||
#else
|
||||
void *pframe = NULL;
|
||||
|
||||
pframe = tegra_ivc_write_get_next_frame(ivc);
|
||||
if (IS_ERR(pframe)) {
|
||||
err = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
*ppframe = pframe;
|
||||
|
||||
done:
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Returns 0, or a negative error value if failed. */
|
||||
static inline int os_ivc_write_advance(os_ivc_t *ivc)
|
||||
{
|
||||
return tegra_ivc_write_advance(ivc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return negative err code on Failure, or 0 on Success.
|
||||
* This function will populate address of next read frame
|
||||
* info functions ppframe input argument.
|
||||
*/
|
||||
static inline int os_ivc_get_next_read_frame(os_ivc_t *ivc, void **ppframe)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
#if defined(NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP) /* Linux v6.2 */
|
||||
struct iosys_map pframe;
|
||||
|
||||
err = tegra_ivc_read_get_next_frame(ivc, &pframe);
|
||||
if (err) {
|
||||
iosys_map_clear(&pframe);
|
||||
goto done;
|
||||
}
|
||||
#else
|
||||
void *pframe = NULL;
|
||||
|
||||
pframe = tegra_ivc_read_get_next_frame(ivc);
|
||||
if (IS_ERR(pframe)) {
|
||||
err = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
|
||||
*ppframe = pframe;
|
||||
|
||||
done:
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Returns 0, or a negative error value if failed. */
|
||||
static inline int os_ivc_read_advance(os_ivc_t *ivc)
|
||||
{
|
||||
return tegra_ivc_read_advance(ivc);
|
||||
}
|
||||
|
||||
/* TODO: Need safe coversion between size_t and uint32_t types. */
|
||||
static inline uint32_t os_ivc_align(uint32_t size)
|
||||
{
|
||||
return (uint32_t)tegra_ivc_align((size_t) size);
|
||||
}
|
||||
|
||||
static inline uint32_t os_ivc_total_queue_size(uint32_t size)
|
||||
{
|
||||
return tegra_ivc_total_queue_size(size);
|
||||
}
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_IVC_LINUX_H */
|
||||
24
drivers/platform/tegra/dce/os/include/os-cond.h
Normal file
24
drivers/platform/tegra/dce/os/include/os-cond.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_COND_H
|
||||
#define NVDISPLAY_SERVER_OS_COND_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux-kmd/os-cond.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-cond.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_COND_H */
|
||||
24
drivers/platform/tegra/dce/os/include/os-dce-device.h
Normal file
24
drivers/platform/tegra/dce/os/include/os-dce-device.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_DEVICE_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_DEVICE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux-kmd/os-dce-device.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-dce-device.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_DEVICE_H */
|
||||
25
drivers/platform/tegra/dce/os/include/os-dce-events.h
Normal file
25
drivers/platform/tegra/dce/os/include/os-dce-events.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_EVENTS_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_EVENTS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/dce_events.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-dce-events.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_EVENTS_H */
|
||||
72
drivers/platform/tegra/dce/os/include/os-dce-log.h
Normal file
72
drivers/platform/tegra/dce/os/include/os-dce-log.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_LOG_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_LOG_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux-kmd/os-dce-log.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-dce-log.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* dce_err - Print an error
|
||||
*
|
||||
* @d - Pointer to tegra_dce.
|
||||
* @fmt - A format string (printf style).
|
||||
* @arg... - Arguments for the format string.
|
||||
*
|
||||
* Uncondtionally print an error message.
|
||||
*/
|
||||
#define dce_err(d, fmt, arg...) \
|
||||
dce_log_msg(d, __func__, __LINE__, DCE_ERROR, fmt, ##arg)
|
||||
|
||||
/**
|
||||
* dce_warn - Print a warning
|
||||
*
|
||||
* @d - Pointer to tegra_dce.
|
||||
* @fmt - A format string (printf style).
|
||||
* @arg... - Arguments for the format string.
|
||||
*
|
||||
* Uncondtionally print a warming message.
|
||||
*/
|
||||
#define dce_warn(d, fmt, arg...) \
|
||||
dce_log_msg(d, __func__, __LINE__, DCE_WARNING, fmt, ##arg)
|
||||
|
||||
/**
|
||||
* dce_info - Print an info message
|
||||
*
|
||||
* @d - Pointer to tegra_dce.
|
||||
* @fmt - A format string (printf style).
|
||||
* @arg... - Arguments for the format string.
|
||||
*
|
||||
* Unconditionally print an information message.
|
||||
*/
|
||||
#define dce_info(d, fmt, arg...) \
|
||||
dce_log_msg(d, __func__, __LINE__, DCE_INFO, fmt, ##arg)
|
||||
|
||||
/**
|
||||
* dce_debug - Print a debug message
|
||||
*
|
||||
* @d - Pointer to tegra_dce.
|
||||
* @fmt - A format string (printf style).
|
||||
* @arg... - Arguments for the format string.
|
||||
*
|
||||
* print a debug message.
|
||||
*/
|
||||
#define dce_debug(d, fmt, arg...) \
|
||||
dce_log_msg(d, __func__, __LINE__, DCE_DEBUG, fmt, ##arg)
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_LOG_H */
|
||||
30
drivers/platform/tegra/dce/os/include/os-dce-workqueue.h
Normal file
30
drivers/platform/tegra/dce/os/include/os-dce-workqueue.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_DCE_WQ_H
|
||||
#define NVDISPLAY_SERVER_OS_DCE_WQ_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <dce-workqueue.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-dce-workqueue.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
int dce_init_work(struct tegra_dce *d,
|
||||
struct dce_work_struct *work,
|
||||
void (*work_fn)(struct tegra_dce *d));
|
||||
|
||||
void dce_schedule_work(struct dce_work_struct *work);
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_DCE_WQ_H */
|
||||
24
drivers/platform/tegra/dce/os/include/os-ivc.h
Normal file
24
drivers/platform/tegra/dce/os/include/os-ivc.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_IVC_H
|
||||
#define NVDISPLAY_SERVER_OS_IVC_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux-kmd/os-ivc.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-ivc.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_IVC_H */
|
||||
24
drivers/platform/tegra/dce/os/include/os-lock.h
Normal file
24
drivers/platform/tegra/dce/os/include/os-lock.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_LOCK_H
|
||||
#define NVDISPLAY_SERVER_OS_LOCK_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <dce-lock.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-lock.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_LOCK_H */
|
||||
24
drivers/platform/tegra/dce/os/include/os-utils.h
Normal file
24
drivers/platform/tegra/dce/os/include/os-utils.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_OS_UTILS_H
|
||||
#define NVDISPLAY_SERVER_OS_UTILS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <dce-util-common.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include <hvrtos/os-utils.h>
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_OS_UTILS_H */
|
||||
24
drivers/platform/tegra/dce/os/include/types.h
Normal file
24
drivers/platform/tegra/dce/os/include/types.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
||||
*
|
||||
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
||||
* property and proprietary rights in and to this material, related
|
||||
* documentation and any modifications thereto. Any use, reproduction,
|
||||
* disclosure or distribution of this material and related documentation
|
||||
* without an express license agreement from NVIDIA CORPORATION or
|
||||
* its affiliates is strictly prohibited.
|
||||
*/
|
||||
|
||||
#ifndef NVDISPLAY_SERVER_TYPES_H
|
||||
#define NVDISPLAY_SERVER_TYPES_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/types.h>
|
||||
#elif defined(NVDISPLAY_SERVER_HVRTOS)
|
||||
#include "hvrtos/types.h"
|
||||
#else
|
||||
#error "OS Not Supported"
|
||||
#endif
|
||||
|
||||
#endif /* NVDISPLAY_SERVER_TYPES_H */
|
||||
Reference in New Issue
Block a user