Commit Graph

364 Commits

Author SHA1 Message Date
f6b3131538 MLK-19485 drm/bridge: it6263: Change LVDS I2C device to be dummy
The it6263 bridge contains two I2C devices on the same I2C bus
to control HDMI and LVDS modules respectively.  However, they
have different I2C addresses.  Thus, one of the two devices should
be registered as dummy device and bound with dummy driver.  This
is what the helper i2c_new_dummy() is designed for.  The HDMI I2C
device is normally registered as a real I2C device and bound with
a real driver, so the LVDS I2C device should be dummy.

This patch fixes the issue to access the LVDS I2C device's sys nodes,
like /sys/kernel/debug/regmap/2-0033/name.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:49 +08:00
da62aec92a MLK-19010: drm/bridge: nwl-dsi: Fix DSI long read
On the long read routine, there was a bug when the driver was parsing
the value from RX_PAYLOAD register.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:33:33 +08:00
9f89a46266 MLK-19082 drm/bridge: sec-dsim: wait 'ph_tx_done' for long packet send
According to a lot of tests, for long packet send, the packet
payload transfer done interrupt will be triggered no later than
the packet header transfer done interrupt. So, to make sure the
long packet has been send to the peripheral completely, wait
'ph_tx_done' interrupt instead of 'pl_tx_done' for long packet
transfer. Otherwise it may cause subsequent packet transfer
failed sometimes.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 69a5f44025c6ecb2fee16c1650a81198b501f284)
2019-02-12 10:33:02 +08:00
1f80017f23 MLK-19017-5 drm/imx: add DISPMIX power domain support for SEC DSIM
After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the SEC DSIM de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe bind anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7a7f17f5fb66135629ef20a2b4780dfef2f0f0ce)
2019-02-12 10:33:01 +08:00
b43c58d9e0 MLK-18605-10 drm/bridge: sec-dsim: complete mipi panel support
This patch adds mipi panel enable/disable during the dsim
bridge enable/disable procedure and implements required
callbacks and helper functions for dsi panel peripheral
support.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 4ef0a4e4ba0faca91e5b556fd13483aafdb64519)
2019-02-12 10:33:00 +08:00
cf7e6fc89b MLK-18605-9 drm/bridge: sec-dsim: increase timeout values for BTA and LPRX
The current timeout values for 'BTA' and 'LPRX' in register
'DSIM_TIMEOUT' is not long enough for some dsi peripherals,
so increase them long enough for all current peripherals to
avoid timeout errors generation in some cases.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8e2b86b317382635e74002a5b2a466804247e61a)
2019-02-12 10:33:00 +08:00
4b907a3283 MLK-18605-8 drm/bridge: sec-dsim: add non-continuous clock support
Complete the non-continuous clock mode support.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit cd216df51f322434e45d12b6721637f1d8159fe4)
2019-02-12 10:32:59 +08:00
3f20acbee9 MLK-18605-7 drm/bridge: sec-dsim: correct a register macro misspelt
The macro 'CONFIG_NON_CONTINUOUS_CLOCK_LANE' has been misspelt
to 'CONFIG_NON_CONTINOUS_CLOCK_LANE'. So correct it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 24a05825b7299fc2f60768468fafbbc9a33804ad)
2019-02-12 10:32:59 +08:00
1c9d8b1cce MLK-18605-6 drm/bridge: sec-dsim: add fifo pointers initialization
All the DSIM fifo pointers should be better to be put into the
initialized state before enabling DSIM to transfer commands or
data.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 1c1624e48c83623a538f4af862367e6b3cbf8d67)
2019-02-12 10:32:59 +08:00
0d65374968 MLK-18605-5 drm/bridge: sec-dsim: correct 'DSIM_FIFOCTRL' offset
According to the DSIM specification, the 'DSIM_FIFOCTRL'
register addr offset should be '0x4c' instead of '0x48'.
So correct it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 31850816f3aea109aff6c4bbcb44221e7d74afb5)
2019-02-12 10:32:59 +08:00
6281e4f4b6 MLK-18605-4 drm/bridge: sec-dsim: refine data lanes stop state check
When the attached dsi device does not use all the data lanes
to transfer data, data lanes stop state check should only
check the lanes used precisely, since unused lanes state is
not guaranteed to be in some stable state.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6787ee8505ab16bf7bba38c721da0bfa87e9de0e)
2019-02-12 10:32:59 +08:00
9ef87498c5 MLK-18605-3 drm/bridge: sec-dsim: refuse unknown dsi device attach
When a dsi device who is neither a bridge nor a panel requests
to be attached to the host, refuse this request directly.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 2e80acc8a611327fcc77d2e73515bc062cdc4233)
2019-02-12 10:32:59 +08:00
75f65aebfd MLK-18605-2 drm/bridge: sec-dsim: allow same panel can be re-attached
During the mode set procedure, some dsi client device may detach
itself first and then attach it again according to the target
display mode parameters. In this case, the dsi client device
should be allowed to be re-attached again. So this is also true
for panel device.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f586625dd1a665c58b976405c7980b7414554481)
2019-02-12 10:32:59 +08:00
0b78ed9b7c MLK-18605-1 drm/bridge: sec-dsim: add cleanup when detach dsi client
When the dsi device is detached, the dsi parameters saved when
the dsi device is attached should be cleaned to avoid to be
misused. And besides, add some sanity check along with this
cleanup.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a02c30a0ed8acc4a136d2281431fa4b07d66b933)
2019-02-12 10:32:58 +08:00
e04e4d286a MLK-19081 drm/bridge: sec-dsim: correct args of 'drm_bridge_attach' call
Obviously, according to the drm_bridge_attach()'s definition,
the passing arguments of its function call should be corrected
here.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-02-12 10:32:58 +08:00
a2619a1333 MLK-18850: drm/bridge: nwl-dsi: Fix bridge handling
When the drm_bridge object, representing the next bridge in chain,
connected to nwl-dsi brigde was attached to encoder, the
"previous_bridge" was wrongly passed, this way the next bridge was not
actually added to the encoder bridge chain.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:32:39 +08:00
412c737b80 MLK-18877-1: drm/bridge: adv7511: Add debug info for HPD event
Add debug information for the HDP event catched with i2c interrupt.
Also, simplify the code in adv7511_hpd_work.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:32:39 +08:00
20e29dd988 MLK-18507 drm/bridge: it6263: Filter out known bad display modes
It turns out the following display modes are not well supported
by the bridge - 1600x900@60, 1280x1024@60, 1280x720@30/25/24
and 1152x864@75.  Fortunately, they are not that widely used.
So, list them as the known bad display modes and filter them out
in ->mode_valid().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit c44ed03cf3b85d7f5bc8325ffeec9fd07f66aa87)
2019-02-12 10:32:15 +08:00
ffff698815 MLK-18543-1: drm/bridge: nwl-dsi: Add pm_runtime support
Add support for pm_runtime, so that the assigned power domain state will be
changed accordingly.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:32:12 +08:00
941ef8c5fc MLK-18535-8 drm/imx: sec_mipi_dsim-imx: add DSIM host driver
The Samsung DSIM host driver mainly focuses on the config
related with soc platforms. And the controller itself config
has been moved to the sec-dsim bridge driver.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-02-12 10:32:06 +08:00
beb9d163c7 MLK-18535-7 drm/bridge: sec-dsim: add bridge driver support
This is the abstracted bridge driver for Samsung MIPI DSIM
controller. This driver only foucses on the DSIM controller
itself configurations and never care about any config about
the platforms. So it can be shared by different platforms
without any modifications.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-02-12 10:32:06 +08:00
d13b9be310 MLK-18357-2: drm/bridge: nwl-dsi: Add no_clk_reset property
On some platforms, like the i.MX8M, the Display Controller is not
completely powered off during suspend, just stopped. Since there are
problems if we stop the clocks in DSI sub-system, while the Display
Controller is still powered on, the display clocks will get out of sync.
Adding this new property to specify, on such platforms, not to reset the
clocks.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:31:49 +08:00
699ccad27c MLK-18297 drm/bridge: it6263: Sleep between status reads in connector detect
There are some issues with the HDMI connection on it6263 being slow to
come up. There is a hack there which reads the register multiple times
but it doesn't seem to be sufficient. This is particularly a problem
when inside a xen guest.

