Commit Graph

4010 Commits

Author SHA1 Message Date
anupamg
ea36afee6c DCE-KMD: Update OS abstraction - Part 2
Modules covered in this CL:
1) dce-os-log

This is not a functional CL. It does the following:
1) Rename dce_<info/err/debug/warn> to
   dce_os_<info/err/debug/warn>

2) Rename dce_log_msg() to dce_os_log_msg()

3) Rename DCE_<WARNING/ERROR/INFO/DEBUG> to
   DCE_OS_<WARNING/ERROR/INFO/DEBUG>

4) Move dce-log.h to os/linux/include/dce-os-log.h

5) Stop using old abstraction:
    a) Replace <os-dce-log.h> includes with <dce-os-log.h>

6) Delete all related old deprecated log files:
    a) os/include/linux-kmd/os-dce-log.h
    b) os/include/os-dce-log.h

JIRA TDS-16126

Change-Id: I75ebe98a785c298678d80371184efae6e46932ee
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228536
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
2f1230b256 DCE-KMD: Update DCE OS abstraction - Part 1
- We will keep single abstraction layer for linux.
    - File: dce-os-*
    - Fn: dce_os_*()

Modules covered in this CL:
1) dce-os-types
2) dce-os-atomic
3) dce-os-utils
4) dce-os-device
    - This is renamed to dce-linux-device in
      I74e2deb17f49065d242bd80d50c5a849b3dfa3a1

JIRA TDS-16126

Change-Id: I2d5eb45da4f245c1491645b27e2be9141bc038df
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3228474
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
7726f604ca DCE-KMD: Revert "DCE-KMD: Add define for USE(x)"
- Revert commit to add USE() define as we've removed all
  usages by adding meningful checks instead.

This reverts commit 4c584ae1dbfd0516178a3fa9227ec6ded40363c8.

JIRA TDS-16126

Change-Id: Ic22ca046a036e8c9883d2857a8de325ee1874980
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3232193
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
302458450a DCE-KMD: pm.c: Remove USE() usage
- We're using USE() to forcefully use a parameter to avoid
  compilation errors in HVRTOS.

- Add a validity check instead to such parameters. This will
  resolve unused varaiable errors as well as add meaningful
  checks, instead of forcefully using params.

JIRA TDS-16126

Change-Id: I4bad1b8fff8ebabc9eb3bd6edfe7cf1f1549e7ef
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225292
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
90a02e9ca3 DCE-KMD: fsm.c: Remove USE() usage
- We're using USE() to forcefully use a parameter to avoid
  compilation errors in HVRTOS.

- Add a validity check instead to such parameters. This will
  resolve unused varaiable errors as well as add meaningful
  checks, instead of forcefully using params.

JIRA TDS-16126

Change-Id: I672dc9bf6ebcf31ae76ff4ed17bc3c246838c124
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225283
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
b5e4092538 DCE-KMD: bootstrap.c: Remove USE() usage
- We're using USE() to forcefully use a parameter to avoid
  compilation errors in HVRTOS.

- Add a validity check instead to such parameters. This will
  resolve unused varaiable errors as well as add meaningful
  checks, instead of forcefully using params.

JIRA TDS-16126

Change-Id: I885348a09eaac6e4362c89b59880fbd32d77d3b5
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225254
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
7f0ed24743 DCE-KMD: Add check for params arg in dce_admin...
- Add check for params arg in dce_admin_handle_ipc_received_event().

- dce_admin_handle_ipc_received_event() is a one of the FSM event
  functions which shares common FSM event function prototype:
    int (*fsm_event_handle)(struct tegra_dce *d, void *params);

- But dce_admin_handle_ipc_received_event() implementation doesn't
  need 'params' argument and therefore callers are expected to
  pass NULL.

- This change will add a check inside this function to check
  if the params are NULL and print a warning message otherwise.

JIRA TDS-16126

Change-Id: I70b73d195d866b7b6bb43b5430dccfb0bc3cb486
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225248
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
f03b71480a DCE-KMD: Add new DCE OS interface: types.h
- This change will add new DCE OS interface for types.h.

