Commit graph

3798 commits

Author SHA1 Message Date
Padmanabhan Komanduru
9cfbd570ef mdss: dp: check if sink device is connected before DP ON sequence
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>
2017-06-12 12:24:15 +05:30
Linux Build Service Account
c1a2472056 Merge "fbdev: msm: Allocate fd with O_CLOEXEC flag" 2017-06-10 02:20:47 -07:00
Linux Build Service Account
73d6c8e7de Merge "msm: mdss: Buffer overflow while processing gamut table data" 2017-06-10 02:20:46 -07:00
Linux Build Service Account
1bfc4b2e71 Merge "fb: msm_dba: add post-on-sleep support for adv7533 vreg" 2017-06-10 02:20:45 -07:00
Linux Build Service Account
12cf20b0e9 Merge "ARM: dts: msm: update nt35597 panel properties for msm8998" 2017-06-10 02:20:43 -07:00
Ashish Garg
2be7caec63 msm: mdss: validate page id before reading from edid buffer
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>
2017-06-09 16:50:01 +05:30
Ashish Garg
fed910ca51 msm: mdss: validate the buffer size before allocating memory
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>
2017-06-09 16:32:00 +05:30
Ashish Garg
c01e9da280 msm: mdss: validate number of cea blocks before reading from edid_buf
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>
2017-06-09 16:23:58 +05:30
Ashish Garg
7f24865a8a msm: mdss: size check before writing to edid buffer
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>
2017-06-09 15:52:44 +05:30
Krishna Manikandan
e2c351c864 fbdev: msm: Reserve mixers with dspp for primary display
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>
2017-06-09 11:05:40 +05:30
Harsh Sahu
0bb5e6610a msm: mdss: handle vsync properly during dynamic resolution switch
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>
2017-06-08 15:16:24 -07:00
Rashi Bindra
4c22995163 msm: mdss: Do not attempt to request TE irq again if already requested
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>
2017-06-08 03:50:31 -07:00
Yahui Wang
e58eb7c0ca msm: mdss: add support to control dcs brightness with HS state
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>
2017-06-08 15:33:57 +08:00
Krishna Manikandan
7eaa60b8e5 fbdev: msm: fix unaligned access problem
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>
2017-06-08 10:43:47 +05:30
Linux Build Service Account
f10af35ab9 Merge "msm: mdss: update polarity based on HDMI resolution" 2017-06-07 20:57:49 -07:00
Linux Build Service Account
8efb4552d1 Merge "msm: mdss: do not print error in case sync_trigger is enabled" 2017-06-07 13:13:41 -07:00
Linux Build Service Account
3ba7511de8 Merge "msm: mdss: disable AVR for msm8998" 2017-06-07 13:13:39 -07:00
Linux Build Service Account
b13c09c779 Merge "msm: mdss: Check if secure display is enabled during non-secure validate" 2017-06-07 13:13:38 -07:00
Linux Build Service Account
bed622b809 Merge "msm: mdss: Avoid NULL mixer during partial update ROI setup" 2017-06-07 13:13:37 -07:00
Linux Build Service Account
b8639a8f8c Merge "msm: mdss: Fix QSEED3 MDP clock calculation for cmd mode panel" 2017-06-07 13:13:35 -07:00
Linux Build Service Account
e3954e1572 Merge "drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZE" 2017-06-07 13:13:31 -07:00
Linux Build Service Account
4c6e5c55cd Merge "msm: mdss: control avdd enable gpio when doing panel reset" 2017-06-07 13:13:29 -07:00
Bharath Gopal
b119bd673b msm: mdss: Buffer overflow while processing gamut table data
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>
2017-06-07 02:14:11 -07:00
Gopikrishnaiah Anandan
7eabecedef msm: mdss: Clean-up payload for unsupported versions
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>
2017-06-06 11:30:58 -07:00
Krishna Manikandan
23e2061c07 fbdev: msm: fix issue preventing cursor_buf address to be stored
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>
2017-06-06 15:06:28 +05:30
Krishna Manikandan
8983eadbc9 fbdev: msm: Allocate fd with O_CLOEXEC flag
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>
2017-06-05 12:21:29 +05:30
Rashi Bindra
2460230803 msm: mdss: Read status value from master controller
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>
2017-06-01 04:24:24 -07:00
Krishna Chaitanya Devarakonda
183f6944db msm: mdss: Check if secure display is enabled during non-secure validate
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>
2017-05-31 23:31:52 -07:00
Linux Build Service Account
13e35bf17d Merge "msm: mdss: declare function used only within the file as static" 2017-05-31 17:57:58 -07:00
Prasad Sodagudi
0958ceaaf4 drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZE
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>
2017-05-31 16:51:47 -07:00
Yahui Wang
41f27c5716 msm: mdss: control avdd enable gpio when doing panel reset
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>
2017-05-31 11:13:28 +08:00
Benjamin Chan
55a175279c msm: mdss: Avoid NULL mixer during partial update ROI setup
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>
2017-05-30 14:24:23 -04:00
Ashish Garg
3b14e4b252 msm: mdss: declare function used only within the file as static
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>
2017-05-30 10:38:29 +05:30
Linux Build Service Account
ace73576d2 Merge "msm: mdss: Fix potential dereferencing of null pointer" 2017-05-29 10:17:24 -07:00
Linux Build Service Account
19827f9f2e Merge "msm: mdss: Call regulator enable/disable for both DSI controllers" 2017-05-27 18:12:14 -07:00
Linux Build Service Account
d11a00dbfa Merge "msm: mdss: ensure clocks are on till pixel transfer is completed" 2017-05-27 18:12:13 -07:00
Linux Build Service Account
ce48f56032 Merge "msm: mdss: remove client from device list if failed to register" 2017-05-27 18:12:12 -07:00
Linux Build Service Account
a19821d5d3 Merge "msm: mdss: add recovery if TE is not coming from the panel" 2017-05-27 18:12:04 -07:00
Linux Build Service Account
bc1c25b0ef Merge "msm: mdss: Correct MDSS display wakeup time calculation" 2017-05-27 18:12:03 -07:00
Linux Build Service Account
c9b46c3b0c Merge "msm: mdss: remove wait for vsync in display commit" 2017-05-27 18:12:01 -07:00
Linux Build Service Account
988a9ef224 Merge "msm: mdss: Disable traffic shaper in command mode" 2017-05-27 18:11:59 -07:00
Linux Build Service Account
afa71cb2a8 Merge "msm: mdss: Avoid dfps update till unblank is complete" 2017-05-27 18:11:58 -07:00
Linux Build Service Account
7681397f8a Merge "msm: mdss: Update AD last strength during AD mode switch" 2017-05-27 18:11:57 -07:00
Linux Build Service Account
50fbdbba86 Merge "msm: mdss: Use 64-bit math for bandwidth calculation" 2017-05-27 18:11:56 -07:00
Linux Build Service Account
c68f15ba45 Merge "msm: mdss: do not apply AVMUTE for non-CTA format" 2017-05-27 18:11:52 -07:00
Linux Build Service Account
2859a4d703 Merge "msm: mdss: Correct source and destination buffer rectangles" 2017-05-27 18:11:51 -07:00
Linux Build Service Account
bf485cf86c Merge "msm: mdss: dp: fix display port crash caused by unclocked register access" 2017-05-27 18:11:50 -07:00
Benjamin Chan
792e8b4003 msm: mdss: Fix QSEED3 MDP clock calculation for cmd mode panel
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>
2017-05-26 14:10:31 -04:00
Casey Piper
d12c004a31 msm: mdss: update polarity based on HDMI resolution
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>
2017-05-24 15:13:42 +08:00
Ashish Garg
5d1a271056 msm: mdss: ensure clocks are on till pixel transfer is completed
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>
2017-05-23 18:38:25 +05:30