Currently, all of the modules are built from a single Bazel package.
This complicates integration with the vendor build because the
Android build system builds the modules individually.
Split the modules into their own Bazel packages to align more closely
with the Android build system's expectations and easy to hook bazel build.
Change-Id: I100e9ec9edbe96212089a5944cbba4d6677ff83a
Signed-off-by: Varsha Suresh <quic_varssure@quicinc.com>
Fence error use case may require that later fence in tx queue
be signaled with error before earlier fence. HW Fence Driver
provides limited support for this scenario by providing a way
to swap the first two entries of client Tx Queue.
Change-Id: I00faada95a3c33c1dcced79bea5fef3b581152cd
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add HW Fence Driver support to notify waiting clients of fence error in
HLOS. This is a requirement by clients that do not have Rx Queue. Such
clients can register a fence error callback function with data that will
be passed back with callback.
The fence error callback function is called by HW Fence Driver when:
1. Client registers for a fence already signaled with error.
2. Error is signaled for a fence that the client registered to wait on.
Change-Id: I2892333838001bed1152118b947cfe12b1a8dd04
Signed-off-by: Grace An <quic_gracan@quicinc.com>
A parameter is set to enable the build to be executed with DDK framework.
Change-Id: Ib98d5a990aa1cfe836d9214111bfef317a4c4fae
Signed-off-by: Varsha Suresh <quic_varssure@quicinc.com>
Add interfaces to support dumping debug data. These interfaces should be
used by drivers in case of a hw-fence error detected.
Change-Id: Iab46c8e9dea8ffead06f192c8d01182912fffcce
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Current implementation allows ioctl to deregister hw-fence client with
client_id that does not match hw_sync_obj. This can cause a double-free
if user-space deregisters the wrong file descriptor by mistake.
Instead, fail the ioctl early if it has these invalid parameters.
Change-Id: Ib781be18d2f71c24d6aa4fc08eeba44649da13da
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Fix compilation errors for kalama target, where cpusys vm share
memory driver is not present.
Change-Id: I4f7762ad747490ba166f8e9ae27dd0191de3f021
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
- add support to build mm-drivers module using DDK framework for pineapple
- add macro that makes it easy to register new modules
Change-Id: I704bbe946f4d1053a85bfb122408c201b0f155b2
Signed-off-by: Varsha Suresh <quic_varssure@quicinc.com>
Add support to read hw fence ctl events through debugfs node from the
carved out memory region shared with Fence Controller.
Change-Id: I508695efcb8c7aa8fab9db2086af1ec1ff0ddd84
Signed-off-by: Grace An <quic_gracan@quicinc.com>
As we are merging upstream patches, resolve conflicts of namespaces in
downstream modules.
Change-Id: I2aa4b0f2cea859cddd2fb537fce7a6908999e7d4
Signed-off-by: Prakruthi Deepak Heragu <quic_pheragu@quicinc.com>
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Synx clients may specify additional flags (e.g. flags to specify a
global fence) when creating or importing hwfence-backed synx objects.
Ensure HW Fence Driver support of these flags.
Change-Id: I38d94875be09da3506d3939077099c05fa9235f6
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Remove ioctls to destroy fence and fence array. Existing implementation
fails to close file descriptors properly, and closing fds must be done
by caller, not by HW Fence driver.
Change-Id: I7a84c87475144f3e8a90acf44b7cf8678b6cc2dd
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Remove HW Fence driver deprecated support of platforms without dpu-ipc
signaling, e.g. targets prior to kalama.
Change-Id: I8491a96040b4c3857a32a9bf6092e53479284a64
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Avoid from hw-fence driver call to share carved-out memory between
hlos and cpusys vm if the memory has been already shared by the
gh_cpusys_vm_mem_access kernel driver.
Change-Id: I0df0216a6153a8982936885f53bebf7fe83db7e9
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Some clients require that write_index starts from nonzero value and
index by payload instead of by dwords. Add support for device-tree
configurable properties to control nonzero index start_index and
indexing by payload for client tx queue read and write indices.
Change-Id: I8942dc2d25a7d1cb0421cabd36c73a404ecd0134
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add device-tree configurable padding in bytes before and after queue
header(s). This enables support for 32-byte aligned queue write_idx,
which is a requirement to satisfy hardware constraints by some clients.
Change-Id: Icfd6bb385c825a8629974c72522efdc3cbfe3303
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Avoid compiling synx translation layer on kalama target where synx
driver is not available.
Change-Id: I0a4f8c291fc3843065e75f536b4e16a246ea69d4
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Clear doorbell mask for val client loopbacks. Create up to
full number of possible fences for create_fence_array. Wait
full amount of time for fence in ioctl.
Change-Id: Ic0f2553f345932511fa9669b5383d8bfdaa23459
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add support for signal-based reservation of hw fence client ids for
ipe and vpu clients.
Change-Id: I4e4a835424756c6e5fa8d5c2d340dfadc4d11541
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add implementation to translate the msm_hw_fence API into synx API.
Change-Id: I5d0b7afcc297a4e3c8ec4ed9867831b5d2dfc3af
Signed-off-by: Grace An <quic_gracan@quicinc.com>
When validation clients register to wait on already signaled fences,
the hw fence driver must signal the client wait and wake up waiting
validation clients.
Change-Id: I3e0f7abfbb055d8e5fbb5afd5fc8b88991c95aee
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Latest update to qcom_scm_assign_mem API changed input data types.
Change data types in HW Fence Driver to ensure compatibility with
newest API.
Change-Id: Ia25bb9e129cf67ec99e18c60407ac997cf0d6e3f
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Currently, the ioctl to trigger ipcc signals uses the client virtual id
as the tx client and the client physical id as the rx client. This
should be reversed to correctly perform ipcc signaling.
Change-Id: I61e7ec0e4bfd63f2d7e1cd1dd4e62dd4f6a82143
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Current hw-fencing feature is disabled by default through kernel command line
argument, therefore it is expected that clients receive an error when trying
to register a client while feature is disabled.
This change silence any print error messages during the clients registration
when feature is disabled.
Change-Id: Ie57adb52a975f9541e485039a582407cf21c11cd
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Currently, carved-out memory region is mapped as IO. Change mapping
to normal memory.
Change-Id: I1eca1067e30e2a6e39969c003dcce9ea0f9c47fd
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Switch to upstream friendly qcom_scm_assign_mem from hyp_assign_phys.
Change-Id: I01c6b93698fea094cf89926f3168466ba14061bc
Signed-off-by: Grace An <quic_gracan@quicinc.com>
This change make sure that the write_idx and read_idx
of the client hfi queues are reset during the call
to msm_hw_fence_reset_client.
Change-Id: Iaf94865ddf78ed8e19de509e3ee6176d03c5301c
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
When hw fencing is disabled via kernel command line argument, allow
probing of hw fence driver and perform memory sharing during probe. This
ensures that the carved out memory region for hw fences is always shared
with hypervisor regardless of hw-fencing feature enablement.
Change-Id: I7723fd61860e0d6b8dc374a054c8519d98d700a6
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Current HW Fence validation framework limits the creation of a HW Fence-
array to fences from a single parent client. This change adds support to
hw_fence_create_array IOCTL so a HW fence-array can be created from fences
of different clients.
Change-Id: I6ce801f51747fcab503fc23c1ae981b107d4f315
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Starting pineapple, fence protocol is used for hw fence driver.
Change-Id: I87435128c22aeb338dfcda38f0196e04dc9eb70b
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Some hw fence driver clients require the ability to call the
'msm_hw_fence_update_txq' API to update the queue payload without
updating the 'write_index' member within the hfi header. These clients
also need to receive the index at which the payload is written within
the queue.
This change adds support for this requirement by adding a device-tree
property to configure this behavior for each client. The 'tx_wm' member
within the hfi header is used to track in software the place where the
payloads are within the queue for clients that skip the update to the
'write_index' member.
Change-Id: I2881fa49bef4e49691eb6049830f9dc8dc8fa425
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Update ipc configurations to support IPE, VPU, and IFE clients
in hw fence driver. Add support for IPE and VPU clients on
kalama, and add support for all clients on pineaple.
Change-Id: Iee577118284a02bd5b368ca206e88ed75eaa95b3
Signed-off-by: Grace An <quic_gracan@quicinc.com>