Jagan Teki
1d0b536304
drm: bridge: mtk_dsi: Switch to devm_drm_of_get_bridge
...
devm_drm_of_get_bridge is capable of looking up the downstream
bridge and panel and trying to add a panel bridge if the panel
is found.
Replace explicit finding calls with devm_drm_of_get_bridge.
Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Reviewed-by: Robert Foss <robert.foss@linaro.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-3-jagan@amarulasolutions.com
2022-03-31 17:52:47 +02:00
Jagan Teki
4f4601071c
drm: bridge: nwl-dsi: Switch to devm_drm_of_get_bridge
...
devm_drm_of_get_bridge is capable of looking up the downstream
bridge and panel and trying to add a panel bridge if the panel
is found.
Replace explicit finding calls with devm_drm_of_get_bridge.
Reviewed-by: Guido Günther <agx@sigxcpu.org >
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-2-jagan@amarulasolutions.com
2022-03-31 17:52:46 +02:00
Jagan Teki
65af9070cd
Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices"
...
This reverts commit c206c7faeb .
In order to avoid any probe ordering issues, the I2C based downstream
bridge drivers now register and attach the DSI devices at the probe
instead of doing it on drm_bridge_function.attach().
Examples of those commits are:
commit <6ef7ee48765f> ("drm/bridge: sn65dsi83: Register and attach our
DSI device at probe")
commit <d89078c37b10> ("drm/bridge: lt8912b: Register and attach our DSI
device at probe")
commit <864c49a31d6b> ("drm/bridge: adv7511: Register and attach our DSI
device at probe")
dw-mipi-dsi has panel or bridge finding code based on previous downstream
bridges, so revert the same and make the panel or bridge funding in host
attach as before.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-1-jagan@amarulasolutions.com
2022-03-31 17:52:44 +02:00
Marek Vasut
ee2f7c9d87
drm/bridge: lt9611: Add atomic_get_input_bus_fmts
...
Implement .atomic_get_input_bus_fmts callback, which sets up
the input (scanout-engine-end) formats, so that those formats
can then be used in pipeline format negotiation between this
bridge and the scanout engine.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Dave Airlie <airlied@redhat.com >
Cc: John Stultz <john.stultz@linaro.org >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331153923.14314-2-marex@denx.de
2022-03-31 17:43:28 +02:00
Marek Vasut
97d7ca798a
drm/bridge: lt9611: Switch to atomic operations
...
Use the atomic version of the enable/disable operations to continue the
transition to the atomic API. This will be needed to access the mode
from the atomic state.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Dave Airlie <airlied@redhat.com >
Cc: John Stultz <john.stultz@linaro.org >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331153923.14314-1-marex@denx.de
2022-03-31 17:43:27 +02:00
Marek Vasut
85854fa959
drm/bridge: ti-sn65dsi83: Check link status register after enabling the bridge
...
In rare cases, the bridge may not start up correctly, which usually
leads to no display output. In case this happens, warn about it in
the kernel log.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Linus Walleij <linus.walleij@linaro.org >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220213022648.495895-1-marex@denx.de
2022-03-31 17:31:48 +02:00
Marek Vasut
17a9c1aaa8
drm: bridge: icn6211: Read and validate chip IDs before configuration
...
Read out the Vendor/Chip/Version ID registers from the chip before
performing any configuration, and validate that the registers have
correct values. This is mostly a simple test whether DSI register
access does work, since that tends to be broken on various bridges.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-12-marex@denx.de
2022-03-31 17:20:46 +02:00
Marek Vasut
33f1036b78
drm: bridge: icn6211: Rework ICN6211_DSI to chipone_writeb()
...
Rename and inline macro ICN6211_DSI() into function chipone_writeb()
to keep all function names lower-case. No functional change.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-11-marex@denx.de
2022-03-31 17:20:45 +02:00
Marek Vasut
8dde6f7452
drm: bridge: icn6211: Add I2C configuration support
...
The ICN6211 chip starts in I2C configuration mode after cold boot.
Implement support for configuring the chip via I2C in addition to
the current DSI LP command mode configuration support. The later
seems to be available only on chips which have additional MCU on
the panel/bridge board which preconfigures the ICN6211, while the
I2C configuration mode added by this patch does not require any
such MCU.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-10-marex@denx.de
2022-03-31 17:20:44 +02:00
Marek Vasut
cda3822a5d
drm: bridge: icn6211: Implement atomic_get_input_bus_fmts
...
Implement .atomic_get_input_bus_fmts callback, which sets up the
input (DSI-end) format, and that format can then be used in pipeline
format negotiation between the DSI-end of this bridge and the other
component closer to the scanout engine.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-9-marex@denx.de
2022-03-31 17:20:43 +02:00
Marek Vasut
75122915db
drm: bridge: icn6211: Set SYS_CTRL_1 to value used in examples
...
Both example code [1], [2] as well as one provided by custom panel vendor
set register SYS_CTRL_1 to 0x88. What exactly does the value mean is unknown
due to unavailable datasheet. Align this register value with example code.
[1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c
[2] https://github.com/tdjastrzebski/ICN6211-Configurator
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-8-marex@denx.de
2022-03-31 17:20:41 +02:00
Marek Vasut
aedfd0b9ae
drm: bridge: icn6211: Disable DPI color swap
...
The chip is capable of swapping DPI RGB channels. The driver currently
does not implement support for this functionality. Write the MIPI_PN_SWAP
register to 0 to assure the color swap is disabled.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-7-marex@denx.de
2022-03-31 17:20:40 +02:00
Marek Vasut
00404824b8
drm: bridge: icn6211: Use DSI burst mode without EoT and with LP command mode
...
The DSI burst mode is more energy efficient than the DSI sync pulse mode,
make use of the burst mode since the chip supports it as well. Disable the
generation of EoT packet, the chip ignores it, so no point in emitting it.
Enable transmission of data in LP mode, otherwise register read via DSI
does not work with this chip.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-6-marex@denx.de
2022-03-31 17:20:39 +02:00
Marek Vasut
f30cf0ece6
drm: bridge: icn6211: Add generic DSI-to-DPI PLL configuration
...
The chip contains fractional PLL, however the driver currently hard-codes
one specific PLL setting. Implement generic PLL parameter calculation code,
so any DPI panel with arbitrary pixel clock can be attached to this bridge.
The datasheet for this bridge is not available, the PLL behavior has been
inferred from [1] and [2] and by analyzing the DPI pixel clock with scope.
The PLL limits might be wrong, but at least the calculated values match all
the example code available. This is better than one hard-coded pixel clock
value anyway.
[1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c
[2] https://github.com/tdjastrzebski/ICN6211-Configurator
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-5-marex@denx.de
2022-03-31 17:20:38 +02:00
Marek Vasut
2dff97f2b3
drm: bridge: icn6211: Add HS/VS/DE polarity handling
...
The driver currently hard-codes HS/VS polarity to active-low and DE to
active-high, which is not correct for a lot of supported DPI panels.
Add the missing mode flag handling for HS/VS/DE polarity.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-4-marex@denx.de
2022-03-31 17:20:37 +02:00
Marek Vasut
c0ff7a649d
drm: bridge: icn6211: Fix HFP_HSW_HBP_HI and HFP_MIN handling
...
The HFP_HSW_HBP_HI register must be programmed with 2 LSbits of each
Horizontal Front Porch/Sync/Back Porch. Currently the driver programs
this register to 0, which breaks displays with either value above 255.
The HFP_MIN register must be set to the same value as HFP_LI, otherwise
there is visible image distortion, usually in the form of missing lines
at the bottom of the panel.
Fix this by correctly programming the HFP_HSW_HBP_HI and HFP_MIN registers.
Acked-by: Maxime Ripard <maxime@cerno.tech >
Fixes: ce517f1894 ("drm: bridge: Add Chipone ICN6211 MIPI-DSI to RGB bridge")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-3-marex@denx.de
2022-03-31 17:20:35 +02:00
Marek Vasut
2dcec57b37
drm: bridge: icn6211: Fix register layout
...
The chip register layout has nothing to do with MIPI DCS, the registers
incorrectly marked as MIPI DCS in the driver are regular chip registers
often with completely different function.
Fill in the actual register names and bits from [1] and [2] and add the
entire register layout, since the documentation for this chip is hard to
come by.
[1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c
[2] https://github.com/tdjastrzebski/ICN6211-Configurator
Acked-by: Maxime Ripard <maxime@cerno.tech >
Fixes: ce517f1894 ("drm: bridge: Add Chipone ICN6211 MIPI-DSI to RGB bridge")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-2-marex@denx.de
2022-03-31 17:20:34 +02:00
Jagan Teki
95a2441e43
drm: exynos: dsi: Switch to atomic funcs
...
The new support drm bridges are moving towards atomic functions.
Replace atomic version of functions to continue the transition
to the atomic API.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-7-jagan@amarulasolutions.com
2022-03-31 16:21:42 +02:00
Jagan Teki
f9bfd326f5
drm: exynos: dsi: Convert to bridge driver
...
Convert the encoders to bridge drivers in order to standardize on
a single API with built-in dumb encoder support for compatibility
with existing component drivers.
Driver bridge conversion will help to reuse the same bridge on
different platforms as exynos dsi driver can be used as a Samsung
DSIM and use it for i.MX8MM platform.
Bridge conversion,
- Drops drm_encoder_helper_funcs.
- Adds drm_bridge_funcs and register a drm bridge.
- Drops bridge_chain.
- Separate pre_enable from enable function.
- Separate post_disable from disable function.
Convert it.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-6-jagan@amarulasolutions.com
2022-03-31 16:21:42 +02:00
Jagan Teki
711c7adc46
drm: exynos: dsi: Use drm panel_bridge API
...
Replace the manual panel handling code by a drm panel_bridge via
devm_drm_of_get_bridge().
Adding panel_bridge handling,
- Drops drm_connector and related operations as drm_bridge_attach
creates connector during attachment.
- Drops panel pointer and iterate the bridge, so-that it can operate
the normal bridge and panel_bridge in constitutive callbacks.
This simplifies the driver and allows all components in the display
pipeline to be treated as bridges.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-5-jagan@amarulasolutions.com
2022-03-31 16:21:41 +02:00
Jagan Teki
dd8b6803bc
exynos: drm: dsi: Attach in_bridge in MIC driver
...
MIC drivers in the Exynos5433 display pipeline are already registered
as bridge drivers and it is more advisable to attach the downstream
bridge on the bridge attach call instead of doing the same in the
DSI driver.
This makes bridge attachment more meaningful and avoids the races
during bridge function calls.
So, move the bridge finding and drm_bridge_attach from DSI to MIC.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-4-jagan@amarulasolutions.com
2022-03-31 16:21:41 +02:00
Jagan Teki
934aef885f
drm: bridge: panel: Reset the connector state pointer
...
Trigger hotplug event with drm_kms_helper_hotplug_event might fail if the
connector state pointer is NULL.
BUG observed in exynos dsi driver where drm_bridge_attach is trying to
register a connector in panel_bridge before the hotplug event is triggered.
WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_atomic_state_helper.c:494 drm_atomic_helper_connector_duplicate_state+0x94/0x9c
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.16.0-rc1-00009-g704b1dbfa4c2 #11058
Hardware name: Samsung Exynos (Flattened Device Tree)
[<c0110b30>] (unwind_backtrace) from [<c010c618>] (show_stack+0x10/0x14)
[<c010c618>] (show_stack) from [<c0b657d4>] (dump_stack_lvl+0x58/0x70)
[<c0b657d4>] (dump_stack_lvl) from [<c01261dc>] (__warn+0xd0/0x134)
[<c01261dc>] (__warn) from [<c0b5f628>] (warn_slowpath_fmt+0x5c/0xb4)
[<c0b5f628>] (warn_slowpath_fmt) from [<c064bce4>] (drm_atomic_helper_connector_duplicate_state+0x94/0x9c)
[<c064bce4>] (drm_atomic_helper_connector_duplicate_state) from [<c0666b64>] (drm_atomic_get_connector_state+0xd4/0x190)
[<c0666b64>] (drm_atomic_get_connector_state) from [<c0667928>] (__drm_atomic_helper_set_config+0x314/0x368)
[<c0667928>] (__drm_atomic_helper_set_config) from [<c067e628>] (drm_client_modeset_commit_atomic+0x170/0x278)
[<c067e628>] (drm_client_modeset_commit_atomic) from [<c067e800>] (drm_client_modeset_commit_locked+0x60/0x1c8)
[<c067e800>] (drm_client_modeset_commit_locked) from [<c067e98c>] (drm_client_modeset_commit+0x24/0x40)
[<c067e98c>] (drm_client_modeset_commit) from [<c06509c0>] (drm_fb_helper_set_par+0xb8/0xf8)
[<c06509c0>] (drm_fb_helper_set_par) from [<c05b86d0>] (fbcon_init+0x2c0/0x518)
[<c05b86d0>] (fbcon_init) from [<c060636c>] (visual_init+0xc0/0x108)
[<c060636c>] (visual_init) from [<c06085e4>] (do_bind_con_driver+0x1b8/0x3a4)
[<c06085e4>] (do_bind_con_driver) from [<c0608b40>] (do_take_over_console+0x13c/0x1e8)
[<c0608b40>] (do_take_over_console) from [<c05b6854>] (do_fbcon_takeover+0x78/0xd8)
[<c05b6854>] (do_fbcon_takeover) from [<c05b1154>] (register_framebuffer+0x208/0x2e0)
[<c05b1154>] (register_framebuffer) from [<c064ead0>] (__drm_fb_helper_initial_config_and_unlock+0x400/0x63c)
[<c064ead0>] (__drm_fb_helper_initial_config_and_unlock) from [<c063a718>] (drm_kms_helper_hotplug_event+0x24/0x30)
[<c063a718>] (drm_kms_helper_hotplug_event) from [<c068f668>] (exynos_dsi_host_attach+0x174/0x1fc)
[<c068f668>] (exynos_dsi_host_attach) from [<c0699354>] (s6e8aa0_probe+0x1b4/0x218)
So reset the atomic state for a given connector by freeing the state pointer
and allocate a new empty state object. This can be done using connector
funcs->reset helper and has to be done before the hotplug even calls.
This patch calls the connector->funcs->reset in panel_bridge_attach.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-3-jagan@amarulasolutions.com
2022-03-31 16:21:31 +02:00
Jagan Teki
b2831dd4be
drm: bridge: tc358764: Use drm panel_bridge API
...
Replace the manual panel handling code by a drm panel_bridge via
devm_drm_of_get_bridge().
Adding panel_bridge handling,
- Drops drm_connector and related operations as drm_bridge_attach
creates connector during attachment.
- Drops panel pointer and panel healpers.
This simplifies the driver and allows all components in the display
pipeline to be treated as bridges.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-2-jagan@amarulasolutions.com
2022-03-31 16:21:10 +02:00
Marek Vasut
bbfd3190b6
drm/bridge: tc358767: Add DSI-to-DPI mode support
...
The TC358767/TC358867/TC9595 are all capable of operating in multiple
modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Add support for the
DSI-to-DPI mode.
This requires skipping most of the (e)DP initialization code, which is
currently a large part of this driver, hence it is better to have far
simpler separate tc_dpi_bridge_funcs and their implementation.
The configuration of DPI output is also much simpler. The configuration
of the DSI input is rather similar to the other TC bridge chips.
The Pixel PLL in DPI output mode does not have the 65..150 MHz limitation
imposed on the (e)DP output mode, so this limitation is skipped to permit
operating panels with far slower pixel clock, even below 9 MHz. This mode
of operation of the PLL is valid and tested.
The detection of bridge mode is now added into tc_probe_bridge_mode(),
where in case a DPI panel is found on port@1 endpoint@1, the mode is
assumed to be DSI-to-DPI. If (e)DP is detected on port@2, the mode is
assumed to be DPI-to-(e)DP.
The DSI-to-(e)DP mode is not supported due to lack of proper hardware,
but this would be some sort of mix between the two aforementioned modes.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-12-marex@denx.de
2022-03-31 16:00:28 +02:00
Marek Vasut
aebe58a7af
drm/bridge: tc358767: Split tc_set_video_mode() into common and (e)DP part
...
The tc_set_video_mode() sets up both common and (e)DP video mode settings of
the bridge chip. Split the function into tc_set_common_video_mode() to set
the common settings and tc_set_edp_video_mode() to set the (e)DP specific
settings. No functional change.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-11-marex@denx.de
2022-03-31 15:59:15 +02:00
Marek Vasut
71f7d9c031
drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT
...
The TC358767/TC358867/TC9595 are all capable of operating in multiple
modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Only the first mode is
currently supported. It is possible to find out the mode in which the
bridge should be operated by testing connected endpoints in DT.
Port allocation:
port@0 - DSI input
port@1 - DPI input/output
port@2 - eDP output
Possible connections:
DPI -> port@1 -> port@2 -> eDP :: [port@0 is not connected]
DSI -> port@0 -> port@2 -> eDP :: [port@1 is not connected]
DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected]
Add function to determine the bridge mode based on connected endpoints.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-10-marex@denx.de
2022-03-31 15:59:13 +02:00
Marek Vasut
dd1fd5ab7c
drm/bridge: tc358767: Move bridge ops setup into tc_probe_edp_bridge_endpoint()
...
The bridge ops are specific to the bridge configuration, move them
into tc_probe_edp_bridge_endpoint() to permit cleaner addition of
DSI-to-DPI mode. No functional change.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-9-marex@denx.de
2022-03-31 15:59:10 +02:00
Marek Vasut
824c7bb46c
drm/bridge: tc358767: Wrap (e)DP aux I2C registration into tc_aux_link_setup()
...
This bit of code is (e)DP and aux I2C link specific, move it into
tc_aux_link_setup() to permit cleaner addition of DSI-to-DPI mode.
No functional change.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-8-marex@denx.de
2022-03-31 15:59:08 +02:00
Marek Vasut
8478095a8c
drm/bridge: tc358767: Move (e)DP bridge endpoint parsing into dedicated function
...
The TC358767/TC358867/TC9595 are all capable of operating in multiple
modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Only the first mode is
currently supported. In order to support the rest of the modes without
making the tc_probe() overly long, split the bridge endpoint parsing
into dedicated function, where the necessary logic to detect the bridge
mode based on which endpoints are connected, can be implemented.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-7-marex@denx.de
2022-03-31 15:59:07 +02:00
Marek Vasut
65fdbb714d
drm/bridge: tc358767: Implement atomic_check callback
...
Implement .atomic_check callback which prevents user space from setting
unsupported mode. The tc_edp_common_atomic_check() variant is already
prepared for DSI-to-DPI mode addition, which has different frequency
limits.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-6-marex@denx.de
2022-03-31 15:59:05 +02:00
Marek Vasut
f5be62394d
drm/bridge: tc358767: Convert to atomic ops
...
Use the atomic version of the enable/disable operations to continue the
transition to the atomic API. This will be needed to access the mode
from the atomic state.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-5-marex@denx.de
2022-03-31 15:59:03 +02:00
Marek Vasut
a219062b9a
drm/bridge: tc358767: Change tc_ prefix to tc_edp_ for (e)DP specific functions
...
These functions are specific to (e)DP output initialization and
operation, add specific tc_edp_ prefix to those functions to
discern them from DPI output functions that will be added later
in this series. No functional change.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Lucas Stach <l.stach@pengutronix.de > # In both DPI to eDP and DSI to DPI mode.
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-4-marex@denx.de
2022-03-31 15:59:01 +02:00
Lucas Stach
7ed2b0dabf
drm/bridge: adv7511: clean up CEC adapter when probe fails
...
When the probe routine fails we also need to clean up the
CEC adapter registered in adv7511_cec_init().
Fixes: 3b1b975003 ("drm: adv7511/33: add HDMI CEC support")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Robert Foss <robert.foss@linaro.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321104705.2804423-1-l.stach@pengutronix.de
2022-03-31 14:09:03 +02:00
Yang Yingliang
6f5efd118e
drm/bridge: anx7625: add missing destroy_workqueue() in anx7625_i2c_probe()
...
Add the missing destroy_workqueue() before return from
anx7625_i2c_probe() in the error handling case.
Fixes: adca62ec37 ("drm/bridge: anx7625: Support reading edid through aux channel")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220326073326.3389347-1-yangyingliang@huawei.com
2022-03-31 14:04:25 +02:00
Ville Syrjälä
001b6169a9
drm/i915: Allow static DRRS on LVDS
...
Nothing special about static DRRS on LVDS, it's just your
bog standard modeset. Let's allow it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-12-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:22 +03:00
Ville Syrjälä
1159c83392
drm/i915: Allow static DRRS on all eDP ports
...
Only seamless DRRS has specific hardware requirements so
we can allow static DRRS on any eDP port.
And we can replace these port checks and whatnot with
a simple check to make sure the transcoder(s) we're
about to use are capable of seamless DRRS.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-11-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:21 +03:00
Ville Syrjälä
f244cdfa72
drm/i915: Move intel_drrs_compute_config() into intel_dp.c
...
intel_drrs_compute_config() is 100% DP specific. DRRS on other
types of encoders wouldn't do any of these M2/N2 calculations
etc. So let's move this into intel_dp.c so all the DP state
calculation is more concentrated into one place.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-10-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:20 +03:00
Ville Syrjälä
c19909d037
drm/i915: Allow higher refresh rate alternate fixed modes
...
We shouldn't restrict ourselves to just downclock modes with
lower refresh rate than the preferred mode. Laptops these
days can offer higher refresh rate modes as well.
Remove the arbitrary limit and allow all modes that, apart
from the clock, match the preferred mode.
v2: s/add_edid_downclock_modes/add_edid_alt_fixed_modes/ (Jani)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:19 +03:00
Ville Syrjälä
7634bef123
drm/i915: Allow an arbitrary number of downclock modes
...
Remove the "two fixed modes only" limit and grab as many
downclock modes from the EDID as we can find.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:18 +03:00
Ville Syrjälä
ccaa910128
drm/i915: Stop duplicating the EDID fixed/downclock modes
...
Instead of duplicating the fixed/downclock modes we can just grab
the originals straight from the probed_modes list and keep them.
The next .get_modes() is going to repopulate the probed_modes list
anyway so whatever we leave there is just going to sit around until
that time wasting memory. In fact let's clear out the probed modes
list entirely to make sure we get 100% consistent behaviour starting
already from the very first real .get_modes().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:17 +03:00
Ville Syrjälä
3a3c4ce929
drm/i915: Combine the EDID fixed_mode+downclock_mode lookup into one
...
The intel_panel_add_edid_fixed_mode() vs.
intel_panel_add_edid_downclock_mode() split is not really
helpful. Let's just roll those into a single function so
that the connector init code doesn't have to care too much
about this. All we need to know is whether DRRS should be
allowed or not.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:16 +03:00
Ville Syrjälä
05d2d45e87
drm/i915: Nuke intel_drrs_init()
...
intel_drrs_init() is a mostly pointless wrapper around
intel_panel_add_edid_downclock_mode(), get rid of it.
The only really useful thing left in there is the debug
print regarding the DRRS type supported by the connector.
Let's just move that into intel_panel_init().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:15 +03:00
Ville Syrjälä
54746f57f0
drm/i915: Refactor non-EDID fixed mode duplication
...
All the non-EDID fixed mode functions basically do the exact
same thing. Let's refactor the common bits into a shared
function.
There are minor differences on how the mode types are populated,
whether the display info physical size is updated, and the debug
print. The differences are purely accidental, so unifying them is
actually a good thing.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:14 +03:00
Ville Syrjälä
db10c14a25
drm/i915: Put fixed modes directly onto the panel's fixed_modes list
...
Rather than having the connector init get the fixed mode back from
intel_panel and then feed it straight back into intel_panel_init()
let's just make the fixed mode lookup put the mode directly onto
the panel's fixed_modes list. Avoids the pointless round trip and
opens the door for further enhancements to the fixed mode handling.
v2: Make the debug message correct by using intel_panel_drrs_type() (Jani)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:13 +03:00
Ville Syrjälä
1c05183a37
drm/i915: Extract intel_edp_has_drrs()
...
Pull all the eDP specific platform/port checks out from
intel_drrs_init() into intel_edp_has_drrs().
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-03-31 14:28:12 +03:00
José Roberto de Souza
aeb9f0a4a3
drm/i915/display: Add HAS_MBUS_JOINING
...
This will make easy to extend MBUS joining support to future platforms
that also supports this feature.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331184152.1086943-1-jose.souza@intel.com
2022-04-01 07:23:04 -07:00
Jani Nikula
9c67d9e84c
drm/i915/dmc: split out dmc registers to a separate file
...
Clean up the massive i915_reg.h a bit with this isolated set of
registers.
v2: Remove stale comment (Lucas)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-3-jani.nikula@intel.com
2022-04-01 10:06:30 +03:00
Jani Nikula
fe1295e628
drm/i915/dmc: hide DMC version macros
...
The macros are now only needed within intel_dmc.c, so move them there.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-2-jani.nikula@intel.com
2022-04-01 10:06:27 +03:00
Jani Nikula
5efde05f6a
drm/i915/dmc: abstract GPU error state dump
...
Only intel_dmc.c should be accessing dmc details directly.
Need to add an i915_error_printf() stub for
CONFIG_DRM_I915_CAPTURE_ERROR=n.
v2: Add the stub (kernel test robot <lkp@intel.com >)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com > # v1
Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-1-jani.nikula@intel.com
2022-04-01 10:06:22 +03:00
Vinod Govindapillai
bc58192a9b
drm/i915: Handle the DG2 max bw properly
...
Update DG2 init bw info similar to other platforms even though
DG2 has constant bandwidh. This will avoid branching out DG2
specific max bw calls.
V3: Fix dg2_get_bw_info() and avoid handle special cases
for DG2 (Ville Syrjälä)
cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220328230000.215094-1-vinod.govindapillai@intel.com
2022-03-31 14:35:37 +03:00