mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
rtcpu: capture-ivc: Enable build for Linux 6.2
The driver of rtcpu/capture-ivc is modified to support
the new APIs of the IVC from core kernel using conftest.
Enable build of this driver.
Bug 4346767
Change-Id: I427bb8b7d5dad02e805d0707fb67e45772fead31
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3033024
(cherry picked from commit bf1cfb5fb4)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053700
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
2fc926c8fe
commit
e3f7ab90e1
@@ -1,11 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
# Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
ccflags-y += -Wframe-larger-than=2048
|
||||
|
||||
ifneq ($(CONFIG_TEGRA_IVC_LEGACY_DISABLE),y)
|
||||
obj-m += capture-ivc.o
|
||||
endif
|
||||
obj-m += ivc-bus.o
|
||||
obj-m += camchar.o
|
||||
obj-m += camera-diagnostics.o
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
// Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/tegra-capture-ivc.h>
|
||||
|
||||
@@ -357,11 +359,25 @@ static inline void tegra_capture_ivc_recv(struct tegra_capture_ivc *civc)
|
||||
{
|
||||
struct tegra_ivc *ivc = &civc->chan->ivc;
|
||||
struct device *dev = &civc->chan->dev;
|
||||
const void *msg;
|
||||
const struct tegra_capture_ivc_msg_header *hdr;
|
||||
uint32_t id;
|
||||
|
||||
while (tegra_ivc_can_read(ivc)) {
|
||||
const void *msg = tegra_ivc_read_get_next_frame(ivc);
|
||||
const struct tegra_capture_ivc_msg_header *hdr = msg;
|
||||
uint32_t id = hdr->channel_id;
|
||||
#if defined(NV_TEGRA_IVC_STRUCT_HAS_IOSYS_MAP) /* Linux 6.2 */
|
||||
struct iosys_map map;
|
||||
int err;
|
||||
err = tegra_ivc_read_get_next_frame(ivc, &map);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to get next frame for read\n");
|
||||
return;
|
||||
}
|
||||
msg = map.vaddr;
|
||||
#else
|
||||
msg = tegra_ivc_read_get_next_frame(ivc);
|
||||
#endif
|
||||
hdr = msg;
|
||||
id = hdr->channel_id;
|
||||
|
||||
trace_capture_ivc_recv(dev_name(dev), hdr->msg_id, id);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_CAPTURE_IVC_H
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#if !defined(CONFIG_TEGRA_IVC_LEGACY_DISABLE)
|
||||
/**
|
||||
* @brief Submit the control message binary blob to capture-IVC driver,
|
||||
* which is to be transferred over control IVC channel to RTCPU.
|
||||
@@ -134,59 +133,4 @@ int tegra_capture_ivc_unregister_control_cb(
|
||||
*/
|
||||
int tegra_capture_ivc_unregister_capture_cb(
|
||||
uint32_t chan_id);
|
||||
#else
|
||||
typedef void (*tegra_capture_ivc_cb_func)(
|
||||
const void *resp_desc,
|
||||
const void *priv_context);
|
||||
|
||||
static inline int tegra_capture_ivc_control_submit(
|
||||
const void *control_desc,
|
||||
size_t len)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_capture_submit(
|
||||
const void *capture_desc,
|
||||
size_t len)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_register_control_cb(
|
||||
tegra_capture_ivc_cb_func control_resp_cb,
|
||||
uint32_t *trans_id,
|
||||
const void *priv_context)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_notify_chan_id(
|
||||
uint32_t chan_id,
|
||||
uint32_t trans_id)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_register_capture_cb(
|
||||
tegra_capture_ivc_cb_func capture_status_ind_cb,
|
||||
uint32_t chan_id,
|
||||
const void *priv_context)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_unregister_control_cb(
|
||||
uint32_t id)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
|
||||
static inline int tegra_capture_ivc_unregister_capture_cb(
|
||||
uint32_t chan_id)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
};
|
||||
#endif /* !defined(CONFIG_TEGRA_IVC_LEGACY_DISABLE) */
|
||||
|
||||
#endif /* INCLUDE_CAPTURE_IVC_H */
|
||||
|
||||
Reference in New Issue
Block a user