Improve this workaround by reading the status multiple times every few
5-10ms and returning connector_status_connected if any of those reads
sees HPDETECT.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-02-12 10:31:44 +08:00
4ef91335c3 MLK-17589: gpu/imx: Fix DCSS+DSI suspend/resume
Since the DCSS is not fully powered off when a suspend/blank occurs, the
next time we resume/unblank, the DCSS->DSI pipeline cannot be fully
re-initialized. In order to fix this issue, we should also not
completely power off the DSI too. Just configure it to stop
transmitting, by powering off the PHY.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:31:24 +08:00
05ad7bb97e MLK-18177-2: drm/bridge: nwl-dsi: Change init sequence for panel
Currently, the DSI panel init sequence is made in the prepare function,
right after the reset pin is asserted. This implies that at this moment,
the DSI host needs to be enabled. If the DSI host is enabled during
panel prepare, there will be DSI signal on the DSI lanes during the
panel reset, which is wrong.

In order to fix this, the init sequence was moved from prepare to
enable, while the reset sequence is made in prepare. Also, the DSI host
intialization has to be updated in such a way that the host won't send
DSI signals on the lanes between the prepare and enable of the panel.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:31:23 +08:00
45f8c8d774 MLK-18106: drm/bridge: Fix nwl-dsi bridge handling
Since the drm_bridge_attach function now supports chained bridges, there
is no need for nwl_dsi_add_bridge and nwl_dsi_del_bridge functions, so
remove them.
Now, we can pass the existent bridge to drm_bridge_attach.