- This DCE OS interface layer will act as entry point to OS layer
  from core DCE-KMD code.

- The intended usage is as follows.
    - DCE-KMD core will include respective OS header file from
      DCE OS interface.
        Eg. In dce-fsm.c
            #include <dce-os-types.h>
    - DCE OS interface will further include OS specific files
        Eg. In dce-os-types.h
            #include <os-types.h>
    - OS specific files will reside in respective OS specific paths.
        Eg. for Linux the path will be
            kernel/nvidia-oot/../dce/os/include/linux/os-types.h
        For HVRTOS the path will be
            display/server/os/include/hvrtos/os-types.h
    - The OS specific paths will be directly included in respective
      OS makefiles during compilation so that we don't need to use
      ifdefs within DCE OS interface layer.

- This is first change to follow this convention for types.h.
  We will have follow-up CLs to follow this suite for all other
  OS dependencies for DCE-KMD.

JIRA TDS-16126

Change-Id: Ied7bee6eac5de9134b973e74020df200707afa10
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3224052
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
d9528502bc DCE-KMD: Remove dce.h include from dce-pm.h
- Remove dce.h include from dce-pm.h to resolve circular
  dependency betweeen dce.h and dce-pm.h

- This is an existing circular dependency but has floated
  up now due to some re-org in DCE-KMD code.

JIRA TDS-16052

Change-Id: I046743cf70f344d87500e7f9d595f8cfe2379446
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192713
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
644c60d35c DCE-KMD: Refactor dce_work_cond_sw_resource_init()
- Move resource init specific to PM and bootstrap modules
  to respective PM and bootstrap init functions.

- Motivation here is 2 fold:
    1) To keep common code common across OSs.
    2) Move resource init to respective sub-modules.
        - We will have separate PM module for HVRTOS.
        - We will have separate dce-worker module for HVRTOS.

JIRA TDS-16052

Change-Id: I40f6943eb4173a0da7201dc58afb19aee2a0d04e
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3190873
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
06db88ae67 DCE-KMD: dce-worker.h - Remove dce-thread.h ref
- Remove un-neessary/un-used dce-thread.h inlcude from
  dce-worker.h.

JIRA TDS-16052

Change-Id: I13a465a63226db7a3d378ed5945264a84cf3381b
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3189332
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
484423c54b DCE-KMD: Use os abstraction for events.
- Start using os abstraction for dce-events.

JIRA TDS-16052

Change-Id: I538d6c6748bf09135e7c3bffc607dc9b8571c0ab
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3188480
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
57991f0020 DCE-KMD: Use os abstraction for IVC comm
- Use OS abstraction for IVC commmunication calls.

- Also remove un-necessary mutex lock/unlock calls during init
  as they are not supported on HVRTOS.
    - Accordingly rename
        dce_ipc_channel_init() -> dce_ipc_channel_init_unlocked()
        dce_ipc_channel_deinit() -> dce_ipc_channel_deinit_unlocked()

JIRA TDS-16052

Change-Id: Ia7b062486f0920672c62fb5753ad3d73488f9bde
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180404
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
1b6b1c620b DCE-KMD: Move IPC region alloc/free calls to OS
- Move IPC region alloc/free calls to OS layer because
  they mean different for different OSs.

- For Linux it will allocate/dma map memory for IVC comm.

- For HVRTOS it will simply fetch pre-allocated memory details
  since the memory allocation is only allowed in hypervisor module.

- Accordingly, rename the API dce_ipc_allocate_region() ->
  dce_ipc_init_region_info(). Similarly for free as well.

JIRA TDS-16052

Change-Id: I201cb5b1bc7384a9b0ccdbf5bc72bbd78d6b1506
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180405
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
f5d25922eb DCE-KMD: admin: Allocate msg buffer at init time
- Reserve message buffer for DCE admin channel at init time
  since dynamic memory allocations are restricted on HVRTOS.
    - Free this during channel deinit.

