diff --git a/kernel-module-imx-gpu-viv-src/Kbuild b/kernel-module-imx-gpu-viv-src/Kbuild index a278ef7..fd654c4 100644 --- a/kernel-module-imx-gpu-viv-src/Kbuild +++ b/kernel-module-imx-gpu-viv-src/Kbuild @@ -212,7 +212,7 @@ endif ifeq ($(CONFIG_FTRACE),y) ifneq ($(CONFIG_ANDROID),y) -ccflags-y += -DgcdSYSTRACE=1 -DgcdDEBUG=gcdDEBUG_TRACE +#ccflags-y += -DgcdSYSTRACE=1 -DgcdDEBUG=gcdDEBUG_TRACE endif endif diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.c index b4f5081..ff7ab04 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.h index e4b4852..6129f57 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_context.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.c index 4ef053c..506516c 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -2615,9 +2615,7 @@ gckHARDWARE_InitializeHardware(IN gckHARDWARE Hardware) offset + 0x2C, 0x2)); } -#if !gcdCAPTURE_ONLY_MODE gcmkONERROR(gckHARDWARE_SetMMU(Hardware, Hardware->kernel->mmu)); -#endif if (Hardware->mcFE) { /* Reinitialize MCFE, now MMU is enabled. */ @@ -7372,6 +7370,10 @@ gckHARDWARE_QueryIdle(IN gckHARDWARE Hardware, OUT gctBOOL_PTR IsIdle) gceSTATUS status = gcvSTATUS_OK; gctUINT32 idle; gctBOOL isIdle = gcvFALSE; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; +#endif #if gcdINTERRUPT_STATISTIC gckEVENT eventObj = Hardware->kernel->eventObj; @@ -7385,8 +7387,16 @@ gckHARDWARE_QueryIdle(IN gckHARDWARE Hardware, OUT gctBOOL_PTR IsIdle) gcmkVERIFY_ARGUMENT(IsIdle != gcvNULL); #if gcdCAPTURE_ONLY_MODE - *IsIdle = gcvTRUE; - gcmkONERROR(status); + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) { + gckKERNEL_FindDatabase(Hardware->kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) { + *IsIdle = gcvTRUE; + gcmkONERROR(status); + } + } #endif do { @@ -9243,9 +9253,10 @@ gceSTATUS gckHARDWARE_HandleFault(IN gckHARDWARE Hardware) { gceSTATUS status = gcvSTATUS_NOT_SUPPORTED; - gctUINT32 mmu, mmuStatus, address = 0, i = 0; + gctUINT32 mmu, mmuStatus, reg, i = 0; gctUINT32 mmuStatusRegAddress; gctUINT32 mmuExceptionAddress; + gctADDRESS address = 0; gcmkHEADER_ARG("Hardware=%p", Hardware); @@ -9276,7 +9287,9 @@ gckHARDWARE_HandleFault(IN gckHARDWARE Hardware) continue; gcmkVERIFY_OK(gckOS_ReadRegisterEx(Hardware->os, Hardware->kernel, - mmuExceptionAddress + i * 4, &address)); + mmuExceptionAddress + i * 4, ®)); + + address = reg; break; } @@ -9289,19 +9302,21 @@ gckHARDWARE_HandleFault(IN gckHARDWARE Hardware) gctSIZE_T offset = 0; gctPHYS_ADDR_T physicalAddress = 0; gceAREA_TYPE areaType; +#if !gcdENABLE_TRUST_APPLICATION gctUINT32 pageMask; +#endif gcePAGE_TYPE pageType; gctUINT32_PTR entry; gckMMU_GetAreaType(Hardware->kernel->mmu, address, &areaType); - pageMask = (areaType == gcvAREA_TYPE_4K) ? gcdMMU_PAGE_4K_MASK : gcdMMU_PAGE_1M_MASK; pageType = (areaType == gcvAREA_TYPE_4K) ? gcvPAGE_TYPE_4K : gcvPAGE_TYPE_1M; #if gcdENABLE_TRUST_APPLICATION address &= ~gcdMMU_PAGE_4K_MASK; #else + pageMask = (areaType == gcvAREA_TYPE_4K) ? gcdMMU_PAGE_4K_MASK : gcdMMU_PAGE_1M_MASK; address &= ~pageMask; #endif @@ -10357,10 +10372,6 @@ gckHARDWARE_ExecuteFunctions(IN gcsFUNCTION_EXECUTION_PTR Execution) gctADDRESS address; gckHARDWARE hardware = (gckHARDWARE)Execution->hardware; -#if gcdCAPTURE_ONLY_MODE - gcmkONERROR(status); -#endif - #if gcdDUMP_IN_KERNEL gcmkDUMP(hardware->os, "#[function: %s]", Execution->funcName); #endif diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.h index 6e27b95..4f78333 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_async_fe.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_async_fe.c index db6bbdc..a3e7bbf 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_async_fe.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_async_fe.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_fe.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_fe.h index cc733c4..d71896a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_fe.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_fe.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.c index 732022a..3ae7f4c 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.h index a60150b..3a2afb3 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.c index 6486fdf..ea4d1f5 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.h index c0a5fce..2e5ebc8 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset_config.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset_config.h index 0bb7314..2fe258f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset_config.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_flop_reset_config.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -52,6 +52,7 @@ * *****************************************************************************/ + #ifndef __gc_hal_kernel_hardware_func_flop_reset_config_h_ #define __gc_hal_kernel_hardware_func_flop_reset_config_h_ diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_ppu.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_ppu.h index 93db4b6..bc99ad2 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_ppu.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_ppu.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_usc.h b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_usc.h index 53ee20a..8ae19e2 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_usc.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_func_usc.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_mc_fe.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_mc_fe.c index a9af471..8a7fc85 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_mc_fe.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_mc_fe.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -252,7 +252,6 @@ _ProgramDescRingBuf(IN gckHARDWARE Hardware, gctUINT32 ringBufStartReg; gctUINT32 depthExpReg; gctUINT32 readPtrReg; - gctUINT32 writePtrReg; gctUINT32 data = 0; gctUINT32 address; @@ -260,18 +259,15 @@ _ProgramDescRingBuf(IN gckHARDWARE Hardware, ringBufStartReg = 0x02800; depthExpReg = 0x02900; readPtrReg = 0x02B00; - writePtrReg = 0x02A00; } else { ringBufStartReg = 0x02400; depthExpReg = 0x02500; readPtrReg = 0x02700; - writePtrReg = 0x02600; } ringBufStartReg += Index << 2; depthExpReg += Index << 2; readPtrReg += Index << 2; - writePtrReg += Index << 2; Channel->ringBufAddress = MMUEnabled ? Channel->gpuAddress : (gctADDRESS)Channel->physical; @@ -291,11 +287,6 @@ _ProgramDescRingBuf(IN gckHARDWARE Hardware, gcmkVERIFY_OK(gckOS_ReadRegisterEx(Hardware->os, Hardware->kernel, readPtrReg, &data)); - /* Priority ring buffer write ptr. */ - /* gcmkVERIFY_OK(gckOS_WriteRegisterEx(Hardware->os, Hardware->kernel, - * writePtrReg, data)); - */ - /* No valid descriptor initially. */ Channel->readPtr = data; Channel->writePtr = data; diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_waitlink_fe.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_waitlink_fe.c index 648186d..19592ac 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_waitlink_fe.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_hardware_waitlink_fe.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_recorder.c b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_recorder.c index 416bc7b..197f92f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_recorder.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/arch/gc_hal_kernel_recorder.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c index 48f2ef1..f8cd565 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h index f6d3d05..5070969 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c index 2a0ec98..ddef727 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h index 22db366..f4fb37a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.c index e70576e..b40be97 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -915,6 +915,10 @@ gckKERNEL_Construct(IN gckOS Os, IN gceCORE Core, kernel->preemptionMode = gcvFULLY_PREEMPTIBLE_MODE; #endif +#if gcdENABLE_GPU_WORK_PERIOD_TRACE + gcmkONERROR(gckGPUWORK_Construct(kernel, &kernel->traceGpuWork)); +#endif + gcmkONERROR(gckOS_AtomConstruct(Os, &kernel->atomBroCoreMask)); /* Initially all the cores are brothers. */ @@ -1123,6 +1127,10 @@ gckKERNEL_Destroy(IN gckKERNEL Kernel) Kernel->monitorTimerStop = gcvTRUE; } +#if gcdENABLE_GPU_WORK_PERIOD_TRACE + gcmkVERIFY_OK(gckGPUWORK_Destroy(Kernel->traceGpuWork)); +#endif + #if gcdDVFS if (Kernel->dvfs) { gcmkVERIFY_OK(gckDVFS_Stop(Kernel->dvfs)); @@ -1187,6 +1195,10 @@ gckKERNEL_AllocateVideoMemory(IN gckKERNEL Kernel, IN gctUINT32 Alignment, #endif gctBOOL hasFastPools = gcvFALSE; gctSIZE_T bytes = *Bytes; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; +#endif gcmkHEADER_ARG("Kernel=%p *Pool=%d *Bytes=0x%zx Alignment=0x%x Type=%d", Kernel, *Pool, *Bytes, Alignment, Type); @@ -1298,10 +1310,17 @@ gckKERNEL_AllocateVideoMemory(IN gckKERNEL Kernel, IN gctUINT32 Alignment, } AllocateMemory: - #if gcdCAPTURE_ONLY_MODE - if (*Pool != gcvPOOL_VIRTUAL) - *Pool = gcvPOOL_SYSTEM; + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) { + gckKERNEL_FindDatabase(Kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) + *Pool = gcvPOOL_SYSTEM; + else + *Pool = gcvPOOL_VIRTUAL; + } #endif /* Get initial pool. */ @@ -1770,6 +1789,9 @@ _LockVideoMemory(IN gckKERNEL Kernel, IN gceCORE Core, IN gctUINT32 ProcessID, gctPHYS_ADDR_T physical = gcvINVALID_PHYSICAL_ADDRESS; gctUINT32 gid = 0; gctBOOL asynchronous = gcvFALSE; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; +#endif gcmkHEADER_ARG("Kernel=%p ProcessID=%d", Kernel, ProcessID); @@ -1784,11 +1806,17 @@ _LockVideoMemory(IN gckKERNEL Kernel, IN gceCORE Core, IN gctUINT32 ProcessID, } #if gcdCAPTURE_ONLY_MODE - if (Interface->u.LockVideoMemory.queryCapSize) { - Interface->u.LockVideoMemory.captureSize = nodeObject->captureSize; - return gcvSTATUS_OK; - } else { - nodeObject->captureLogical = Interface->u.LockVideoMemory.captureLogical; + if (ProcessID) { + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, ProcessID, gcvFALSE, &database)); + + if (database->matchCaptureOnly) { + if (Interface->u.LockVideoMemory.queryCapSize) { + Interface->u.LockVideoMemory.captureSize = nodeObject->captureSize; + return gcvSTATUS_OK; + } else { + nodeObject->captureLogical = Interface->u.LockVideoMemory.captureLogical; + } + } } #endif @@ -1882,6 +1910,9 @@ _UnlockVideoMemory(IN gckKERNEL Kernel, IN gctUINT32 ProcessID, gckVIDMEM_BLOCK vidMemBlock = gcvNULL; gctSIZE_T bytes; gctUINT64 mappingInOne = 1; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; +#endif gcmkHEADER_ARG("Kernel=%p ProcessID=%d", Kernel, ProcessID); @@ -1922,7 +1953,12 @@ _UnlockVideoMemory(IN gckKERNEL Kernel, IN gctUINT32 ProcessID, } #if gcdCAPTURE_ONLY_MODE - Interface->u.UnlockVideoMemory.captureLogical = nodeObject->captureLogical; + if (ProcessID) { + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, ProcessID, gcvFALSE, &database)); + + if (database->matchCaptureOnly) + Interface->u.UnlockVideoMemory.captureLogical = nodeObject->captureLogical; + } #endif gcmkFOOTER_NO(); @@ -3438,44 +3474,60 @@ gckKERNEL_Dispatch(IN gckKERNEL Kernel, IN gckDEVICE Device, #if gcdCAPTURE_ONLY_MODE gckVIDMEM_NODE nodeObject = gcvNULL; - if (Interface->u.Attach.queryCapSize) { - /* Attach user process. */ - gcmkONERROR(gckCOMMAND_Attach(Kernel->command, &context, &bytes, - &Interface->u.Attach.numStates, processID, - Interface->u.Attach.shared)); + if (Interface->u.Attach.matchCaptureOnly) { + if (Interface->u.Attach.queryCapSize) { + gcsDATABASE_PTR database; - Interface->u.Attach.maxState = bytes; - Interface->u.Attach.context = gcmPTR_TO_NAME(context); + /* Attach user process. */ + gcmkONERROR(gckCOMMAND_Attach(Kernel->command, &context, &bytes, + &Interface->u.Attach.numStates, processID, + Interface->u.Attach.shared)); - gcmkONERROR(gckVIDMEM_HANDLE_Lookup(Kernel, processID, - context->buffer->handle, &nodeObject)); + Interface->u.Attach.maxState = bytes; + Interface->u.Attach.context = gcmPTR_TO_NAME(context); - Interface->u.Attach.captureSize = nodeObject->captureSize; + gcmkONERROR(gckVIDMEM_HANDLE_Lookup(Kernel, processID, + context->buffer->handle, &nodeObject)); - if (Kernel->core != 0) { - gcmkVERIFY_OK( - gckKERNEL_AddProcessDB(Kernel, - processID, gcvDB_CONTEXT, - gcmINT2PTR(Interface->u.Attach.context), - gcvNULL, - 0)); - } + Interface->u.Attach.captureSize = nodeObject->captureSize; - break; - } else { - gctUINT i = 0; + if (Kernel->core != 0) { + gcmkVERIFY_OK( + gckKERNEL_AddProcessDB(Kernel, + processID, gcvDB_CONTEXT, + gcmINT2PTR(Interface->u.Attach.context), + gcvNULL, + 0)); + } - context = gcmNAME_TO_PTR(Interface->u.Attach.context); + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, processID, gcvFALSE, &database)); - for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { - gcsCONTEXT_PTR buffer = context->buffer; + database->matchCaptureOnly = gcvTRUE; - gckOS_CopyToUserData(Kernel->os, buffer->logical, - Interface->u.Attach.contextLogical[i], - (gctSIZE_T)Interface->u.Attach.captureSize); + break; + } else { + gctUINT i = 0; + + context = gcmNAME_TO_PTR(Interface->u.Attach.context); + + for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { + gcsCONTEXT_PTR buffer = context->buffer; - buffer = buffer->next; + gckOS_CopyToUserData(Kernel->os, buffer->logical, + Interface->u.Attach.contextLogical[i], + (gctSIZE_T)Interface->u.Attach.captureSize); + + buffer = buffer->next; + } } + } else { + /* Attach user process. */ + gcmkONERROR(gckCOMMAND_Attach(Kernel->command, &context, &bytes, + &Interface->u.Attach.numStates, processID, + Interface->u.Attach.shared)); + + Interface->u.Attach.maxState = bytes; + Interface->u.Attach.context = gcmPTR_TO_NAME(context); } # else @@ -3491,14 +3543,24 @@ gckKERNEL_Dispatch(IN gckKERNEL Kernel, IN gckDEVICE Device, if (Interface->u.Attach.map) { if (context != gcvNULL) { #if gcdCAPTURE_ONLY_MODE - gctUINT i = 0; - - for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { - Interface->u.Attach.logicals[i] = - gcmPTR_TO_UINT64(Interface->u.Attach.contextLogical[i]); + if (Interface->u.Attach.matchCaptureOnly) { + gctUINT i = 0; + + for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { + Interface->u.Attach.logicals[i] = + gcmPTR_TO_UINT64(Interface->u.Attach.contextLogical[i]); + } + + Interface->u.Attach.bytes = (gctUINT)context->totalSize; + } else { + if (Kernel->command->feType == gcvHW_FE_WAIT_LINK || + Kernel->command->feType == gcvHW_FE_END) { + gcmkVERIFY_OK(gckCONTEXT_MapBuffer(context, + Interface->u.Attach.logicals, + &Interface->u.Attach.bytes)); + } } - Interface->u.Attach.bytes = (gctUINT)context->totalSize; # else if (Kernel->command->feType == gcvHW_FE_WAIT_LINK || Kernel->command->feType == gcvHW_FE_END) { @@ -3826,13 +3888,6 @@ gckKERNEL_AttachProcess(IN gckKERNEL Kernel, IN gctBOOL Attach) /* Get current process ID. */ gcmkONERROR(gckOS_GetProcessID(&processID)); -#if gcdENABLE_GPU_WORK_PERIOD_TRACE - if (Attach) { - /* Get Android Application UID */ - gcmkONERROR(gckOS_GetApplicationUserID(Kernel->core)); - } -#endif - gcmkONERROR(gckKERNEL_AttachProcessEx(Kernel, Attach, processID)); /* Success. */ @@ -3872,12 +3927,25 @@ gckKERNEL_AttachProcessEx(IN gckKERNEL Kernel, IN gctBOOL Attach, IN gctUINT32 P { gceSTATUS status; gctINT32 old; +#if gcdENABLE_GPU_WORK_PERIOD_TRACE + gctUINT32 userID; +#endif gcmkHEADER_ARG("Kernel=%p Attach=%d PID=%d", Kernel, Attach, PID); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Kernel, gcvOBJ_KERNEL); +#if gcdENABLE_GPU_WORK_PERIOD_TRACE + /* Get userID by processID. */ + gcmkONERROR(gckOS_GetUserID(PID, &userID)); + + if (Attach) + gcmkONERROR(gckGPUWORK_Attach(Kernel->traceGpuWork, userID)); + else + gcmkONERROR(gckGPUWORK_Dettach(Kernel->traceGpuWork, userID)); +#endif + if (Attach) { /* Increment the number of clients attached. */ diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.h b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.h index c801400..0c06cd7 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -208,6 +208,9 @@ typedef struct _gcsDATABASE { gctPOINTER handleDatabase; gctPOINTER handleDatabaseMutex; +#if gcdCAPTURE_ONLY_MODE + gctBOOL matchCaptureOnly; +#endif } gcsDATABASE; typedef struct _gcsFDPRIVATE *gcsFDPRIVATE_PTR; @@ -493,6 +496,10 @@ struct _gckKERNEL { gcePREEMPTION_MODE preemptionMode; gctBOOL killPreemptThread; #endif + +#if gcdENABLE_GPU_WORK_PERIOD_TRACE + gckGPUWORK traceGpuWork; +#endif }; struct _FrequencyHistory { @@ -1405,6 +1412,56 @@ typedef struct _gcsDEVICE { #endif } gcsDEVICE; +#if gcdENABLE_GPU_WORK_PERIOD_TRACE +/* Record the UID for gpu work period tracing. */ +typedef struct _gcsUID_INFO *gcsUID_INFO_PTR; + +typedef struct _gcsUID_INFO { + gctUINT32 uid; + gctUINT32 reference; + gcsUID_INFO_PTR next; +} gcsUID_INFO; + +typedef struct _gcsGPUWORK{ + /* Pointer to required objects. */ + gckKERNEL kernel; + gckOS os; + + gctUINT64 lastTime; + + /* Current uid info list. */ + gcsUID_INFO_PTR uidInfoList; + gctSIZE_T uidInfoCount; + gctPOINTER uidInfoListMutex; + + /* List of free uid info structures and its mutex. */ + gcsUID_INFO_PTR freeList; + gctSIZE_T freeCount; + gctPOINTER freeListMutex; + + /* Gpu work period trace timer. */ + gctPOINTER gpuWorkTimer; +} gcsGPUWORK; + +gceSTATUS +gckGPUWORK_Construct(gckKERNEL Kernel, gckGPUWORK *GpuWork); + +gceSTATUS +gckGPUWORK_Destroy(gckGPUWORK GpuWork); + +gceSTATUS +gckGPUWORK_Attach(gckGPUWORK GpuWork, gctUINT32 UserID); + +gceSTATUS +gckGPUWORK_Dettach(gckGPUWORK GpuWork, gctUINT32 UserID); + +gceSTATUS +gckGPUWORK_AllocateUidInfo(gckGPUWORK GpuWork, gcsUID_INFO_PTR *UidInfo); + +gceSTATUS +gckGPUWORK_FreeUidInfo(gckGPUWORK GpuWork, gcsUID_INFO_PTR UidInfo); +#endif /* gcdENABLE_GPU_WORK_PERIOD_TRACE */ + /* video memory pool functions. */ /* Construct a new gckVIDMEM object. */ gceSTATUS @@ -1793,7 +1850,7 @@ gckKERNEL_SecurityDumpMMUException(IN gckKERNEL Kernel); gceSTATUS gckKERNEL_ReadMMUException(IN gckKERNEL Kernel, IN gctUINT32_PTR MMUStatus, - IN gctUINT32_PTR MMUException); + IN gctADDRESS *MMUException); gceSTATUS gckKERNEL_HandleMMUException(IN gckKERNEL Kernel, diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command.c index 4fce59a..c1c33cb 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1588,10 +1588,8 @@ _StartWaitLinkFE(IN gckCOMMAND Command) for (i = 0; i < gcvCORE_COUNT; i++) { kernel = device->kernels[i]; if (kernel) { -#if !gcdCAPTURE_ONLY_MODE /* Enable command processor. */ gcmkONERROR(gckWLFE_Execute(kernel->hardware, address, waitLinkBytes)); -# endif } } } else { @@ -1599,10 +1597,8 @@ _StartWaitLinkFE(IN gckCOMMAND Command) } # else /* gcdSHARED_COMMAND_BUFFER */ -#if !gcdCAPTURE_ONLY_MODE /* Enable command processor. */ gcmkONERROR(gckWLFE_Execute(hardware, address, waitLinkBytes)); -# endif # endif /* gcdSHARED_COMMAND_BUFFER */ @@ -1942,6 +1938,7 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, gctUINT32 waitSize; #if gcdCAPTURE_ONLY_MODE gctINT i; + gcsDATABASE_PTR database = gcvNULL; #endif #ifdef __QNXNTO__ @@ -2042,6 +2039,10 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, waitLinkLogical = (gctUINT8_PTR)Command->logical + offset; waitLinkAddress = Command->address + offset; +#if gcdCAPTURE_ONLY_MODE + if (ProcessID) + gcmkONERROR(gckKERNEL_FindDatabase(Command->kernel, ProcessID, gcvFALSE, &database)); +#endif /* Context switch required? */ if (Context == gcvNULL) { /* See if we have to switch pipes for the command buffer. */ @@ -2145,20 +2146,24 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, commandBufferSize - offset, &linkBytes, &commandLinkLow, &commandLinkHigh)); -#if gcdCAPTURE_ONLY_MODE - if (Command->kernel->core == 0) { - for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { - gcsCONTEXT_PTR buffer = contextBuffer; - - gckOS_CopyToUserData(Command->os, buffer->logical, - CommandBuffer->contextLogical[i], - Context->bufferSize); - buffer = buffer->next; +#if gcdCAPTURE_ONLY_MODE + if (database) { + if (database->matchCaptureOnly) { + if (Command->kernel->core == 0) { + for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; ++i) { + gcsCONTEXT_PTR buffer = contextBuffer; + + gckOS_CopyToUserData(Command->os, buffer->logical, + CommandBuffer->contextLogical[i], + Context->bufferSize); + + buffer = buffer->next; + } + } } } #endif - gcmkONERROR(gckVIDMEM_NODE_CleanCache(Command->kernel, contextBuffer->videoMem, (gctSIZE_T)(entryAddress - contextBuffer->address), entryLogical, entryBytes)); @@ -2308,7 +2313,7 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, gckKERNEL_SecurityExecute(Command->kernel, commandBufferLogical + offset, commandBufferSize - offset - 8); #else -#if gcdNULL_DRIVER || gcdCAPTURE_ONLY_MODE +#if gcdNULL_DRIVER /* * Skip link to entryAddress. * Instead, we directly link to final wait link position. @@ -2318,6 +2323,30 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, &Command->waitPos.size, &entryLinkLow, &entryLinkHigh)); # else +#if gcdCAPTURE_ONLY_MODE + if (database && database->matchCaptureOnly) { + /* + * Skip link to entryAddress. + * Instead, we directly link to final wait link position. + */ + gcmkONERROR(gckWLFE_Link(hardware, Command->waitPos.logical, + waitLinkAddress, waitLinkBytes, + &Command->waitPos.size, + &entryLinkLow, &entryLinkHigh)); + } else { + /* + * Generate a LINK from the previous WAIT/LINK command sequence to the + * entry determined above (either the context or the command buffer). + * This LINK replaces the WAIT instruction from the previous WAIT/LINK + * pair, therefore we use WAIT metrics for generation of this LINK. + * This action will execute the entire sequence. + */ + gcmkONERROR(gckWLFE_Link(hardware, Command->waitPos.logical, + entryAddress, entryBytes, + &Command->waitPos.size, + &entryLinkLow, &entryLinkHigh)); + } +# else /* * Generate a LINK from the previous WAIT/LINK command sequence to the * entry determined above (either the context or the command buffer). @@ -2329,6 +2358,7 @@ _CommitWaitLinkOnce(IN gckCOMMAND Command, entryAddress, entryBytes, &Command->waitPos.size, &entryLinkLow, &entryLinkHigh)); +# endif # endif #endif @@ -3233,6 +3263,10 @@ gckCOMMAND_Execute(IN gckCOMMAND Command, IN gctUINT32 RequestedBytes) gctPOINTER execLogical; gctADDRESS execAddress; gctUINT32 execBytes; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; +#endif gcmkHEADER_ARG("Command=%p RequestedBytes=0x%x", Command, RequestedBytes); @@ -3278,7 +3312,7 @@ gckCOMMAND_Execute(IN gckCOMMAND Command, IN gctUINT32 RequestedBytes) Command->offset, execLogical, execBytes)); } -#if gcdNULL_DRIVER || gcdCAPTURE_ONLY_MODE +#if gcdNULL_DRIVER /* * Skip link to execAddress. * Instead, we directly link to final wait link position. @@ -3289,12 +3323,38 @@ gckCOMMAND_Execute(IN gckCOMMAND Command, IN gctUINT32 RequestedBytes) &Command->waitPos.size, &linkLow, &linkHigh)); #else - /* Convert the last WAIT into a LINK. */ - gcmkONERROR(gckWLFE_Link(Command->kernel->hardware, +#if gcdCAPTURE_ONLY_MODE + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) + gckKERNEL_FindDatabase(Command->kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) { + /* + * Skip link to execAddress. + * Instead, we directly link to final wait link position. + */ + gcmkONERROR(gckWLFE_Link(Command->kernel->hardware, + Command->waitPos.logical, + waitLinkAddress, waitLinkBytes, + &Command->waitPos.size, + &linkLow, &linkHigh)); + } else { + /* Convert the last WAIT into a LINK. */ + gcmkONERROR(gckWLFE_Link(Command->kernel->hardware, Command->waitPos.logical, execAddress, execBytes, &Command->waitPos.size, &linkLow, &linkHigh)); + } +# else + /* Convert the last WAIT into a LINK. */ + gcmkONERROR(gckWLFE_Link(Command->kernel->hardware, + Command->waitPos.logical, + execAddress, execBytes, + &Command->waitPos.size, + &linkLow, &linkHigh)); +# endif #endif gcmkONERROR(gckVIDMEM_NODE_CleanCache(Command->kernel, @@ -3606,7 +3666,6 @@ gckCOMMAND_Stall(IN gckCOMMAND Command, IN gctBOOL FromPower) gckEVENT eventObject; gceSTATUS status; gctSIGNAL signal = gcvNULL; - gctUINT timer = 0; gcsEVENT_ATTR eventAttr; gcmkHEADER_ARG("Command=%p", Command); @@ -3662,9 +3721,6 @@ gckCOMMAND_Stall(IN gckCOMMAND Command, IN gctBOOL FromPower) gcmkVERIFY_OK(gckOS_MemoryBarrier(os, gcvNULL)); #endif - - /* Advance timer. */ - timer += gcdGPU_ADVANCETIMER; } else if (status == gcvSTATUS_INTERRUPTED) { gcmkONERROR(gcvSTATUS_INTERRUPTED); } diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command_vg.c index 8c959af..cb21ba9 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_command_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_db.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_db.c index 301797c..5752a2d 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_db.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_db.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -548,6 +548,9 @@ gckKERNEL_CreateProcessDB(IN gckKERNEL Kernel, IN gctUINT32 ProcessID) database->mapMemory.totalBytes = 0; database->mapMemory.freeCount = 0; database->mapMemory.allocCount = 0; +#if gcdCAPTURE_ONLY_MODE + database->matchCaptureOnly = gcvFALSE; +#endif for (i = 0; i < gcmCOUNTOF(database->list); i++) database->list[i] = gcvNULL; diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_event.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_event.c index 0b56d2e..27ee3c5 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_event.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_event.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1240,6 +1240,10 @@ gckEVENT_Submit(IN gckEVENT Event, IN gckEVENT_ATTR EventAttr) #if gcdSECURITY gctPOINTER reservedBuffer; #endif +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database; + gctUINT32 processID; +#endif gcmkHEADER_ARG("Event=0x%x", Event); @@ -1395,11 +1399,27 @@ gckEVENT_Submit(IN gckEVENT Event, IN gckEVENT_ATTR EventAttr) gcmkONERROR(gckCOMMAND_ExecuteMultiChannel(command, 0, 0, executeBytes)); } -#if gcdNULL_DRIVER || gcdCAPTURE_ONLY_MODE +#if gcdNULL_DRIVER /* Notify immediately on infinite hardware. */ gcmkONERROR(gckEVENT_Interrupt(Event, 1 << id)); gcmkONERROR(gckEVENT_Notify(Event, 0, gcvNULL)); +#endif +#if gcdCAPTURE_ONLY_MODE + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) { + gckKERNEL_FindDatabase(command->kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) { + if (Event->kernel) { + /* Notify immediately on infinite hardware. */ + gcmkONERROR(gckEVENT_Interrupt(Event, 1 << id)); + + gcmkONERROR(gckEVENT_Notify(Event, 0, gcvNULL)); + } + } + } #endif } diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_heap.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_heap.c index 1c58d00..f92aa54 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_heap.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_heap.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_interrupt_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_interrupt_vg.c index 5f64f06..a6bba19 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_interrupt_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_interrupt_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.c index e8dd6d0..aefdfe9 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -2504,7 +2504,7 @@ _Construct(IN gckKERNEL Kernel, IN gctSIZE_T MmuSize, OUT gckMMU *Mmu) gcmkONERROR(gckMMU_FillFlatMapping(mmu, gpuAddress, physSize, gcvFALSE, gcvFALSE, gcvNULL)); } -#if !(0 || gcdCAPTURE_ONLY_MODE) +#if !(0) if (!_ReadPageEntry(mmu->mtlbLogical + 0)) { #if !gcdENABLE_40BIT_VA gctUINT32 mtlbEntry; diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.h b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.h index c8d27ad..692e835 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu_vg.c index 0803c1d..299dba1 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_mmu_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_power.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_power.c index 35666f4..bc18737 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_power.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_power.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_precomp.h b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_precomp.h index 939c9e0..2a89930 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_precomp.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_precomp.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.c index 99f87e9..02ddb18 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.h b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.h index 99c7ce0..2798858 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_preemption.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security.c index 8377990..d30205f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security_v1.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security_v1.c index 9c7be59..d9ad272 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security_v1.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_security_v1.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -232,7 +232,7 @@ gckKERNEL_SecurityUnmapMemory(IN gckKERNEL Kernel, IN gctADDRESS GPUAddress, gceSTATUS gckKERNEL_ReadMMUException(IN gckKERNEL Kernel, IN gctUINT32_PTR MMUStatus, - IN gctUINT32_PTR MMUException) + IN gctADDRESS *MMUException) { gceSTATUS status; gcsTA_INTERFACE iface; diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.c index 04f94b1..21cea76 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.h index 5385d5b..4571f2d 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_video_memory.c b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_video_memory.c index 9fa3b84..f7ae245 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_video_memory.c +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/gc_hal_kernel_video_memory.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1897,13 +1897,26 @@ gckVIDMEM_Free(IN gckKERNEL Kernel, IN gcuVIDMEM_NODE_PTR Node) if (Node->VidMem.kvaddr) { #if gcdCAPTURE_ONLY_MODE - gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, Node->VidMem.kvaddr)); + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; + + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) + gckKERNEL_FindDatabase(Kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) { + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Kernel->os, Node->VidMem.kvaddr)); + } else { + gcmkONERROR(gckOS_DestroyKernelMapping(Kernel->os, + Node->VidMem.parent->physical, + Node->VidMem.kvaddr)); + } #else gcmkONERROR(gckOS_DestroyKernelMapping(Kernel->os, - Node->VidMem.parent->physical, - Node->VidMem.kvaddr)); + Node->VidMem.parent->physical, + Node->VidMem.kvaddr)); #endif - Node->VidMem.kvaddr = gcvNULL; } @@ -2182,6 +2195,11 @@ gckVIDMEM_Lock(IN gckKERNEL Kernel, if (Node->VidMem.locked++ == 0) { gctADDRESS address; gctADDRESS offset = (gctADDRESS)Node->VidMem.offset; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; +#endif + switch (Node->VidMem.pool) { case gcvPOOL_LOCAL_EXCLUSIVE: @@ -2208,7 +2226,20 @@ gckVIDMEM_Lock(IN gckKERNEL Kernel, /* FALLTHRU */ gcmkFALLTHRU; case gcvPOOL_SYSTEM: +#if gcdCAPTURE_ONLY_MODE + gckOS_GetProcessID(&processID); + + if (processID) { + gckKERNEL_FindDatabase(Kernel, processID, gcvFALSE, &database); + + if (database && database->matchCaptureOnly) + address = Kernel->device->contiguousBases[Kernel->device->memIndex] + offset; + else + address = Kernel->contiguousBaseAddresses[Kernel->device->memIndex] + offset; + } +#else address = Kernel->contiguousBaseAddresses[Kernel->device->memIndex] + offset; +#endif break; } @@ -3679,6 +3710,10 @@ gckVIDMEM_NODE_LockCPU(IN gckKERNEL Kernel, IN gckVIDMEM_NODE NodeObject, gcuVIDMEM_NODE_PTR node; gckVIDMEM_BLOCK vidMemBlock; gctPOINTER logical = gcvNULL; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; + gctUINT32 processID; +#endif gcmkHEADER_ARG("NodeObject=%p", NodeObject); @@ -3713,9 +3748,25 @@ gckVIDMEM_NODE_LockCPU(IN gckKERNEL Kernel, IN gckVIDMEM_NODE NodeObject, gcmkONERROR(gcvSTATUS_INVALID_REQUEST); #endif +#if gcdCAPTURE_ONLY_MODE + gcmkONERROR(gckOS_GetProcessID(&processID)); + + if (processID) + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, processID, gcvFALSE, &database)); +#endif + if (FromUser) { #if gcdCAPTURE_ONLY_MODE - node->VidMem.logical = NodeObject->captureLogical; + if (database && database->matchCaptureOnly) { + node->VidMem.logical = NodeObject->captureLogical; + } else { + /* Map video memory pool to user space. */ + gcmkONERROR(gckKERNEL_MapVideoMemory(Kernel, gcvTRUE, node->VidMem.pool, + node->VidMem.physical, + node->VidMem.offset, + node->VidMem.bytes, + &node->VidMem.logical)); + } #else /* Map video memory pool to user space. */ gcmkONERROR(gckKERNEL_MapVideoMemory(Kernel, gcvTRUE, node->VidMem.pool, @@ -3724,13 +3775,19 @@ gckVIDMEM_NODE_LockCPU(IN gckKERNEL Kernel, IN gckVIDMEM_NODE NodeObject, node->VidMem.bytes, &node->VidMem.logical)); #endif - logical = node->VidMem.logical; } else { /* Map video memory pool to kernel space. */ if (!node->VidMem.kvaddr) { #if gcdCAPTURE_ONLY_MODE - gcmkONERROR(gckOS_Allocate(os, node->VidMem.bytes, &node->VidMem.kvaddr)); + if (database && database->matchCaptureOnly) { + gcmkONERROR(gckOS_Allocate(os, node->VidMem.bytes, &node->VidMem.kvaddr)); + } else { + gcmkONERROR(gckOS_CreateKernelMapping(os, node->VidMem.parent->physical, + node->VidMem.offset, + node->VidMem.bytes, + &node->VidMem.kvaddr)); + } #else gcmkONERROR(gckOS_CreateKernelMapping(os, node->VidMem.parent->physical, node->VidMem.offset, @@ -3810,6 +3867,9 @@ gckVIDMEM_NODE_UnlockCPU(IN gckKERNEL Kernel, gctBOOL acquired = gcvFALSE; gcuVIDMEM_NODE_PTR node; gckVIDMEM_BLOCK vidMemBlock; +#if gcdCAPTURE_ONLY_MODE + gcsDATABASE_PTR database = gcvNULL; +#endif gcmkHEADER_ARG("NodeObject=%p", NodeObject); @@ -3832,8 +3892,22 @@ gckVIDMEM_NODE_UnlockCPU(IN gckKERNEL Kernel, if (node->VidMem.parent->object.type == gcvOBJ_VIDMEM) { if (FromUser) { -#if gcdCAPTURE_ONLY_MODE || defined __QNXNTO__ +#if defined __QNXNTO__ /* Do nothing here. */ +#else +#if gcdCAPTURE_ONLY_MODE + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, ProcessID, gcvFALSE, &database)); + + if (database && !database->matchCaptureOnly) { + if (!Defer) { + /* Unmap the video memory. */ + gckKERNEL_UnmapVideoMemory(Kernel, node->VidMem.pool, + node->VidMem.physical, + node->VidMem.logical, + 0, + node->VidMem.bytes); + } + } #else if (!Defer) { /* Unmap the video memory. */ @@ -3847,6 +3921,7 @@ gckVIDMEM_NODE_UnlockCPU(IN gckKERNEL Kernel, node->VidMem.logical = gcvNULL; } } +#endif #endif } else { /* diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal.h index 81157f3..3d1b92a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -76,6 +76,9 @@ typedef struct _gckDB *gckDB; typedef struct _gckDVFS *gckDVFS; typedef struct _gckMMU *gckMMU; typedef struct _gcsDEVICE *gckDEVICE; +#if gcdENABLE_GPU_WORK_PERIOD_TRACE +typedef struct _gcsGPUWORK *gckGPUWORK; +#endif /****************************************************************************** ****************************** Alignment Macros ****************************** @@ -815,7 +818,7 @@ gckOS_GetCurrentProcessID(OUT gctUINT32_PTR ProcessID); #if gcdENABLE_GPU_WORK_PERIOD_TRACE gceSTATUS -gckOS_GetApplicationUserID(IN gctUINT32 CoreID); +gckOS_GetUserID(IN gctUINT32 PID, OUT gctUINT32_PTR UserID); #endif /******************************************************************************* diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_base.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_base.h index a81f458..e5df7e2 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_base.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_base.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_debug_zones.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_debug_zones.h index 1bc80de..e9808a3 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_debug_zones.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_debug_zones.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -105,6 +105,7 @@ extern "C" { #define gcvZONE_POWER (1 << 14) #define gcvZONE_ASYNC_COMMAND (1 << 15) #define gcvZONE_ALLOCATOR (1 << 16) +#define gcvZONE_TRACEPOINT (1 << 17) /* Subzones of HAL User */ #define gcdZONE_HAL_API (1 << 4) diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver.h index 3e3f994..049da02 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver_vg.h index f4547d0..eeb0997 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_driver_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_drm.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_drm.h index da03607..8d09e8b 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_drm.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_drm.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_dump.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_dump.h index b6ad3cc..c489e83 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_dump.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_dump.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform.h index 0f874b1..1b1fef6 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform_type.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform_type.h index 216961e..8d88068 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform_type.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_eglplatform_type.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine.h index 31a9af7..8ceae09 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine_vg.h index 9452ca5..1a6da04 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_engine_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_enum.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_enum.h index 2337e24..8c11e02 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_enum.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_enum.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_kernel_buffer.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_kernel_buffer.h index 9c8e6b4..8f7bc9b 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_kernel_buffer.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_kernel_buffer.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_mem.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_mem.h index d2b4a7b..aed6e2d 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_mem.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_mem.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_metadata.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_metadata.h index 811e2b5..6872318 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_metadata.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_metadata.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_options.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_options.h index d12300e..4920f0b 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_options.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_options.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -363,7 +363,7 @@ * Number of bytes in a command buffer. */ #ifndef gcdCMD_BUFFER_SIZE -#if gcdCAPTURE_ONLY_MODE +#if 0 # define gcdCMD_BUFFER_SIZE (4 << 10) # else # define gcdCMD_BUFFER_SIZE (128 << 10) @@ -385,7 +385,7 @@ * Number of command buffers to use per client. */ #ifndef gcdCMD_BUFFERS -#if gcdCAPTURE_ONLY_MODE +#if 0 # define gcdCMD_BUFFERS 1 # else # define gcdCMD_BUFFERS 2 @@ -568,11 +568,7 @@ * For CAPTURE ONLY MODE, should make sure that gcdENABLE_BANK_ALIGNMENT is disabled. */ #ifndef gcdENABLE_BANK_ALIGNMENT -#if gcdCAPTURE_ONLY_MODE # define gcdENABLE_BANK_ALIGNMENT 0 -# else -# define gcdENABLE_BANK_ALIGNMENT 0 -# endif #endif /* diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_profiler.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_profiler.h index ff63c9f..953b78c 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_profiler.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_profiler.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_raster.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_raster.h index 78550e8..c8ffacb 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_raster.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_raster.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_security_interface.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_security_interface.h index 4e77c67..94cc2ae 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_security_interface.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_security_interface.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_statistics.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_statistics.h index 568ce9a..706361d 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_statistics.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_statistics.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_types.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_types.h index 35cc5f2..a65255c 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_types.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_types.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_version.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_version.h index 5beeb2c..cdfac9b 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_version.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_version.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -67,4 +67,3 @@ #endif /* __gc_hal_version_h_ */ - diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_vg.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_vg.h index 5f3c6dd..1c8ba26 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_vg.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/gc_hal_vg.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_base_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_base_shared.h index a5d7ba8..b2edc97 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_base_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_base_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_shared.h index df37eab..80a514e 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -76,11 +76,7 @@ extern "C" { #endif /* The number of context buffers per user. */ -#if gcdCAPTURE_ONLY_MODE -# define gcdCONTEXT_BUFFER_COUNT 1 -#else # define gcdCONTEXT_BUFFER_COUNT 2 -#endif #define gcdRENDER_FENCE_LENGTH (6 * gcmSIZEOF(gctUINT32)) #define gcdBLT_FENCE_LENGTH (10 * gcmSIZEOF(gctUINT32)) @@ -553,6 +549,7 @@ typedef struct _gcsHAL_ATTACH { IN gctBOOL queryCapSize; IN gctPOINTER contextLogical[gcdCONTEXT_BUFFER_COUNT]; OUT gctUINT64 captureSize; + IN gctBOOL matchCaptureOnly; #endif } gcsHAL_ATTACH; diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_vg_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_vg_shared.h index 589fddd..c481f3e 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_vg_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_driver_vg_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_enum_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_enum_shared.h index cf58ab5..3cb772d 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_enum_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_enum_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_profiler_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_profiler_shared.h index f35b14a..212f421 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_profiler_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_profiler_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_types_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_types_shared.h index 415886d..3e50fed 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_types_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_types_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_vg_shared.h b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_vg_shared.h index 0f8e71e..b410339 100644 --- a/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_vg_shared.h +++ b/kernel-module-imx-gpu-viv-src/hal/kernel/inc/shared/gc_hal_vg_shared.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h index 4b57d92..4660288 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dma.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dma.c index 8e3ad85..9ba0814 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dma.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dma.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c index ee32f09..0bd1a13 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c index b51dd4f..8989dd8 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c index 5198c01..2c0ce33 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_reserved_mem.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_user_memory.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_user_memory.c index 25401d9..82bcd63 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_user_memory.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_user_memory.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h index fb84ed2..bf27670 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c index dc09f6b..21c6084 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.c index c0a66c3..7f35be7 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.h index 241bff7..b22bae4 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_allocator.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.c index 1d11096..d8c2898 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.h index 72a4bb3..04856b3 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debug.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.c index 030670f..8a05b9f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.h index a90a92d..c4b3df8 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_debugfs.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.c index 5f97a36..63633fe 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1129,7 +1129,7 @@ static int set_clk(const char *buf) { gckHARDWARE hardware; - gctINT n, j, k; + gctINT n, k; gctBOOL isSpace = gcvFALSE; char data[20]; gckGALDEVICE gal_device = galDevice; @@ -1140,7 +1140,7 @@ set_clk(const char *buf) return -ENXIO; memset(data, 0, 20); - n = 0; j = 0; k = 0; + n = 0; k = 0; while (gcvTRUE) { if ((buf[k] >= '0') && (buf[k] <= '9')) { diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.h index afaea51..7ac993a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_device.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c index e6518d4..cdeec76 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_driver.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_drm.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_drm.c index b16cf3e..ad74e26 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_drm.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_drm.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -183,7 +183,6 @@ void viv_gem_free_object(struct drm_gem_object *gem_obj) static int viv_ioctl_gem_create(struct drm_device *drm, void *data, struct drm_file *file) { - int ret = 0; struct drm_viv_gem_create *args = (struct drm_viv_gem_create *)data; struct drm_gem_object *gem_obj = gcvNULL; struct viv_gem_object *viv_obj = gcvNULL; @@ -238,7 +237,7 @@ static int viv_ioctl_gem_create(struct drm_device *drm, void *data, struct drm_f #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) gem_obj->funcs = &viv_gem_object_funcs; # endif - ret = drm_gem_handle_create(file, gem_obj, &args->handle); + drm_gem_handle_create(file, gem_obj, &args->handle); viv_obj = container_of(gem_obj, struct viv_gem_object, base); viv_obj->node_handle = iface.u.AllocateLinearVideoMemory.node; @@ -793,7 +792,7 @@ static const struct file_operations viv_drm_fops = { .llseek = no_llseek, #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) - .fop_flags = FOP_UNSIGNED_OFFSET, + .fop_flags = FOP_UNSIGNED_OFFSET, #endif }; diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_iommu.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_iommu.c index 2d00ee9..3a84e91 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_iommu.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_iommu.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.c index ce73bf6..16699f8 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -314,14 +314,12 @@ gckKERNEL_DestroyProcessReservedUserMap(IN gckKERNEL Kernel, IN gctUINT32 Pid) physHandle = (PLINUX_MDL)galDevice->internalPhysical; bytes = galDevice->internalSize; - if (bytes) { gckOS_UnmapMemoryEx(Kernel->os, physHandle, bytes, Logical, Pid); } physHandle = (PLINUX_MDL)device->externalPhysical; bytes = device->externalSize; - if (bytes) { gckOS_UnmapMemoryEx(Kernel->os, physHandle, bytes, Logical, Pid); } @@ -331,7 +329,6 @@ gckKERNEL_DestroyProcessReservedUserMap(IN gckKERNEL Kernel, IN gctUINT32 Pid) for (i = 0; i < gcdSYSTEM_RESERVE_COUNT; i++) { physHandle = (PLINUX_MDL)device->contiguousPhysicals[i]; bytes = device->contiguousSizes[i]; - if (bytes) { gckOS_UnmapMemoryEx(Kernel->os, physHandle, bytes, Logical, Pid); } diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.h index c545794..28be15f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_linux.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -354,16 +354,25 @@ _GetProcessID(void) } #if gcdENABLE_GPU_WORK_PERIOD_TRACE -static inline gctINT -_GetUserID(void) +static inline gctUINT32 +_GetUserID(IN gctUINT32 Pid) { + struct task_struct *task; + gctUINT32 uid = -1; + + task = FIND_TASK_BY_PID(Pid); + + if (task) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) - return from_kuid_munged(current_user_ns(), current_uid()); + uid = from_kuid_munged(current_user_ns(), task_uid(task)); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) - return current_uid(); + uid = task_uid(task); #else - return current->uid; + uid = task->uid; #endif + } + + return uid; } #endif diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_math.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_math.c index 624770a..0e3b084 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_math.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_math.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_mutex.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_mutex.h index 202d9f1..fb9cd01 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_mutex.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_mutex.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.c index 3aa1fed..4772f2a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -102,11 +102,6 @@ gctBOOL memTraceFlag = 1; #endif #endif -#if gcdENABLE_GPU_WORK_PERIOD_TRACE -# include "gc_hal_kernel_trace_gpu_work.h" -# define ANDROID_FIRST_APPLICATION_UID 10000 -#endif - #define _GC_OBJ_ZONE gcvZONE_OS #define USING_PFN_FOLLOW 0 @@ -410,7 +405,7 @@ _QueryProcessPageTable(IN gctPOINTER Logical, OUT gctPHYS_ADDR_T *Address) #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) } else if (virt_addr_valid((void *)logical)) { #else - } else if (virt_addr_valid(logical)) { + } else if (virt_addr_valid(logical)) { #endif /* Kernel logical address. */ *Address = virt_to_phys(Logical); @@ -1192,7 +1187,7 @@ gckOS_UnmapMemory(IN gckOS Os, IN gctPOINTER Logical) { gceSTATUS status = gcvSTATUS_OK; - + gcmkHEADER_ARG("Os=%p Physical=0%p Bytes=0x%zx Logical=%p", Os, Physical, Bytes, Logical); @@ -6800,7 +6795,6 @@ gckOS_WaitNativeFence(IN gckOS Os, IN gctINT FenceFD, IN gctUINT32 Timeout) { - struct viv_sync_timeline *timeline; gceSTATUS status = gcvSTATUS_OK; unsigned int i; unsigned long timeout; @@ -6808,8 +6802,6 @@ gckOS_WaitNativeFence(IN gckOS Os, struct dma_fence *fence; struct dma_fence **fences; - timeline = (struct viv_sync_timeline *)Timeline; - fence = sync_file_get_fence(FenceFD); if (!fence) @@ -7443,15 +7435,13 @@ gckOS_TraceGpuMemory(IN gckOS Os, IN gctINT32 ProcessID, IN gctINT64 Delta) #if gcdENABLE_GPU_WORK_PERIOD_TRACE gceSTATUS -gckOS_GetApplicationUserID(gctUINT32 CoreID) +gckOS_GetUserID(IN gctUINT32 PID, OUT gctUINT32_PTR UserID) { - gctUINT32 UserID; - - UserID = _GetUserID(); - - if (UserID >= ANDROID_FIRST_APPLICATION_UID) - trace_gpu_work_period(CoreID, UserID, 100000000, 300000000, 150000000); + /* Get User ID. */ + *UserID = _GetUserID(PID); + /* Success. */ return gcvSTATUS_OK; } #endif + diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.h index ab29209..76af08a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_os.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_parameter.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_parameter.h index 7f138c7..5568685 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_parameter.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_parameter.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_platform.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_platform.h index 97809cf..5e42fb9 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_platform.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_platform.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel.c index f0b542f..dba228f 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel_emulator.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel_emulator.c index 438445c..56233cd 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel_emulator.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_security_channel_emulator.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.c index b3caef4..d7e1d45 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.h index ee42073..77bc2f9 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_sync.h @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace.c index 4d022d1..7a0e45a 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace.c @@ -52,10 +52,421 @@ * *****************************************************************************/ - #include "gc_hal_kernel_precomp.h" +#define _GC_OBJ_ZONE gcvZONE_TRACEPOINT + +#define ANDROID_FIRST_APPLICATION_UID 10000 + #if gcdENABLE_GPU_WORK_PERIOD_TRACE #define CREATE_TRACE_POINTS #include "gc_hal_kernel_trace_gpu_work.h" + +static void +_GpuWorkTraceTimerFunction(gctPOINTER Data) +{ + gckGPUWORK gpuWork = (gckGPUWORK)Data; + gcsUID_INFO_PTR uid_info = gcvNULL; + gctUINT64 currentTime = 0, activeTime = 0; + + gcmkVERIFY(gckOS_AcquireMutex(gpuWork->os, gpuWork->uidInfoListMutex, gcvINFINITE)); + + gckOS_GetTime(¤tTime); + + if (currentTime < gpuWork->lastTime) + return; + + activeTime = (currentTime - gpuWork->lastTime) * 3 / 4; + + if (activeTime > 0) { + for (uid_info = gpuWork->uidInfoList; uid_info != gcvNULL; uid_info = uid_info->next) { + trace_gpu_work_period(gpuWork->kernel->core, uid_info->uid, gpuWork->lastTime, + currentTime, activeTime); + } + } + + gpuWork->lastTime = currentTime; + + gcmkVERIFY(gckOS_ReleaseMutex(gpuWork->os, gpuWork->uidInfoListMutex)); + + gcmkVERIFY(gckOS_StartTimer(gpuWork->os, gpuWork->gpuWorkTimer, 1000)); +} + +gceSTATUS +gckGPUWORK_Construct(gckKERNEL Kernel, gckGPUWORK *GpuWork) +{ + gckOS os; + gckGPUWORK gpuWorkObj = gcvNULL; + gcsUID_INFO_PTR uid_info = gcvNULL; + gctPOINTER pointer = gcvNULL; + gceSTATUS status = gcvSTATUS_OK; + gctUINT i; + + gcmkHEADER_ARG("Kernel=%p", Kernel); + + /* Verify the arguments. */ + gcmkVERIFY_OBJECT(Kernel, gcvOBJ_KERNEL); + + /* Extract the pointer to the gckOS object. */ + os = Kernel->os; + gcmkVERIFY_OBJECT(os, gcvOBJ_OS); + + /* Allocate the gckGPUWORK object. */ + gcmkONERROR(gckOS_Allocate(os, gcmSIZEOF(struct _gcsGPUWORK), &pointer)); + + gpuWorkObj = pointer; + + /* Reset the object. */ + gcmkONERROR(gckOS_ZeroMemory(gpuWorkObj, gcmSIZEOF(struct _gcsGPUWORK))); + + /* Initialize the gckGPUWORK object. */ + gpuWorkObj->kernel = Kernel; + gpuWorkObj->os = os; + gpuWorkObj->uidInfoList = gcvNULL; + gpuWorkObj->uidInfoCount = 0; + gpuWorkObj->freeList = gcvNULL; + gpuWorkObj->freeCount = 0; + + /* Create the mutexes. */ + gcmkONERROR(gckOS_CreateMutex(os, &gpuWorkObj->uidInfoListMutex)); + gcmkONERROR(gckOS_CreateMutex(os, &gpuWorkObj->freeListMutex)); + + /* Create a bunch of zero uid_infos. */ + for (i = 0; i < 10; i++) { + /* Allocate an uid info structure. */ + gcmkONERROR(gckOS_Allocate(os, gcmSIZEOF(gcsUID_INFO), &pointer)); + + uid_info = pointer; + + uid_info->next = gpuWorkObj->freeList; + gpuWorkObj->freeList = uid_info; + gpuWorkObj->freeCount += 1; + } + + /* Create GPU Work Trace Timer. */ + gcmkONERROR(gckOS_CreateTimer(os, _GpuWorkTraceTimerFunction, + (gctPOINTER)gpuWorkObj, + &gpuWorkObj->gpuWorkTimer)); + + /* Initial the last time and start GPU Work Trace Timer. */ + gcmkONERROR(gckOS_GetTime(&gpuWorkObj->lastTime)); + + /* Return pointer to the gckGPUWORK object. */ + *GpuWork = gpuWorkObj; + + /* Success. */ + gcmkFOOTER_ARG("*GpuWork=0x%x", *GpuWork); + return gcvSTATUS_OK; + +OnError: + /* Roll back. */ + if (gpuWorkObj != gcvNULL) { + if (gpuWorkObj->gpuWorkTimer != gcvNULL) { + gcmkVERIFY_OK(gckOS_StopTimer(os, gpuWorkObj->gpuWorkTimer)); + + gcmkVERIFY_OK(gckOS_DestroyTimer(os, gpuWorkObj->gpuWorkTimer)); + gpuWorkObj->gpuWorkTimer = gcvNULL; + } + + if (gpuWorkObj->uidInfoListMutex != gcvNULL) + gcmkVERIFY_OK(gckOS_DeleteMutex(os, gpuWorkObj->uidInfoListMutex)); + + if (gpuWorkObj->freeListMutex != gcvNULL) + gcmkVERIFY_OK(gckOS_DeleteMutex(os, gpuWorkObj->freeListMutex)); + + while (gpuWorkObj->freeList != gcvNULL) { + uid_info = gpuWorkObj->freeList; + gpuWorkObj->freeList = uid_info->next; + + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(os, uid_info)); + } + + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(os, gpuWorkObj)); + } + + /* Return the status. */ + gcmkFOOTER(); + return status; +} + +gceSTATUS +gckGPUWORK_Destroy(gckGPUWORK GpuWork) +{ + gcsUID_INFO_PTR uid_info = gcvNULL; + + gcmkHEADER_ARG("GpuWork=%p", GpuWork); + + /* Vefiry the arguments. */ + gcmkVERIFY_ARGUMENT(GpuWork != gcvNULL); + + /* Stop and destroy timer. */ + if (GpuWork->gpuWorkTimer != gcvNULL) { + gcmkVERIFY_OK(gckOS_StopTimer(GpuWork->os, GpuWork->gpuWorkTimer)); + + gcmkVERIFY_OK(gckOS_DestroyTimer(GpuWork->os, GpuWork->gpuWorkTimer)); + GpuWork->gpuWorkTimer = gcvNULL; + } + + /* Free the uidInfoList. */ + while (GpuWork->uidInfoList != gcvNULL) { + uid_info = GpuWork->uidInfoList; + GpuWork->uidInfoList = uid_info->next; + + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(GpuWork->os, uid_info)); + } + + /* Delete the uid info list mutex. */ + if (GpuWork->uidInfoListMutex) { + gcmkVERIFY_OK(gckOS_DeleteMutex(GpuWork->os, GpuWork->uidInfoListMutex)); + GpuWork->uidInfoListMutex = gcvNULL; + } + + /* Free the freeList. */ + while (GpuWork->freeList != gcvNULL) { + uid_info = GpuWork->freeList; + GpuWork->freeList = uid_info->next; + + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(GpuWork->os, uid_info)); + } + + /* Delete the free list mutex. */ + if (GpuWork->freeListMutex) { + gcmkVERIFY_OK(gckOS_DeleteMutex(GpuWork->os, GpuWork->freeListMutex)); + GpuWork->freeListMutex = gcvNULL; + } + + /* Free the gckGpuWork object. */ + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(GpuWork->os, GpuWork)); + + /* Success. */ + gcmkFOOTER_NO(); + return gcvSTATUS_OK; +} + +gceSTATUS +gckGPUWORK_Attach(gckGPUWORK GpuWork, gctUINT32 UserID) +{ + gctUINT32 userId = UserID; + gcsUID_INFO_PTR uid_info = gcvNULL; + gctBOOL acquired = gcvFALSE; + gceSTATUS status = gcvSTATUS_OK; + + /* Verify the arguments. */ + gcmkVERIFY_ARGUMENT(GpuWork != gcvNULL); + + /* Only trace android application uid. */ + if (userId < ANDROID_FIRST_APPLICATION_UID) + return status; + + /* Acquire the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(GpuWork->os, GpuWork->uidInfoListMutex, gcvINFINITE)); + acquired = gcvTRUE; + + for (uid_info = GpuWork->uidInfoList; uid_info != gcvNULL; uid_info = uid_info->next) { + /* Try to find the uid. */ + if (uid_info->uid == userId) { + uid_info->reference += 1; + goto OnError; + } + } + + /* Release the mutex. */ + gcmkONERROR(gckOS_ReleaseMutex(GpuWork->os, GpuWork->uidInfoListMutex)); + acquired = gcvFALSE; + + if (uid_info == gcvNULL) { + /* Get a new uid info of the current UID. */ + gckGPUWORK_AllocateUidInfo(GpuWork, &uid_info); + + uid_info->uid = userId; + uid_info->reference = 1; + + /* Acquire the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(GpuWork->os, GpuWork->uidInfoListMutex, gcvINFINITE)); + acquired = gcvTRUE; + + /* Add the uid info to uidInfoList. */ + uid_info->next = GpuWork->uidInfoList; + GpuWork->uidInfoList = uid_info; + GpuWork->uidInfoCount += 1; + + /* Release the mutex. */ + gcmkONERROR(gckOS_ReleaseMutex(GpuWork->os, GpuWork->uidInfoListMutex)); + acquired = gcvFALSE; + } + + _GpuWorkTraceTimerFunction((gctPOINTER)GpuWork); + +OnError: + if (acquired) + gckOS_ReleaseMutex(GpuWork->os, GpuWork->uidInfoListMutex); + + /* Return the status. */ + gcmkFOOTER(); + return status; +} + +gceSTATUS +gckGPUWORK_Dettach(gckGPUWORK GpuWork, gctUINT32 UserID) +{ + gctUINT32 userId = UserID; + gcsUID_INFO_PTR previous = gcvNULL, uid_info = gcvNULL; + gctBOOL acquired = gcvFALSE, needFree = gcvFALSE; + gceSTATUS status = gcvSTATUS_OK; + + /* Verify the arguments. */ + gcmkVERIFY_ARGUMENT(GpuWork != gcvNULL); + + /* Only trace android application uid. */ + if (userId < ANDROID_FIRST_APPLICATION_UID) + return status; + + /* Acquire the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(GpuWork->os, GpuWork->uidInfoListMutex, gcvINFINITE)); + acquired = gcvTRUE; + + if (GpuWork->uidInfoList == gcvNULL) + goto OnError; + + for (previous = gcvNULL, uid_info = GpuWork->uidInfoList; + uid_info != gcvNULL; + uid_info = uid_info->next) { + if (uid_info->uid == userId) { + /* Found it! */ + uid_info->reference -= 1; + + if (uid_info->reference == 0) { + /* Remove the uid_info. */ + if (previous == gcvNULL) + GpuWork->uidInfoList = uid_info->next; + else + previous->next = uid_info->next; + + GpuWork->uidInfoCount -= 1; + needFree = gcvTRUE; + } + break; + } + + previous = uid_info; + } + + /* Release the mutex. */ + gcmkONERROR(gckOS_ReleaseMutex(GpuWork->os, GpuWork->uidInfoListMutex)); + acquired = gcvFALSE; + + if (uid_info == gcvNULL) + gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT); + + if (needFree) { + gcmkONERROR(gckGPUWORK_FreeUidInfo(GpuWork, uid_info)); + + _GpuWorkTraceTimerFunction((gctPOINTER)GpuWork); + } + + /* Success. */ + gcmkFOOTER(); + return gcvSTATUS_OK; + +OnError: + if (acquired) + gckOS_ReleaseMutex(GpuWork->os, GpuWork->uidInfoListMutex); + + /* Return the status. */ + gcmkFOOTER(); + return status; +} + +gceSTATUS +gckGPUWORK_AllocateUidInfo(gckGPUWORK GpuWork, gcsUID_INFO_PTR *UidInfo) +{ + gcsUID_INFO_PTR uid_info; + gctPOINTER pointer = gcvNULL; + gctBOOL acquired = gcvFALSE; + gceSTATUS status = gcvSTATUS_OK; + + /* Verify the arguments. */ + gcmkVERIFY_ARGUMENT(GpuWork != gcvNULL); + + /* Acquire the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(GpuWork->os, GpuWork->freeListMutex, gcvINFINITE)); + acquired = gcvTRUE; + + if (GpuWork->freeList == gcvNULL && GpuWork->freeCount == 0) { + /* Allocate a new uid info. */ + gcmkONERROR(gckOS_Allocate(GpuWork->os, gcmSIZEOF(struct _gcsUID_INFO), &pointer)); + + uid_info = pointer; + + /* Reset. */ + gcmkONERROR(gckOS_ZeroMemory(uid_info, gcmSIZEOF(struct _gcsUID_INFO))); + + /* Push it on the free list. */ + uid_info->next = GpuWork->freeList; + GpuWork->freeList = uid_info; + GpuWork->freeCount += 1; + } + + *UidInfo = GpuWork->freeList; + GpuWork->freeList = GpuWork->freeList->next; + GpuWork->freeCount -= 1; + + /* Release the mutex. */ + gcmkONERROR(gckOS_ReleaseMutex(GpuWork->os, GpuWork->freeListMutex)); + acquired = gcvFALSE; + + /* Success. */ + gcmkFOOTER_ARG("*UidInfo=0x%x", gcmOPT_POINTER(UidInfo)); + return gcvSTATUS_OK; + +OnError: + if (acquired) + gckOS_ReleaseMutex(GpuWork->os, GpuWork->freeListMutex); + + /* Return the status. */ + gcmkFOOTER(); + return status; + +} + +gceSTATUS +gckGPUWORK_FreeUidInfo(gckGPUWORK GpuWork, gcsUID_INFO_PTR UidInfo) +{ + gceSTATUS status = gcvSTATUS_OK; + gctBOOL acquired = gcvFALSE; + + gcmkHEADER_ARG("GpuWork=%p UidInfo=%p", GpuWork, UidInfo); + + /* Verify the arguments. */ + gcmkVERIFY_ARGUMENT(GpuWork != gcvNULL); + gcmkVERIFY_ARGUMENT(UidInfo != gcvNULL); + + /* Reset. */ + gcmkONERROR(gckOS_ZeroMemory(UidInfo, gcmSIZEOF(struct _gcsUID_INFO))); + + /* Acquire the mutex. */ + gcmkONERROR(gckOS_AcquireMutex(GpuWork->os, GpuWork->freeListMutex, gcvINFINITE)); + acquired = gcvTRUE; + + /* Push it on the free list. */ + UidInfo->next = GpuWork->freeList; + GpuWork->freeList = UidInfo; + GpuWork->freeCount += 1; + + /* Release the mutex. */ + gcmkONERROR(gckOS_ReleaseMutex(GpuWork->os, GpuWork->freeListMutex)); + acquired = gcvFALSE; + + /* Success. */ + gcmkFOOTER(); + return gcvSTATUS_OK; + +OnError: + if (acquired) + gckOS_ReleaseMutex(GpuWork->os, GpuWork->freeListMutex); + + /* Return the status. */ + gcmkFOOTER(); + return status; +} #endif diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace_gpu_work.h b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace_gpu_work.h index 07c624d..ea279cf 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace_gpu_work.h +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/gc_hal_kernel_trace_gpu_work.h @@ -52,7 +52,6 @@ * *****************************************************************************/ - #if !defined(__gc_hal_kernel_trace_gpu_work_h_) || defined(TRACE_HEADER_MULTI_READ) #define __gc_hal_kernel_trace_gpu_work_h_ diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/default/gc_hal_kernel_platform_default.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/default/gc_hal_kernel_platform_default.c index 551a58a..8da30dd 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/default/gc_hal_kernel_platform_default.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/default/gc_hal_kernel_platform_default.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c index fdcafc6..1f9afef 100644 --- a/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c +++ b/kernel-module-imx-gpu-viv-src/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 - 2023 Vivante Corporation +* Copyright (c) 2014 - 2024 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 - 2023 Vivante Corporation +* Copyright (C) 2014 - 2024 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -322,7 +322,7 @@ static int gpufreq_cooling_handle_event_change(unsigned long event) printk("Hot alarm is canceled. GPU3D clock will return to %d/64\n", orgFscale); break; case 1: - gcmkFALLTHRU; + gcmkFALLTHRU; case 2: FscaleVal = minFscale; printk("System is too hot. GPU3D will work at %d/64 clock.\n", minFscale); @@ -337,7 +337,7 @@ static int gpufreq_cooling_handle_event_change(unsigned long event) gckHARDWARE_SetFscaleValue(device->kernels[core++]->hardware, FscaleVal, FscaleVal); } - return NOTIFY_OK; + return 0; } static int gpufreq_set_cur_state(struct thermal_cooling_device *cdev, @@ -370,7 +370,6 @@ static int gpufreq_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *state) { struct gpufreq_cooling_device *gpufreq_device = cdev->devdata; - *state = gpufreq_device->state; return 0; @@ -412,7 +411,7 @@ static struct thermal_cooling_device *device_gpu_cooling_register(struct device_ int ret = 0; gpufreq_dev = kzalloc(sizeof(struct gpufreq_cooling_device), - GFP_KERNEL); + GFP_KERNEL); if (!gpufreq_dev) return ERR_PTR(-ENOMEM); @@ -431,8 +430,9 @@ static struct thermal_cooling_device *device_gpu_cooling_register(struct device_ gpufreq_dev->max_state = states; cdev = thermal_of_cooling_device_register(np, name, gpufreq_dev, - &gpufreq_cooling_ops); + &gpufreq_cooling_ops); kfree(name); + if (!cdev) { release_idr(&gpufreq_idr, gpufreq_dev->id); kfree(gpufreq_dev); @@ -729,8 +729,9 @@ static int init_gpu_opp_table(struct device *dev) priv->imx_gpu_govern.num_modes = 0; prop = of_find_property(dev->of_node, "operating-points", NULL); - if (!prop) + if (!prop) { return 0; + } if (!prop->value) { dev_err(dev, "operating-points invalid. Frequency scaling will not work\n"); @@ -764,17 +765,15 @@ static int init_gpu_opp_table(struct device *dev) val = prop->value; for (p = 0, i = priv->imx_gpu_govern.current_mode; nr > 0 && i < GOVERN_COUNT; nr -= 4) { - unsigned long core_freq, core_volt, shader_freq, shader_volt; + unsigned long core_freq, core_volt, shader_freq; core_freq = be32_to_cpup(val++) * 1000; core_volt = be32_to_cpup(val++); if (nr == 2) { shader_freq = core_freq; - shader_volt = core_volt; } else { shader_freq = be32_to_cpup(val++) * 1000; - shader_volt = be32_to_cpup(val++); } /* We only register core_clk frequency */ @@ -1511,7 +1510,6 @@ static inline int get_power(struct device *pdev) return ret; #if gcdENABLE_FSCALE_VAL_ADJUST && defined(CONFIG_DEVFREQ_THERMAL) - ret = driver_create_file(pdev->driver, &driver_attr_gpu3DMinClock); if (ret) @@ -1535,7 +1533,6 @@ static inline int get_power(struct device *pdev) } } gcdENABLE_GPU_THERMAL = 1; - #endif #if defined(CONFIG_PM_OPP) @@ -1638,6 +1635,7 @@ static inline void put_power(struct device *pdev) #if gcdENABLE_FSCALE_VAL_ADJUST && defined(CONFIG_DEVFREQ_THERMAL) gcdENABLE_GPU_THERMAL = 0; + if (gpu_cooling_device) device_gpu_cooling_unregister(gpu_cooling_device); @@ -1660,6 +1658,7 @@ static inline void put_power_ls(void) { #if gcdENABLE_FSCALE_VAL_ADJUST && defined(CONFIG_DEVFREQ_THERMAL) gcdENABLE_GPU_THERMAL = 0; + if (gpu_cooling_device) device_gpu_cooling_unregister(gpu_cooling_device); @@ -1837,7 +1836,7 @@ int set_clock(int gpu, int enable) #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0) #ifdef CONFIG_PM -#if defined(CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) +#if defined (CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) static int gpu_runtime_suspend(struct device *dev) { release_bus_freq(BUS_FREQ_HIGH); @@ -1850,7 +1849,6 @@ static int gpu_runtime_resume(struct device *dev) return 0; } #endif - static struct dev_pm_ops gpu_pm_ops; #endif #endif @@ -1869,12 +1867,11 @@ static int adjust_platform_driver(struct platform_driver *driver) memcpy(&gpu_pm_ops, driver->driver.pm, sizeof(struct dev_pm_ops)); /* Add runtime PM callback. */ -#if defined(CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) - gpu_pm_ops.runtime_suspend = gpu_runtime_suspend; - gpu_pm_ops.runtime_resume = gpu_runtime_resume; - gpu_pm_ops.runtime_idle = NULL; +#if defined (CONFIG_PM_RUNTIME) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) + gpu_pm_ops.runtime_suspend = gpu_runtime_suspend; + gpu_pm_ops.runtime_resume = gpu_runtime_resume; + gpu_pm_ops.runtime_idle = NULL; #endif - /* Replace callbacks. */ driver->driver.pm = &gpu_pm_ops; #endif diff --git a/kernel-module-imx-gpu-viv-src/hal/security_v1/gc_hal_ta_hardware.c b/kernel-module-imx-gpu-viv-src/hal/security_v1/gc_hal_ta_hardware.c index e3efbd5..b8bb0a6 100644 --- a/kernel-module-imx-gpu-viv-src/hal/security_v1/gc_hal_ta_hardware.c +++ b/kernel-module-imx-gpu-viv-src/hal/security_v1/gc_hal_ta_hardware.c @@ -496,7 +496,6 @@ gctaHARDWARE_SetMMU( gcsMMU_TABLE_ARRAY_ENTRY *entry; gcsHARDWARE_FUNCTION *function = &Hardware->functions[0]; gctUINT32 delay = 1; - gctUINT32 timer = 0; gctUINT32 idle; gctPHYS_ADDR_T mtlbPhysical; gctPHYS_ADDR_T secureSafeAddress; @@ -589,7 +588,6 @@ gctaHARDWARE_SetMMU( 0x00004, &idle); - timer += delay; delay *= 2; } while (!(((((gctUINT32) (idle)) >> (0 ? 0:0)) & ((gctUINT32) ((((1 ? 0:0) - (0 ? 0:0) + 1) == 32) ? ~0U : (~(~0U << ((1 ? 0:0) - (0 ? 0:0) + 1)))))) ));