This fixes a bug created during kernel 4.14 rebase process.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:31:17 +08:00
9fb65873a7 MLK-17684: drm/bridge: nwl-dsi: Propagate DSI format to the attached panel/bridge
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:31:04 +08:00
c0c71b7945 MLK-17684-2: drm/bridge: nwl-dsi: Let CRTC dictate the final bus format
Use the bus format that was established by CRTC in
crtc->mode.private_flags.
This will be available during enable phase.

The DSI host will be configured via interface_color_coding
and pixel_format (DPI-2 interface ports).
Previously the interface_color_coding was hardcoded to 24-bit.

Set the DSI pixel format before it is necessary in
nwl_dsi_get_bit_clock, during imx_nwl_dsi_enable.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
2019-02-12 10:30:57 +08:00
822b5037d4 MLK-17650-1: drm/bridge: adv7511: Add support for programmable i2c addresses
The DSI-HDMI converter, ADV7535, driver uses four i2c memory maps: MAIN,
DSI-CEC, EDID and PACKET.
While the MAIN address is hard-coded in the ROM chip, the other three
can be programmed into the MAIN memory map.
Currently, the three memory maps addresses, that can be programmed, are
hard-coded into the code.
In order to avoid conflicts with other i2c clients on the bus, update
the driver to use configurable addresses specified in DTS file.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:30:47 +08:00
d2f78acacc MLK-17275-7: drm/bridge: adv7511: Add dsi-channel property
Add a new property "adi,dsi-channel" to allow the user specify the DSI
channel to be used when communicating with DSI peripheral.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:30:09 +08:00
31e727638b MLK-17275-3: drm/bridge: nwl-dsi: Fix remove/detach
Add a check in detach function, so that the mipi_dsi_host_unregister
will occur only if the host was registered.
Also, remove the unnecessary calls to host_unregister from probe and
remove functions.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:30:09 +08:00
de618474e2 MLK-17275-2: drm/bridge: it6263: Add support for OF_DYNAMIC
When CONFIG_OF_DYNAMIC is used, and this driver is enabled in
devicetree, but fails to probe a physical i2c client, it should disable
it's remote endpoint, so that the DRM master device won't fail to bind
the other available devices.
Usually, the remote endpoint of this device is a DRM encoder. If a DRM
encoder fails to bind, the DRM master device will also fail to bind.
This is why, we should disable the encoder node dynamically in
devicetree.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:30:09 +08:00
47d6032375 MLK-17275-1: drm/bridge: adv7511: Add support for OF_DYNAMIC
When CONFIG_OF_DYNAMIC is used, and this driver is enabled in
devicetree, but fails to probe a physical i2c client, it should disable
it's remote endpoint, so that the DRM master device won't fail to bind
the other available devices.
Usually, the remote endpoint of this device is a DRM encoder. If a DRM
encoder fails to bind, the DRM master device will also fail to bind.
This is why, we should disable the encoder node dynamically in
devicetree.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:30:09 +08:00
89db6d4d6c MLK-17290-03 drm/bridge: request/free irq in dynamical
Request/free irq in dynamical can runtime manage the irq domain's
clock and power if irq domain support runtime pm and manage its
clock in its pm callback.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Tested-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Acked-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:30:02 +08:00
df4deb3525 MLK-17137-2: drm/bridge: Fix bridge_detach for nwl-dsi
When the bridge is detached from it's parent, we also need to unregister
the dsi_host. Also, in enable, check if we have a panel or a bridge
connected, otherwise enable is not needed.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:29:51 +08:00
fab74d5cf6 MLK-16986-4: drm: bridge: adv7511: set bus_flags and bus_format
For a proper initialization of the crtc driving the connector for this
bridge, we need to set the bus_formats and bus_flags of the connector's
display_info.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2019-02-12 10:29:38 +08:00
c71bb7a1e4 MLK-16918-15: drm/bridge: Update adv7511 driver with some regs for adv7535
The low refresh rate register for ADV7535 is in 0x4A instead of 0xFB. In
order to correctly handle these differences, add the new type ADV7535.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:29:22 +08:00
be71ddf1ea MLK-16918-5: drm: Implement NWL MIPI-DSI as a real drm_bridge
Currently, the Northwest Logic MIPI-DSI controller host specific code
resides under drm/bridge, but is not a real drm_bridge. It creates a
drm_bridge and adds itself to the drm_encoder that handles this file,
but this is wrong, since it does not implement the drm_bridge_funcs.