- Use this reserved message buffer at all other callsites.

JIRA TDS-16052

Change-Id: I2b8a24f9044bc08e10e5ff8cbf0c3f51fa53ff53
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3180403
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
84e1c1d01f DCE-KMD: Decouple resources init and start logic
- In DCE_KMD, dce_fsm_start() schedules start of state machine
  functionality which involves the waiting for DCE-FW boot completion,
  IPC admin setup and communication etc.

- HVRTOS restricts certain functionalities like waiting on events,
  acquiring locks, etc in initialize phase.

- Also for HVRTOS we are executing worker queue work in same
  thread context directly from where it's called from.

- For above reasons, we need to decouple SW resource allocation and
  init logic and actual execution start logic which was part of
  dce_driver_init() earlier into 2 phases:
    - dce_driver_init()
        - This will do all resource allocation/init and will be called
          during resource initialization phase.
            - Module probe for Linux
            - Initialize() context for HVRTOS.
    - dce_driver_start()
        - This will start actual DCE logic execution after all
          resources are allocated and initialized and will be executed
          separately.
            - In Linux, both will be executed from the same probe
              while in HVRTOS, the former is in process initialize
              stage and dce_driver_start is run in the
              Thread initialize stage.

JIRA TDS-16052

Change-Id: I1176d748bc705106bb0c8ca7e647713abf2d4a00
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3192613
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
e9fdb45f72 DCE-KMD: FSM: Don't acquire locks during init/de..
Dont't acquire locks during init/deinit.

- FSM init/deinit is expected to be called during init/deinit phase
  when everything else and FSM itself is inactive.

- FSM mutex is just initialized/deinit in the same functions where
  we're trying to acquire lock/release.
    - While it is techically ok in general but not requried.
    - Also HVRTOS restriction prevents to acquire mutexes in
      initialization phase.
        - Deinit can be called in Initization context to deinit
          if init fails.

JIRA TDS-16052

Change-Id: I19e10bb890a4ab6d011df4380ab3a6d5fe92c696
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3178697
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
4a304392dd DCE-KMD: Fix un-used params errors
- Force use unused parameters in commmon DCE-KMD
  codebase to fix unused parameters errors on HVRTOS.

JIRA TDS-16052

Change-Id: Id58c87d27a248d7ad3d6ee58f51dd869e6623c32
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3173706
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
cac31260fe DCE-KMD: Add define for USE(x)
- Add define for USE(x) for Linux. It's required to resolve
  warnings for unused variables across DCE-KMD codebase.
  For HVRTOS such warnings are treated as errors so this is
  a must.

- For HVRTOS the define comes from os_port.h

- USE(x) is removed in Ic22ca046a036e8c9883d2857a8de325ee1874980
  after replacing the USE(x) usages with appropriate checks.

JIRA TDS-16052

Change-Id: Icb2c14036a4194bcff89ede3a5f500f71568a2a7
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3188577
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
66b010a691 DCE-KMD: Use OS abstraction for work queue
- Start using OS abstraction for work queue.

JIRA TDS-16052

Change-Id: Ic8fa7b5aa38e92be1fd6dc1ddb07be4ecf7bad68
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3188432
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
6aed7136dd DCE-KMD: Decouple dce-thread.h from dce.h
- dce-thread.h only used in dce-util-common.c so move it from
  dce.h to dce-util-common.c

- The dce_thread*() APIs in dce-util-common.c are unused.

- This change is required to avoid creating these unused APIs
  for other OSs like HVRTOS.

JIRA TDS-16052

Change-Id: I67e5e7201671aa6ddc07bfb4a869c825fb53e6c5
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172731
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
aec0d24ecd DCE-KMD: Use OS abstraction for condition vars
- Use OS abstraction added to display/drivers/server
  for OS condition variables support.

JIRA TDS-16052

Change-Id: If4ae2698308f1a037e5e0d6ec0c9724695a008d3
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172718
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
59ead11048 DCE-KMD: Use OS abstraction for locking
- Use OS abstraction added to display/drivers/server
  for OS locking support.

