During cases where device coming out of pm suspend and disconnecting
the DP cable happens around the same time, it is possible that the
DP ON sequence is triggered from userspace before the disconnect event
is notified to the userspace. Add a check to make sure DP ON sequence
is executed only when the sink is connected.
Change-Id: I61d06e007358df75c5cedc26552422c7a8c8aa0b
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Provide complete resolution details in a sysfs node "res_info"
limited to PAGE_SIZE. Different modules can query for multiple
resolution details based on the resolution ids received from
EDID of the TV. In case resolution details exceed PAGE_SIZE,
reuse res_info to get remaining timing details by provide page
details. Check page id is within the max supported resolution
ids to avoid reading extra memory than required.
Change-Id: I7cdd071ba462080fe5bb302d0da824ed95b50f15
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
There is no validation of the "count" parameter, which is controlled
by the user and used as a size of allocated memory. If the user
provides a value of "0" for "count", then kmalloc would not return
NULL, but also there will be a memory block of "zero" size. This can
lead to buffer overflows. Also trying to access invalid memory will
cause kernel crashes. Ensure to check that the number of bytes to be
written is non-zero. If zero, return invalid input.
Change-Id: I9613043881a91fd5a5f99337119c4a3d41493b54
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
Number of cea blocks are read from edid buffer which comes from the
user. If the number of cea blocks are more than the supported blocks
kernel information leak is possible by reading more data than is
present in edid_buf.
Change-Id: I03b8456ff1e1a7b15d711f06908bd5c83f83cc02
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
To update custom edid through sysfs node, there was no check
on the edid size passed. The user can overwrite the edid buffer.
To prevent buffer overflow, ensure that edid size is validated
with the edid buffer size before writing to the buffer.
Change-Id: I8604ea2d25f3a4985749bd037497d242b0621519
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
Avoid allocating mixers LM0 and LM1 to external display and
writeback as they are allocated to primary display first.
Change-Id: I343a70dca2e664e5c9765fa2f0b933714b747b4a
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
During resolution switch, the vsync is disabled just before the switch
as part of ctrl stop, but it is not enabled back after the switch. This
change keeps track of vsync before the switch and handles it
appropriately after the switch.
Change-Id: I3eed93d7f7635217bac3c19c61f68154cacef56e
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
If the TE irq is alredy requested and registred with a GPIO, then
setting it to true and not continuing with further requesting of
the same.
Change-Id: Iacd1677127c2663d88826e58f1b72704b58db939
Signed-off-by: Rashi Bindra <rbindra@codeaurora.org>
Some special panels may need high speed mode to send brightness
to avoid panel issues, adding this change can make a better user
experience using these panels.
Change-Id: Id2cd4b3652892cc7677d7c6863a67d93e24d980f
Signed-off-by: Yahui Wang <yahuiw@codeaurora.org>
debug offset comes from the user and can hold any value which can
cause unaligned access. This change fixes the unaligned access
problem on debug offset by properly aligning it.
Change-Id: Ic61c2651986ea6c98cc7d58e27af3e5fe6e42a88
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Modified the size of the gamut table data-structure in order to
avoid a buffer overflow while copying data from user-space.
Change-Id: I8c5fa1caff450a2d25d7859bd159ab4a60045e54
Signed-off-by: Bharath Gopal <gopalb@codeaurora.org>
When 32 bit process calls the post processing ioctls compat layer
functions will be called. If post processing version is not supported
payload needs to be freed. Change adds support for clean-up.
Change-Id: Ib3c4d60b858ddd952a3906946458aa2bf2c69076
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Fix bug in cursor which prevents the virtual address of the
registers to be stored in the driver context.
Change-Id: Ica8a9548911da5a32903893b0e494d052e366285
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
When fd is requested during get_metadata call, create fd
using O_CLOEXEC flag.
CRs-Fixed:2030638
Change-Id: I1c874f713a3ebada63ba2c85f021aa78b04af44b
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Read the panel status from master controller when sync wait
broadcast is enabled for the panel.
Change-Id: I57ddac718738f3a6749d1deddae93b25e7f77261
Signed-off-by: Rashi Bindra <rbindra@codeaurora.org>
For video mode panels, when secure display has ended and non-secure
layers are being committed, check if secure display is still enabled.
Ideally there should be a NULL commit before non-secure content starts,
to clean up the secure display. If this isn't the case, add code to
detect, validate, and return failure.
Change-Id: I574547307073e38a19a42ff21679b17e1ec29b3b
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
These are all driver changes needed for disablement of
CONFIG_CC_OPTIMIZE_FOR_SIZE. CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
is enabled by default once CONFIG_CC_OPTIMIZE_FOR_SIZE is disabled.
Change-Id: Ia46a1f24e8a082a29ea6151e41e6d3a85a05fd4f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
Avdd enable gpio maybe used for AMOLED panel to control avdd
output. This gpio should be enabled/disabled when panel
does unblank/blank once to avoid panel electric leakage.
Change-Id: I18f0f6491f0ff97df5556e74a686a18b262708df
Signed-off-by: Yahui Wang <yahuiw@codeaurora.org>
Under MDSS suspend resume usecase, the mixer config might not be
setup and if a partial update is issued for the first frame, it is
necessary to avoid accessing the NULL mixer config.
CRs-Fixed: 2053822
Change-Id: I17c0b98805ce9395899e988032097740126fee83
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
Fix sparse tool error which mandates that functions used only
within the file to be declared as static to allow compiler
optimizations.
Change-Id: Iba14c50730bb7ce402e4b45bc9b2c8d1fec6f3eb
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>
When calculates the MDP clock during downscale usecase for command
mode panel, it is necessary to calcuate the entire horizontal pixel
count of the panel including the front and back porch. The incorrect MDP
clock calculation will cause screen corruption, which usually show up in
the bottom half of the screen.
CRs-Fixed: 2039110
Change-Id: Id16abb645372ef5d21472839815b6ada502dc19b
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
Set horizontal and vertical polarities based on the
HDMI resolution and use these polarities when setting up
the MDP timing generator.
CRs-Fixed: 2016373
Change-Id: Ifaf4d72a25e512ecccf13f479a77c8e860978082
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Signed-off-by: Krishna Srinivas <krisrini@codeaurora.org>
Signed-off-by: Yuchao Ma <yuchaom@codeaurora.org>
When pixel transfer is going on, there is a race condition during
which pixel clock can get turned off due to early clock gating
before CMD_MDP interrupt is triggered which can cause interrupt
storm. This change ensures CMD_MDP interrupt is received before
turning off clocks.
Change-Id: I33b664334912584170c12733329051b067c3f1da
Signed-off-by: Ashish Garg <ashigarg@codeaurora.org>