The correct way to implement a drm_bridge is to add the drm_bridge and
let other components (another bridge or a drm_encoder) to attach to this
bridge.
Since we are doing this, a new compatible strings can be used for this
driver: "nwl,mipi-dsi".

Since this was used by nwl_dsi-imx.c, update that driver to use this
bridge correctly.

This is needed in order to add support for MIPI-DSI on 8MQ. The IMX_NWL
driver will either add a DSI encoder to DRM, or a DSI bridge.
The encoder will be used by imx-drm-core driver, while the bridge
will be used by MXSFB driver (which creates a simple display pipe).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:29:20 +08:00
7576386df9 MLK-16347-6: gpu: drm: bridge: adv7511: Add new compatible string
Added "adi,adv7535" to the adv7511 drm bridge and adi,adv7511.txt doc,
since the driver can also support the ADV7535 chipset (upgrade of ADV7533).

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:29:04 +08:00
abc53aaea6 MLK-16347-3: drm/bridge: Add Northwest Logic DSI transmitter support
Add support for the NorthWest Logit MIPI-DSI controller found in mx8
platforms: i.MX8qm, i.MX8qxp and i.MX8mq.
The NWL MIPI-DSI driver is implemented as a DRM bridge.
The MIPI-DSI encoder will contain the platform specific changes and will
use this bridge.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2019-02-12 10:29:03 +08:00
c1f73434f6 MLK-16524 drm/bridge: it6263: Fix incorrect colors
This addresses a problem with colors that are sometimes incorrect after
startup. Now the AVI packet is initialized with RGB color space rather
than relying on the default.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2019-02-12 10:28:35 +08:00
3522359b02 MLK-16240 drm/bridge: it6263: Don't use freed edid structure in ->get_modes()
We call the helper drm_detect_hdmi_monitor() to check if the EDID blob read
from a monitor indicates the monitor is connected via HDMI or not.  We pass
an edid structure to the helper.  However, the structure has been freed
before we use it.  This patch moves the helper up before the structure is
freed to fix the issue.