JIRA TDS-16052

Change-Id: I3678458e8cf62a29cc313c4b3abae38188eb0fa6
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172702
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
4a07fca949 DCE-KMD: Use OS abstraction for logging
- Use OS abstraction added to display/drivers/server
  for OS logging support.

JIRA TDS-16052

Change-Id: I73f36f1c50b52f5323496bb6dc180b1bd8ddabe3
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172655
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
0dfd61c0e7 DCE-KMD: Use OS abstraction for dce_device
- Use OS abstraction added to display/drivers/server
  for dce_device.

JIRA TDS-16052

Change-Id: I2339ad423ad38e8c3ba0f3205d80f172a4d0abe9
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172565
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
8f1271978c DCE-KMD: Use OS abstraction of utils
- Start using OS abstraction for all utility functions.

JIRA TDS-16052

Change-Id: Ic1e0f059194e15ff7dff0fa97997bd0d69dfc58c
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172545
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
50d6a0cb32 DCE-KMD: Use OS abstraction for atomic operations
- Replace linux specific implementation with OS absraction
  added to display/drivers

JIRA TDS-16052

Change-Id: I089dd75954cb8cfa533a697dddc2ae9c501c26a0
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3171169
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
8533f2be4a DCE-KMD: Use OS abstraction for types.h
- DCE-KMD code is only compiled on Linux Kernel today. So it has
  some linux specific dependencies.

- We will be compiling the same code for new DispalySerer HVRTOS
  process. To support this we will need to abstract out OS
  specific dependencies from DCE-KMD.

- Common OS abstraction code will be developed under display/drivers/
  server/ repo.

- DCE-KMD will start using that os abtsaction and this is the first
  CL towards that effort.

JIRA TDS-16052

Change-Id: I51fba684ac285139225a2999338e73c724d9d499
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3167249
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
2025-07-24 10:19:12 +00:00
anupamg
d8cf86fa95 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>
2025-07-24 10:19:12 +00:00
Shiqi Jiao
821e55ab50 kenel nvidia-oot: Fix Static Analysis issues
Jira CAMERASW-29896

Change-Id: Ibe6a81a0ef0e7226acd78a8b42e8ccc05545bed3
Signed-off-by: Shiqi Jiao <shiqij@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261568
Reviewed-by: Ryan Li <ryanli@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ankit Gupta (SW-TEGRA) <ankitgu@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
2025-07-24 10:19:12 +00:00
Jon Hunter
9cdba26d40 media: camera: Fix build for Linux v6.8+
In Linux v6.8, the 'g_frame_interval' and 's_frame_interval' function
pointers were removed from the 'v4l2_subdev_video_ops' structure and
replaced by 'get_frame_interval' and 'set_frame_interval' that were
added to the 'v4l2_subdev_pad_ops' structure.

This change was previously fixed for the Tegra CSI driver by adding the
necessary conftest changes. A new update to the Tegra Cam V4L2 causes
the build to fail for Linux v6.8+ kernels because of the same issue. Fix
up the Tegra Cam V4L2 driver in the same way as the Tegra CSI driver,
but update the name of the conftest test to indicate that this is
applicable for both the 'get_frame_interval' and 'set_frame_interval'
function pointers.

Bug 4448428
Bug 4807063

