Add support of the option to pass a 64-bit client_data value to
the hw fence driver when a client registers as a waiting client
for a hardware fence. Then during fence signaling, this client_data
is returned to the client via the RxQ.
If no client_data is passed to the driver for the hw fence, then a
default value of zero is registered as the client_data.
Change-Id: I34cf3e50413639d53cbfa8251c98b9ff1d3cbf4a
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add new APIs to receive params client-id and handles of hw fences
to manage synx compat support.
Change-Id: I5dae0845f8eb2c6c05cc2605d8fc93935c780901
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add debugfs to query the amount of times that
inter-vm trylock needs to wakeup the svm.
Change-Id: Ic1f88319f502e652902be0d45792768cf5c5154e
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Current driver creates a join hw-fence from a fence-array, adds its
waiting client to it, and then it decides if signal the hw-fence
depending in the current state of all the child hw-fences from the
fence array.
However, if by any reason the fence-array gets all its children cleared
within it (which can happen for spec-fences failures), hw-fence driver
logic won't signal the new created join-fence.
This can lead to the creation of an empty or incomplete join-fence that
the waiting-client will be waiting-for, but won't be signaled.
Add a check to make sure that if above scenario is ever presented,
the register for wait API catches this issue and fails to register
for wait in this invalid fence.
Change-Id: If3c69405d2a3adfefd12f447257c2560b839d238
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Add support for inter-vm try-lock between hlos and vm.
Change-Id: Iab9087acf82a4a746e9d43a736724ce2e7196237
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Starting pineapple, each ipc client has a different physical-id and
virtual-id for registers access and configuration.
This change updates the ipc to handle this different configuration.
Change-Id: I36fa84b07ffd209ce3fb323ff796f9e7721d7dd2
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
It is possible that one (or more) child fences get signaled by
fence controller, right after we add the join fence as parent
fence of the child fence. If so, the join fence pending child
count may become 0 which means we can safely signal the join
fence.
Change-Id: I0222b93a62db13eeb7867f3741c1db944df036b1
Signed-off-by: Harshdeep Dhatt <quic_hdhatt@quicinc.com>
Set this flag if a hw fence (for which a client wants to wait) has already
been signaled. Clients can check this flag and indicate to their respective
hardware (or firmware) that this fence is already signaled.
Change-Id: I9337cabb771197f2d35ac4386402a25941d73311
Signed-off-by: Harshdeep Dhatt <quic_hdhatt@quicinc.com>
Not all clients need ipc interrupt for an already signaled fence. Set the
per client property based on whether a client needs the interrupt or not.
Also, set update_rxq property for GPU client to false, as GPU doesn't need
already signaled fences to be sent to GPU Rx Queue.
Change-Id: I08a6bbd598695b112124ce6ec409db75d5e11e0f
Signed-off-by: Harshdeep Dhatt <quic_hdhatt@quicinc.com>
This change fixes printk arguments in mm-drivers which is
found with additional compilation flags and add compile
flags too.
Change-Id: Ic83f044467dca6d391221182096b9c50b7da36de
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
Create dummy spec_fence and pass it to dma_fence_array_create(), to
avoid NULL pointer access in dma_fence_array_create().
Change-Id: I7a283753169cccbed6c842090a48cbb6e185cf9a
Signed-off-by: Bruce Hoo <quic_bingchua@quicinc.com>
Move timestamps to use qtimer instead of sleep timer.
Change-Id: I1a5f20c3d1ec31ba13e95713828024a309a53ba1
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Remove client id bitmask to track registered clients. This
allows support of more than 64 transmit clients.
Change-Id: Ia2b4667d008bfceb0b46bfd3e14302e5bec82cb3
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Change addresses a compiler error for missing return type
Change-Id: I82f22cefef069988e60608210533250307e516b3
Signed-off-by: Alex Danila <quic_eadanila@quicinc.com>
Add #ifdef to configure the maximum allowed driver instances
base on the build configuration, to avoid uninitialized access
to fences array.
Change-Id: I83ea5ade33a93e23edee21a0435ed7257fe5c9c9
Signed-off-by: Amine Najahi <quic_anajahi@quicinc.com>
During a client reset, hw fences that are already signaled
should not require to be signaled again, otherwise waiting
clients can receive the signal from unexpected hw fences
that have been already signaled long time back.
Add check to only signal hw fences that are not in signaled
state during the client reset.
Change-Id: I6f6a6ba142889f9c7ee2bd8680c30592c3c0987f
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Add size, type, version, and client_data fields to hw fence queue
payload and update 32-bit timestamp field to full 64-bit timestamp
field.
Change-Id: Iafb0eb80f83acd5753786fa50a31c1fb74f1a2fa
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Ensure that clients deregister hardware fences for client ids
strictly less than HW_FENCE_CLIENT_MAX. This prevents out of bounds
array accesses.
Change-Id: I3453135cfd7a74373421d8db32c3ecb0fffc70d0
Signed-off-by: Grace An <quic_gracan@quicinc.com>
Add qtimer timestamps to queue payloads.
This timestamp is to be updated by the client
that adds the entry to the queue.
Change-Id: I69dd4420ec18b7470f99d5cfe46129c10b3f3391
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
add environment variable to be used by display-techpack.mk
for build.sh techpack display_tp.
Change-Id: I46b0ac3fb40371e3282191c75a501230243d9f52
Signed-off-by: Ashwin Pillai <quic_ashwpill@quicinc.com>
Move memory barriers to ensure data is available before
the read of indexes from the queues.
Change-Id: I3b5a7903f038cc62b461fbfc9cbeb143b862a1f1
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Spec_fence device is already used by surfaceflinger, increase
device_available by 1.
Change-Id: I3795ffc40fb2ca95e933d4ed056dc9a4c628ba1e
Signed-off-by: Bruce Hoo <quic_bingchua@quicinc.com>
This change ensures that the hw-fence driver is disabled by default and
can be enabled or disabled based on a kernel command line argument. If
the hw-fence driver is disabled, msm_hw_fence_probe returns an error.
Change-Id: I248f29158c17a43151aa8b0c980a7ce0f5e758d6
Signed-off-by: Grace An <quic_gracan@quicinc.com>
This change updates makefile to export sync_fence
module symbols, so these can be imported by other
external kernel modules.
Change-Id: Idd64fae8f8797cbcb4b4012666ed5621fa83062f
Signed-off-by: Christina Oliveira <quic_coliveir@quicinc.com>
This change adds support to validate the hw_fence driver
by adding IOCTLs that expose the hw_fence interfaces so that
validation clients can register/unregister, create/destroy
and wait/signal fences. IOCTL's will be available for debug
purpose only when the debugfs config is set.
Change-Id: Idb0d04ee245718e9b19ccd12ac760829831426b0
Signed-off-by: Shirisha Kollapuram <quic_kshirish@quicinc.com>
This change provides required support to disable mm driver modules
compilation along with all modules and supports specific flag for
override to enable compilation if required.
Change-Id: I3ea1383855a6be49ed12a23a3585e9d6ebb1810a
Signed-off-by: Prabhanjan Kandula <quic_pkandula@quicinc.com>
(cherry picked from commit 91a337989da77e6071fdfbd03b43c423356c14c0)
This change adds a check to avoid hw-fences creation until
the fence controller is ready.
Change-Id: I613c19d9dfd8836f8ded6bcb0162bef647df7bc3
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Populate the payload size for the ctrl, rx and tx queues
that communicate with the fence controller.
Change-Id: Idc7dafcccd6ea16821e4f595bdab7395a5e0745b
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
hw_fence driver is not required for taro variants.
Since the Display SI 3.0 is shared with taro dev SI variant,
avoid compiling hw_fence as dlkm for taro target.
Change-Id: I84637f2546fd0818d956880fbc1bb86a30a7c916
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
This change adds support for the hw-fence driver that initialize, expose
and manage the interfaces for the hw-fences, which are the synchronization
primitives to allow the hardware to hardware signalization of the fences
for the frame buffers shared between gpu and display hw-cores.
Change-Id: If2313585d5a9f3ac90e16aad3464600641a6fa04
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
Sync fence driver setup only compiles if the CONFIG flag for
sync driver is set, however, this requires config files of the
parent folder to be included, which currently is not happening.
Resolve this problem by including the parent mm-drivers
config files.
Change-Id: I812612b71003ed007d60c046dcef5bcbe09f6e7c
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
This change adds an api to check if a given speculative
fence is bound. If fence is not bound, it will wait for the
speculative fence ioctl to bind the fence, or else timeout.
Change-Id: I9a86d09df410e89137264be47763ae39f06eea2b
Signed-off-by: Ingrid Gallardo <quic_ingridg@quicinc.com>
This change acquires fence_lock to serialize the enable_sw
signalling operation on dma_fence_array. It bails out
safely if the bind operation is called twice on the spec
fence. The error level for bind failure with invalid user fd
is changed to warning as this case can be treated non fatal.
Change-Id: I688cbc84ba3cfb49c54de9b5e1bf8a9ec9d8da3a
Signed-off-by: Narendra Muppalla <quic_nmuppall@quicinc.com>
sync_fence driver is maintained in kernel SI for all the taro variants.
Since the Display SI 3.0 is shared with taro dev SI variant,
avoid compiling sync_fence as dlkm for taro target.
Change-Id: Icc7990812256a42efad7a8945c08338f83ee0914
Signed-off-by: Jeykumar Sankaran <quic_jeykumar@quicinc.com>
msm_ext_display module symbols have to be exported before they can be
used by external kernel modules. This change updates the makefile
for the same.
Change-Id: I86dbc2d8bbc0a3a0d640172ef0aebc03723eecc8
Signed-off-by: Sandeep Gangadharaiah <quic_sandgang@quicinc.com>
Enable compilation of mm-driver modules and add scripts to copy
the uapi header files.
Change-Id: I0af6581ca96aa630c9707ef05abc4cccbfe92bab
Signed-off-by: Jeykumar Sankaran <quic_jeykumar@quicinc.com>