As part of destination scalar on HDMI, INTF3 will be
configured as dual LM single display for higher video
timings. Assign block_id for HDMI INTF.
Change-Id: I09f5eb4136c4a8248f3dc9a36e2d94110419112d
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
Sanitize debugfs inputs to only allow access to mdp memory block
specified in dtsi file. This change will allow only one single block
to be read at the time and will avoid accessing memory outside of valid
decode space which can trigger AHB error bus response.
Change-Id: Icede9a8939a66faa59d674c18183fb0ebcf67908
Signed-off-by: Amine Najahi <anajahi@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>
In bandwidth limit read function, 'buf' array
elements might be used uninitialized. Ensure
the array elements are initialized.
Change-Id: I210c73b14327436296a844fc5ebd47ccc02bf5fb
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Add support to dump dsi debug bus registers to memory
or print in xlog. This will be helpful in analyzing HW
behavior more precisely while debugging DSI stability
issues.
Change-Id: I7735897d9f24ca06e15015cf0d277bfe800b35bf
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Fix race condition in the release of the mdp debugfs functions
panel_debug_base_release and mdss_debug_base_release by adding
the lock for unpreempted freeing of the buffer so that multiple
concurrent processes cannot affect the release which can possibly
lead to use-after-free operation on the buffer.
Change-Id: I9586081b65ae2eb0e7f6e30c606ee748ae9ef7e8
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Fix race condition in mdp debugfs properties
during the read and write of the panel and
mdp registers. This race condition can cause
accessing memory out bounderies.
Change-Id: I97a90a154237343d4aaf237c11f525bcc2c3a8e3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Add MDSS version info along with other capabilities
for sdm630.
Change-Id: Ia34831b56c1ca32d17b56e6030c847b629a13a0b
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Add MDSS version info along with other capabilities
for msmfalcon.
Change-Id: Ide652165711eec23644d36837f3847d896293709
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
The panel_reg_buf is a dynamically allocated buffer of size reg_buf_len
so checking sizeof(panel_reg_buf) is incorrect. Using scnprintf will
ensure that len is at most reg_buf_len - 1 after all the prints. This
allows sanity checks to be removed which were incorrectly skipping
clock disable, resulting in an extra clock reference count.
Change-Id: Ic3bb685c7b83eefef7bc207ad93d6a2a9e36fd33
Signed-off-by: Patrick Auchter <auchter@motorola.com>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
(cherry picked from commit 89bede0751357bc24701b8ebfe326d3e6bb46683)
- Before reading from new offset in a buffer, check for out
of bounds condition.
- Avoid using '%n' specifier.
- Use kstrtouint() instead of single variable sscanf
as per coding guidelines.
Change-Id: I10ea6f2b22d554d02f302f5700f6674d08e4777d
Signed-off-by: Krishna Srinivas <krisrini@codeaurora.org>
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
In many parts of the code the sscanf function was getting
an unsigned integer with a wrong format specifier. Changed
the format specifiers appropriately. Single variable sscanf
are replaced by kstrtouint at reported places.
CRs-Fixed: 1024872
Change-Id: I03ce718b0456d437d31d701586965d0aa7443b51
Signed-off-by: Shalini Krishnamoorthi <shakri@codeaurora.org>
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
msmcobalt has a different command mode MISR CRC register offset. Correct
the offset for the MISR control and signature registers, and correct the
block_id by lookup the INTF number from CTL.
CRs-Fixed: 1049910
Change-Id: If4fb44d217ed84067a0732334523ddb1e435e4e7
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
for printing kernel pointers which should be hidden from unprivileged
users, use %pK which evaluates whether kptr_restrict is set.
CRs-Fixed: 987021
Change-Id: Ie49eee9478f4657cfb2a994ba60da1ec4c356339
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
There are few cases where the count argument passed by the user
space is not validated, which can potentially lead to out of bounds
or overflow issues. In some cases, kernel might copy more data than
what is requested. Add necessary checks to avoid such cases.
Change-Id: Ifa42fbd475665a0ca581c907ce5432584ea0e7ed
[veeras@codeaurora.org: Resolve conflicts in mdss_debug.c]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
DISPLAY_MISR_LCDC block doesn't have corresponding mdss_mdp_misr_table,
this change corrects the block id check for mdss_mdp_misr_table.
CRs-Fixed: 1001224
Change-Id: I74b03c31542d4b239eb2ffdc4dc6345dff5eab86
Signed-off-by: Ping Li <pingli@codeaurora.org>
Smmu context fault handler provides the fault iova
information but does not provide any information about
xin client. This patch registers the context fault
handler in MDSS software to get the vmid/xin client
information. It also dumps the registers for source
associated with respective vmid client
Change-Id: I2a833a4b5e81e36f4d7af23a3968c9755424b7a7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This change add a sysfs node to enable the misr crc generation
in batch mode. Once this is enabled, driver will collect the
crc numbers during each of the interfaces interrupt,
vsync interrupt for video mode panels and ping pong done
for cmd mode panels.
To enable/disable the crc generation, respectively:
echo 1 > /sys/class/graphics/fb0/msm_misr_en
echo 0 > /sys/class/graphics/fb0/msm_misr_en
To collect the last crc generated:
cat /sys/class/graphics/fb0/msm_misr_en
To enable the ftrace to collect the crc for all frames:
echo 1 > <debugfs>/tracing/events/mdss/mdp_misr_crc/enable
CRs-Fixed: 964076
Change-Id: I47fb47b772aef097bc9af3b58a6c79565bcdc872
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Set the correct offsets of the MISR for command mode
interfaces in 8996.
CRs-Fixed: 964076
Change-Id: I90c7fa1ff144ae547cc0537421211a73051f1036
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
If control setup is not done and if userspace calls misr set
via metadata ioctl, then there can be a potential NULL pointer
deference as mixer might be NULL. Add a check to validate if
mixer is not NULL.
Change-Id: I92f5778788cfcce6fa01a038b4321222a8804f28
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Register debugfs node to read from and write to the panel command
data type. The default data type is DCS_LONG_WRITE 0x39.
Give following command in adb shell to read panel register:
cat /sys/kernel/debug/mdp/panel_cmd_data_type
To write panel command data type:
echo "command_data_type" >
/sys/kernel/debug/mdp/panel_cmd_data_type
Change-Id: I6dbe5bccb3142e93400825eddf7f05180acfc710
Signed-off-by: Yang Xu <yangxu@codeaurora.org>
Allocate buffer for panel register results, which is
to support any length of register reading request.
Change-Id: I67905b3771ecfe5d56fe29928b2953b8435f1d71
Signed-off-by: Yang Xu <yangxu@codeaurora.org>
Fix crash when read the perf_mode debugfs property
that was accessing memory beyond the size of the
array.
Change-Id: I82c6aaf263ea9f688856eade009008c10ec65e36
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Additional offset is needed for MISR CTRL and SIGNATURE
registers on 8952. Add the required offset of 0x10.
Also add logic to select appropriate registers for video
and command mode.
Change-Id: I148200bdac98dfb446d7958ab700ed221e3d48d0
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
Fix to initialize the nodes added by the panel
data dump to the xlog linked list.
This resolves a crash when runtime dumping
the registers through xlog with the dump
debugfs node:
echo 1 > /d/mdp/xlog/dump
Change-Id: I2a7222bd10e5d5a53b20472fbfbc3db818897515
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Assertive display block can be configured in auto trigger mode,
which removes the requirement of issuing a start calculation
command. Change updates the ad calc worker to remove the kick off
of AD for each vsync and auto trigger mode is made the default mode.
Change-Id: Ie898a595cc9d3c8e521fffc8b3cde240dcbdce0e
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Starting with 8996 chipset, qos settings can be adjusted
to be different during vblank. This change adds support
for this feature.
Change-Id: Ifa25dd799a55396224f49c49a29fcc8f5a245bd0
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
During blending operation, bottom color is known as border color and it
is same size as mixer dimensions. Default color is black but it can be
configured to different color. This is very useful for debugging purpose.
Add support to program border-color through debugfs as per following
guidelines.
echo code > <debugfs>/mdp/bordercolor/colorN
where
code: 12bit color value in decimal
colorN: color0, color1, color2
Change-Id: Ia3e8791713f5aa309a95c867445995ced028dd8d
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Currently there are two different data structure representing
multiplication factors. Replace internal one, mdss_fudge_factor, and
with the one shared with user-space, mult_factor.
Change-Id: I9e0dcc092b4f9033cbfcd7e185e642c922e29a27
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Based on various use-cases such as camera and flip, MDP bandwidth
limit can be changed. For debug purpose add support to change
these paramaters via debugfs. First parameter takes mode and
second paramter takes bandwidth limit for that particular mode.
E.g. echo 2 1700000 > <debugfs>/mdp/perf/threshold_bw_limit
Change-Id: I98456f4f00223136628b2d2300b5785af386b134
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Remove extra print for function name in debug module.
Change-Id: Ic7327bcedb2254b2bc4b7655138289a19605f935
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Register debugfs nodes to read from and write to the LCM registers.
Give following command in adb shell to read panel register:
echo address feedback_count > /d/mdp/panel_off
cat /d/mdp/panel_reg
To write panel register:
echo address value > /d/mdp/panel_reg
Change-Id: I9ef9fb57dc1b7dea42c7e701c60018f7946ee75b
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Current xlog dumps the entire registers ranges
mapped in memory. This entire range can be
reduced to only the meaningful offsets to help in
debugging and avoid overflows in the debug buffers.
This change adds support to only dump the registers
ranges specified.
Change-Id: Iecf7f5eaa909b0365ea599ae094c7f184c0ae8b8
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
(cherry picked from commit 899cf5dbc528b13bd488038215356c5bea5b591c)
[veeras@codeaurora.org: Resolve merge conflict in mdss_dsi.c]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
reg dump func is specifically used by xlog, so it should be static in
xlog file.
Change-Id: I14570e174b215d7ea5f77f0b333f65956b549222
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Starting in MDPv1.7, configuration of the panic signal
is per pipe. This needs some specific luts to be
programmed on each pipe. Adding support to configure
these luts, which are enabled and tuned through
device tree.
Change-Id: I8af08e8458f8136e9767ccfea27489ce2976a437
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Add MDSS version check and enable MISR free run mode.
Change-Id: I8a07ff5926eb82f1ac27851d16400570c017485c
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
MDPv1.5 and MDPv1.8 has danger safe LUTs and control setting
register under MDP register space. These LUTs and control
settings can be different for each pipe for MDPv1.7. It makes
"panic-ctrl-offsets" configuration also optional for VIG, RGB
and DMA pipes. This change handles the danger safe signal
programming for such MDP version.
Change-Id: Icf0e4a732d7372493d1166579b90a7c2df7ae126
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Use Interface or Writeback layer mixer MISR for Writeback CRC
capture and remove to avoid underrun during primary
and HDMI CRC capture in case of timeout.
Change-Id: I78e51fd28fb0157864a7a350cc652a917cc66347
Signed-off-by: Anusha Koduru <kanusha@codeaurora.org>
Modify watermark levels and prefill BW calculation
to be set based on the minimum prefill buffer bytes from
the SMP. Add debugfs property to dynamically tune the minimum
bytes for debugging.
Change-Id: I3af1e3468eaab56d3a8eea5fe456d7af547d3244
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
For rotator path, display driver can release the rotator
bandwidth once the rotator finished processing. In some
scenarios this results in more power consumption since more
interrupts are generated to release the bandwidth.
This change disables the bandwidth release for the rotator path
and add a debugfs node to dynamically enable the feature if
needed.
To enable the bw release for rotator:
echo 1 > "<debugfs>/mdp/perf/enable_rotator_bw_release"
To disable the bw release for rotator (default):
echo 0 > "<debugfs>/mdp/perf/enable_rotator_bw_release"
Change-Id: If147b8fb202edcb389fe85e78f8d61d2a98cef95
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
[cip@codeaurora.org: Use debugfs_create_u32 for
enable_rotator_bw_release debugfs]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
For command mode panels, driver can release the bandwidth once
the frame is transferred to the panel and no more processing is
done in the display driver; in some scenarios this results in
more power consumption since more interrupts are generated.
This change disables the bandwidth release for command mode panels
and add a debugfs node to dynamically enable the feature if needed
for debugging purposes.
To enable the bw release:
echo 1 > "<debugfs>/mdp/perf/enable_bw_release"
To disable the bw release (default):
echo 0 > "<debugfs>/mdp/perf/enable_bw_release"
Change-Id: I61670606f1cf52b8d889678e6ffe7d0e911771e7
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
[cip@codeaurora.org: Create u32 debugfs for enable_bw_release]
Signed-off-by: Clarence Ip <cip@codeaurora.org>