Change-Id: Ica47f3aaece0bf81e2adc3c431056ea51b64a893
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3231775
(cherry picked from commit 91416b264c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3246399
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:12 +00:00
Praveen AC
073fc28ecd [t23x][camera]: Fix VIDIOC_G/S_PARM v4l2-compliance test fail.
Implemented VIDIOC_G/S_PARM ioctl calls to fix
v4l2-compliance test fail.

Bug 4807063

Change-Id: Ia03b161b5659c710976084f277064a44d10aec15
Signed-off-by: Praveen AC <pac@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3221436
(cherry picked from commit c3b8c1cd3e)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3232021
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Ankur Pawar <ankurp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
rajangam
6163a70525 t264: Changes to support SMMU on OESP
1. No need to handle OESP case separately to load
values into mailbox registers.
2. OESP now supports SMMU one can use DRAM to share data.

Bug 3247553

Signed-off-by: rajangam <rajangam@nvidia.com>

Change-Id: I0463d1ccf26f173a1bea9304373cbad192e58d20
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3211209
Tested-by: Jason Li (SW-TEGRA) <jasl@nvidia.com>
Reviewed-by: David Pu <dpu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Jason Li (SW-TEGRA) <jasl@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:12 +00:00
Jason Li
1440655254 psc: Add support for mutex mailbox
This change adds support for mailbox with mutex.

In OESP/SB, GP mailboxes are used. Since they are mailbox with mutex,
the driver needs to acquire mutex before using it.

Jira SEC-15577

Signed-off-by: Jason Li (SW-TEGRA) <jasl@nvidia.com>
Change-Id: I8bc95402b1a4fc7227058aded1d417cfa3e5fae6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261139
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: David Pu <dpu@nvidia.com>
2025-07-24 10:19:12 +00:00
Jon Hunter
00ab7abbb6 gpu/drm: tegra: Fix support for Linux v6.12
In Linux v6.12, commit 641bb4394f40 ("fs: move FMODE_UNSIGNED_OFFSET to
fop_flags") moves the setting of the FMODE_UNSIGNED_OFFSET into the
various drivers and renames this flag. This change is causing various
tests to fail because opening the DRM device is failing.

Use the presence of the new FOP_UNSIGNED_OFFSET flag in the kernel to
determine if we need to set this flag in the Tegra DRM driver.

Bug 4876974

Change-Id: Ie72a9340187b1c206f0cda6d7e3dab44d603a41c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3269063
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
yangxu
e078bbbe94 kernel: nvidia-oot: Fix KMD coverity defects
Fix INT30-C, ARR30-C, EXP34-C, and MEM30-C coverity defects for channel.c

Jira CAMERASW-29897

Change-Id: I0ae0ee26273455b6e5a80a0ea5099e648dbc4097
Signed-off-by: yangxu <yangxu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3265973
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Anubhav Rai <arai@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Xiaoming Xiang <xxiang@nvidia.com>
Reviewed-by: Praveen AC <pac@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
2025-07-24 10:19:12 +00:00
Thierry Reding
1cd89f4693 gpu: host1x: Set up device DMA parameters
In order to store device DMA parameters, the DMA framework depends on
the device's dma_parms field to point at a valid memory location. Add
backing storage for this in struct host1x_memory_context and point to
it.

Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916133320.368620-1-thierry.reding@gmail.com
(cherry picked from commit b4ad4ef374d66cc8df3188bb1ddb65bce5fc9e50)

Bug 4876974

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I0a7f9c9f49a5e4580193d5814ff4a6a15f8014c8
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268196
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Mikko Perttunen
c0d1bdc684 gpu: host1x: Return error when context device not attached to IOMMU
If a context device was not attached to IOMMU, we kept the old
success err value causing context devices to be unregistered but
success to be returned. This would mean that things would go on
but with context isolation disabled.

To decide on an explicit behavior, let's return an error code
here instead. If someone wants to go without IOMMU on a platform
modern enough to support context isolation, they can remove the
context devices from device tree.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230413082202.114721-2-cyndis@kapsi.fi
(cherry picked from commit b02e6e040af7fa7fd59b0eb71d927dbc149bc20d)

Bug 4876974

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: I09ce70f416e56a1a39ce31fb2485e6d28b568230
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3270635
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Yang Yingliang
545c57385f gpu: host1x: Fix memory leak of device names
The device names allocated by dev_set_name() need be freed
before module unloading, but they can not be freed because
the kobject's refcount which was set in device_initialize()
has not be decreased to 0.

As comment of device_add() says, if it fails, use only
put_device() drop the refcount, then the name will be
freed in kobejct_cleanup().

device_del() and put_device() can be replaced with
device_unregister(), so call it to unregister the added
successfully devices, and just call put_device() to the
not added device.

Add a release() function to device to avoid null release()
function WARNING in device_release(), it's empty, because
the context devices are freed together in
host1x_memory_context_list_free().

Fixes: 8aa5bcb61612 ("gpu: host1x: Add context device management code")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
(cherry picked from commit 55879dad0f3ae8468444b42f785ad79eac05fe5b)

Bug 4876974

Change-Id: I6d9419f429f34022519db428b6a12c361f901c14
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268195
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Jon Hunter
bce8ac3556 nvmap: Fix build for Linux v6.13
In Linux v6.13, commit b129125e1f96 ("arm64: asm-offsets: remove
DMA_{TO,FROM}_DEVICE") removes the definitions DMA_TO/FROM_DEVICE from
the assembly header file 'asm-offsets.h' which is used by the functions
__dma_map_area() and __dma_unmap_area() in nvmap_cache_maint.S.

From reviewing the NVMAP code, the function __dma_unmap_area() is never
used and so we can simply remove this. Split the __dma_map_area() into
two functions __dma_map_area_to_device() and
__dma_map_area_from_device() to avoid having to pass the direction.

Bug 4991895

Change-Id: I4a0f658401beff5c5e5457de72050b21acf820fa
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261710
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2025-07-24 10:19:12 +00:00
Junsheng Chen
58779763a1 linux: kmd: static analysis S11/27 part 4
Under the following path:
- nvidia-oot/drivers/media/platform/tegra/camera/tegracam_ctrls.c

Jira CAMERASW-29893

Change-Id: I3a8a8177e49228cedc1359a7fe395ba379500614
Signed-off-by: Junsheng Chen <junshengc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3264225
Reviewed-by: Zhiyuan Wang <zhiwang@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Bhushan Rayrikar
27aee01b20 cam-fsync: change method to get TSC ticks
Change the source of TSC ticks from MTSC to CNTPCT.
MTSC values drift away from TSC values over time.

Bug 4968802

Signed-off-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Change-Id: I02a7fd92d7c751ff7268430c5ad61b4ddd5b4576
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3257831
Reviewed-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-by: Laszlo Weber <lweber@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Ian Kaszubski <ikaszubski@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261378
Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com>
2025-07-24 10:19:12 +00:00
Mikko Perttunen
18a165f104 gpu: host1x: When out of memory contexts, wait for free context
Instead of immediately returning an error when trying to allocate
a context device and none are free, log a warning and stall the
submit until a usable context becomes available.

Bug 4712458

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Change-Id: I964c906e94a8624ded04a5f3851f8c3dbbe76d8b
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3227684
Reviewed-by: Santosh BS <santoshb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Satvik Raj Gupta
4b785c2e35 Revert "video: tegra: nvmap: Fix INT30-C overflow defects"
This reverts commit 537bcc28c6cc97586028a72c1555d7b70b6ed21b.

Reason for revert: Bug 5017529

Signed-off-by: Satvik Raj Gupta <satvikrajg@nvidia.com>
Change-Id: I7350199fe8d3929139ad3d88975ff65285363af7
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3270140
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:12 +00:00
Deepak Badgaiyan
d1f2b6a051 nvscic2c: Add Thor support
Configure BAR and MSI for Thor.

Add checks for chip id for chip specific code
between Orin and Thor.

Separate Stream ID's are assigned to upstream and downstream
struct device in Rootport client driver.
While accessing Rootport local memory upstream Stream ID should be used.
While accessing memories over BAR downstream Stream ID should be used.

Jira NVIPC-2877
Jira NVIPC-2484

Change-Id: I67df4b78e57b6de36f9bfaf966978f7ee875d596
Signed-off-by: Deepak Badgaiyan <dbadgaiyan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3226748
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
Reviewed-by: Janardhan Reddy AnnapuReddy <jreddya@nvidia.com>
Reviewed-by: Sivagamy Govindasamy <sivagamyg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:11 +00:00
Surbhi Singh
77d5f0295e video: tegra: nvmap: Fix INT30-C overflow defect
Add check for subtraction overflow using BUG_ON.

JIRA: TMM-5724
Bug 4479044

Change-Id: If4b63979c207d6246ea4c8a3fffa5f89032956ba
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3268715
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
13e35c27dd drm/tegra: Backport fbdev updates
The following upstream commits have been back-ported to the out-of-tree
Tegra DRM driver to align with upstream to help pull in the latest
updates from upstream.

Changes from Linux v6.2:
 7ad4384d53c6 drm/tegra: Add missing clk_disable_unprepare() in
              tegra_dc_probe()

Changes from Linux v6.3:
 3fb1f62f80a1 drm/fb-helper: Remove drm_fb_helper_unprepare() from
              drm_fb_helper_fini()

Changes from Linux v6.4:
 71ec16f45ef8 drm/tegra: Implement fbdev emulation as in-kernel client
 25dda38e0b07 drm/tegra: Initialize fbdev DRM client
 1ac45068af9d drm/tegra: Hide fbdev support behind config option
 08263e91f260 drm/tegra: Removed fb from struct tegra_fbdev
 434434608a91 drm/tegra: Remove struct tegra_fbdev
 dc06f4a495df drm/tegra: Include <linux/i2c.h>
 f68b63ebc433 drm/tegra: Include <linux/of.h>
 437405403ab4 drm/tegra: rgb: Make tegra_dc_rgb_remove() return void

The changes have been back-ported to ensure that they build for all
kernel versions supported and utilise conftest as necessary to handle
kernel differences.

Bug 4876974

Change-Id: I6c8403325a7b4874f3ad1c6a0b1f662c1494c397
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267798
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:11 +00:00
Jon Hunter
6f788dbe13 drm/tegra: Fix build for Linux v6.12
In Linux v6.12, commit 446d0f4849b1 ("drm: Remove struct
drm_mode_config_funcs.output_poll_changed") removes
'output_poll_changed' function pointer from 'drm_mode_config_funcs'
structure and commit b5757a5be2fa ("drm: Remove struct
drm_driver.lastclose") removes 'lastclose' from the 'drm_driver'
structure. This is breaking build the Tegra DRM out-of-tree driver for
Linux v6.12.

Fix this by partially back-porting commit 71ec16f45ef8 ("drm/tegra:
Implement fbdev emulation as in-kernel client") from Linux v6.4 which
removed the use of the 'output_poll_changed' and 'lastclose' function
pointers from the Tegra DRM driver. Note that it is safe to partially
back-port this for now because we don't use the frame-buffer support in
the Tegra DRM driver for Tegra234+ devices.

To keep the Tegra DRM out-of-tree driver aligned with upstream, the
remaining parts of commit '71ec16f45ef8' will be back-ported in another
change that will be part of a bigger change to align the frame-buffer
support with the upstream driver. For now just fix the build for Linux
v6.12.

Bug 4876974

Change-Id: Idc9b1c198c067ccb59f1337866154c9a8f0a5623
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3267797
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
2025-07-24 10:19:11 +00:00
Surbhi Singh
07f3c29dbb video: tegra: nvmap: Fix INT30-C overflow defects
Adding check for overflow  when two unsigned integers are added and return error in case of overflow condition.

JIRA: TMM-5724
Bug 4479044

Change-Id: I65bc1f62c40575becc64b6ec8d8b6f4718edba52
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3232159
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
2025-07-24 10:19:11 +00:00
Surbhi Singh
34af0526fd video: tegra: nvmap: Fix INT30-C overflow defect
Add check for addition overflow using BUG_ON.

JIRA: TMM-5724
Bug 4479044

Change-Id: I6f611aa2f45945ad66c3f9565f50fea97eb17611
Signed-off-by: Surbhi Singh <surbhis@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263949
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2025-07-24 10:19:11 +00:00