drm/msm/dp: complete link training before hot plug notification
DisplayPort source device needs to complete the link training
with the sink device before sending video data. Currently this
is being done on a frame commit thread. Once the hot plug
notification to user-space is sent, the commit thread is blocked
until the link training is completed. As link training can take
some time, it may result in primary display artifacts.
Optimize this by moving the link training before sending the
hot plug notification to user-space. This unblocks the frame
commit thread. As the link training is done as soon as the
cable is connected, time to display the video on sink is reduced.
Also, shut down all the clocks and release all the hardware resources
like GPIOs, regulators, pin-controls etc on not just physical cable
disconnect but on IRQ HPD disconnect as well to save power.
To achieve this, create a new power module, link, which can handle
the link training separately. Associate corresponding clocks to the
new power module. Once the cable is connected, enable necessary
power modules like core and newly created link and start the
link training. If it fails, no hot plug to user-space is sent. This
avoids unnecessary resource allocation by user-space even though
corresponding driver interface can't be used. If it succeeds, the
frame commit thread can return quickly by enabling the corresponding
video stream.
Some other minor enhancements involving this implementation is to
avoid sending hot plug if user-space can't process it like sending
same status consecutively which can result in unnecessary wait in
driver for user-space to respond.
Return with error code in case the link training has failed so that
the session can be torn down quickly.
CRs-Fixed: 2294347
Change-Id: I718624f9f5e4ca6b7f59cd8681ae9a24d0d8a52c
Signed-off-by:
Ajay Singh Parmar <aparmar@codeaurora.org>
Loading
Please register or sign in to comment