DCE-KMD: Update DCE OS abstraction - Part 6

Module covered: dce-workqueue

This is not a functional change. It does the following:
1) Move include/dce-workqueue.h to
   os/linux/include/dce-os-work.h

2) s/dce_work/dce_os_work/g

3) s/dce_init_work/dce_os_work_init/g

4) s/dce_schedule_work/dce_os_work_schedule/g

5) Remove intermediate os header os/include/os-dce-workqueue.h
   and replace all includes directly with <dce-os-work.h>

JIRA TDS-16126

Change-Id: I4d88cf68a187a061fd0c8c084ea074fb9e74d315
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228552
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
This commit is contained in:
anupamg
2024-10-12 00:03:49 +00:00
committed by Jon Hunter
parent 9f31ca7c42
commit c0e60a639a
8 changed files with 42 additions and 72 deletions

View File

@@ -416,7 +416,7 @@ int dce_boot_interface_init(struct tegra_dce *d)
goto err_init; goto err_init;
} }
ret = dce_init_work(d, &d->dce_bootstrap_work, dce_bootstrap_work_fn); ret = dce_os_work_init(d, &d->dce_bootstrap_work, dce_bootstrap_work_fn);
if (ret) { if (ret) {
dce_os_err(d, "Bootstrap work init failed"); dce_os_err(d, "Bootstrap work init failed");
goto err_init; goto err_init;

View File

@@ -474,7 +474,7 @@ out:
*/ */
void dce_fsm_start(struct tegra_dce *d) void dce_fsm_start(struct tegra_dce *d)
{ {
dce_schedule_work(&d->dce_bootstrap_work); dce_os_work_schedule(&d->dce_bootstrap_work);
} }
/** /**

View File

@@ -625,36 +625,36 @@ void dce_os_usleep_range(unsigned long min, unsigned long max)
} }
/* /*
* dce_schedule_work : schedule work in global highpri workqueue * dce_os_work_schedule : schedule work in global highpri workqueue
* *
* @work : dce work to be scheduled * @work : dce work to be scheduled
* *
* Return : void * Return : void
*/ */
void dce_schedule_work(struct dce_work_struct *work) void dce_os_work_schedule(struct dce_os_work_struct *work)
{ {
queue_work(system_highpri_wq, &work->work); queue_work(system_highpri_wq, &work->work);
} }
/* /*
* dce_work_handle_fn : handler function for scheduled dce-work * dce_os_work_handle_fn : handler function for scheduled dce-work
* *
* @work : Pointer to the scheduled work * @work : Pointer to the scheduled work
* *
* Return : void * Return : void
*/ */
static void dce_work_handle_fn(struct work_struct *work) static void dce_os_work_handle_fn(struct work_struct *work)
{ {
struct dce_work_struct *dce_work = container_of(work, struct dce_os_work_struct *dce_os_work = container_of(work,
struct dce_work_struct, struct dce_os_work_struct,
work); work);
if (dce_work->dce_work_fn != NULL) if (dce_os_work->dce_os_work_fn != NULL)
dce_work->dce_work_fn(dce_work->d); dce_os_work->dce_os_work_fn(dce_os_work->d);
} }
/* /*
* dce_init_work : Init dce work structure * dce_os_work_init : Init dce work structure
* *
* @d : Pointer to tegra_dce struct. * @d : Pointer to tegra_dce struct.
* @work : Pointer to dce work structure * @work : Pointer to dce work structure
@@ -662,14 +662,14 @@ static void dce_work_handle_fn(struct work_struct *work)
* *
* Return : 0 if successful * Return : 0 if successful
*/ */
int dce_init_work(struct tegra_dce *d, int dce_os_work_init(struct tegra_dce *d,
struct dce_work_struct *work, struct dce_os_work_struct *work,
void (*work_fn)(struct tegra_dce *d)) void (*work_fn)(struct tegra_dce *d))
{ {
work->d = d; work->d = d;
work->dce_work_fn = work_fn; work->dce_os_work_fn = work_fn;
INIT_WORK(&work->work, dce_work_handle_fn); INIT_WORK(&work->work, dce_os_work_handle_fn);
return 0; return 0;
} }

View File

@@ -117,7 +117,7 @@ int dce_pm_handle_sc7_exit_received_event(struct tegra_dce *d, void *params)
if (params != NULL) if (params != NULL)
dce_os_warn(d, "Params aren't expected in this function\n"); dce_os_warn(d, "Params aren't expected in this function\n");
dce_schedule_work(&d->dce_resume_work); dce_os_work_schedule(&d->dce_resume_work);
return 0; return 0;
} }
@@ -181,7 +181,7 @@ int dce_pm_init(struct tegra_dce *d)
{ {
int ret = 0; int ret = 0;
ret = dce_init_work(d, &d->dce_resume_work, dce_resume_work_fn); ret = dce_os_work_init(d, &d->dce_resume_work, dce_resume_work_fn);
if (ret) { if (ret) {
dce_os_err(d, "resume work init failed"); dce_os_err(d, "resume work init failed");
goto done; goto done;

View File

@@ -1,22 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
*/
#ifndef DCE_WORKQUEUE_H
#define DCE_WORKQUEUE_H
#include <linux/workqueue.h>
struct dce_work_struct {
struct tegra_dce *d;
struct work_struct work;
void (*dce_work_fn)(struct tegra_dce *d);
};
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

View File

@@ -18,7 +18,7 @@
#include <dce-pm.h> #include <dce-pm.h>
#include <dce-mailbox.h> #include <dce-mailbox.h>
#include <dce-client-ipc-internal.h> #include <dce-client-ipc-internal.h>
#include <os-dce-workqueue.h> #include <dce-os-work.h>
#define DCE_MAX_CPU_IRQS 4 #define DCE_MAX_CPU_IRQS 4
@@ -148,11 +148,11 @@ struct tegra_dce {
/** /**
* dce_bootstrap_work : dce work to be executed to start FSM flow * dce_bootstrap_work : dce work to be executed to start FSM flow
*/ */
struct dce_work_struct dce_bootstrap_work; struct dce_os_work_struct dce_bootstrap_work;
/** /**
* dce_resume_work : dce work to executed dce resume flow * dce_resume_work : dce work to executed dce resume flow
*/ */
struct dce_work_struct dce_resume_work; struct dce_os_work_struct dce_resume_work;
/** /**
* dce_sc7_state : structure to save/restore state during sc7 enter/exit * dce_sc7_state : structure to save/restore state during sc7 enter/exit
*/ */

View File

@@ -1,30 +0,0 @@
/*
* 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 */

View File

@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#ifndef DCE_OS_WORK_H
#define DCE_OS_WORK_H
#include <linux/workqueue.h>
struct dce_os_work_struct {
struct tegra_dce *d;
struct work_struct work;
void (*dce_os_work_fn)(struct tegra_dce *d);
};
int dce_os_work_init(struct tegra_dce *d,
struct dce_os_work_struct *work,
void (*work_fn)(struct tegra_dce *d));
void dce_os_work_schedule(struct dce_os_work_struct *work);
#endif /* DCE_OS_WORK_H */