Fixes: a5c01aa91842 ("MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:28:13 +08:00
5ac4dfb7b6 MLK-16207-2 drm/bridge: it6263: 2nd time to workaround cable detection failure
There is cable detection failure issue on i.MX8qxp MEK platform at boot
time when we use single LVDS to HDMI display.  The workaround is to read
the cable detection status for even more times.  Based on experiments, it
looks reading for 90 times works.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:28:06 +08:00
2e120abcef MLK-16207-1 drm/bridge: it6263: Add gpio reset support
A low pulse whose width is at least 40ms on pin SYSRSTN
may reset the bridge, according to the chip maker.
This patch adds gpio reset support for the bridge.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:28:06 +08:00
fb719c95e4 MLK-16183 drm/bridge: it6263: Workaround cable detection failure at boot time
There is cable detection failure issue on i.MX8qxp arm2 platform
at boot time when we avoid imx-drm deferral probe entirely(i2c
bus driver probe needs to be before the it6263 driver probe).
The workaround is to read the cable detection status multiple
times.  Based on experiments, it looks reading for 40 times works.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:28:00 +08:00
bf1acefa6e MLK-15001-25 drm/bridge: Add ITE IT6263 LVDS to HDMI transmitter support
This patch adds IT6263 video support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:26:54 +08:00
384f0d9fe4 drm/bridge: adv7511: Reset registers on hotplug
[ Upstream commit 5f34175691 ]

The bridge loses its hw state when the cable is unplugged. If we detect
this case in the hpd handler, reset its state.

Reported-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703165648.120401-1-seanpaul@chromium.org
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-05 09:26:24 +02:00
bf030b2faa drm/bridge/sii8620: Fix display of packed pixel modes
[ Upstream commit fdddc65ab3 ]

Current implementation does not guarantee packed pixel modes working
with every dongle. There are some dongles, which require selecting
the output mode explicitly.

Write proper values to registers in packed_pixel mode, based on how it
is done in vendor's code. Select output color space: RGB
(no packed pixel) or YCBCR422 (packed pixel).

This reverts commit e8b92efa62
("drm/bridge/sii8620: fix display of packed pixel modes in MHL2").

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1530204243-6370-3-git-send-email-m.purski@samsung.com
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:09:12 +02:00
097a82cb1a drm/bridge/sii8620: fix display of packed pixel modes in MHL2
[ Upstream commit e8b92efa62 ]

Currently packed pixel modes in MHL2 can't be displayed. The device
automatically recognizes output format, so setting format other than
RGB causes failure. Fix it by writing proper values to registers.

Tested on MHL1 and MHL2 using various vendors' dongles both in
DVI and HDMI mode.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1516706239-9104-1-git-send-email-m.purski@samsung.com
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:09:03 +02:00
c170373c72 drm/bridge/sii8620: fix potential buffer overflow
[ Upstream commit 9378cecb1c ]

Buffer overflow error should not occur, as mode_fixup() callback
filters pixel clock value and it should never exceed 600000. However,
current implementation is not obviously safe and relies on
implementation of mode_fixup().

Make 'i' variable never reach unsafe value in order to avoid buffer
overflow error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: bf1722ca ("drm/bridge/sii8620: rewrite hdmi start sequence")
Signed-off-by: Maciej Purski <m.purski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1511341718-6974-1-git-send-email-m.purski@samsung.com
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24 13:08:56 +02:00