Randy Dunlap
353520811f
drm: fix a kernel-doc typo
...
Fix a build warning from 'make htmldocs' by correcting the lock name
in the kernel-doc comment.
include/drm/drm_file.h:369: warning: Function parameter or member 'master_lookup_lock' not described in 'drm_file'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Simon Ser <contact@emersion.fr >
Signed-off-by: Simon Ser <contact@emersion.fr >
Link: https://patchwork.freedesktop.org/patch/msgid/20220403231040.18540-1-rdunlap@infradead.org
2022-04-04 18:00:19 +02:00
Daniel Vetter
b892d39199
drm/sched: Check locking in drm_sched_job_add_implicit_dependencies
...
You really need to hold the reservation here or all kinds of funny
things can happen between grabbing the dependencies and inserting the
new fences.
v2: Fix commit summary (Christian)
Acked-by: Melissa Wen <mwen@igalia.com >
Reviewed-by: "Christian König" <christian.koenig@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Luben Tuikov <luben.tuikov@amd.com >
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-4-daniel.vetter@ffwll.ch
2022-04-04 16:46:34 +02:00
Daniel Vetter
d44c2642c4
drm/gem: Delete gem array fencing helpers
...
Integrated into the scheduler now and all users converted over.
v2: Rebased over changes from König.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-3-daniel.vetter@ffwll.ch
2022-04-04 16:46:15 +02:00
Daniel Vetter
b827c84f5e
drm/etnaviv: Use scheduler dependency handling
...
We need to pull the drm_sched_job_init much earlier, but that's very
minor surgery.
v2: Actually fix up cleanup paths by calling drm_sched_job_init, which
I wanted to to in the previous round (and did, for all other drivers).
Spotted by Lucas.
v3: Rebase over renamed functions to add dependencies.
v4: Rebase over patches from Christian.
v5: More rebasing over work from Christian.
Acked-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Russell King <linux+etnaviv@armlinux.org.uk >
Cc: Christian Gmeiner <christian.gmeiner@gmail.com >
Cc: Sumit Semwal <sumit.semwal@linaro.org >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: etnaviv@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-2-daniel.vetter@ffwll.ch
2022-04-04 16:45:49 +02:00
Liu Ying
ae059c0b1c
drm/bridge: nwl-dsi: Drop the drm_of_panel_bridge_remove() function call
...
Since this driver has been changed to use the resource managed
devm_drm_of_get_bridge() to get bridge from ->attach(), it's
unnecessary to call drm_of_panel_bridge_remove() to remove the
bridge from ->detach(). So, let's drop the drm_of_panel_bridge_remove()
function call. As nwl_dsi_bridge_detach() only calls
drm_of_panel_bridge_remove(), it can also be dropped.
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Guido Günther <agx@sigxcpu.org >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: NXP Linux Team <linux-imx@nxp.com >
Signed-off-by: Liu Ying <victor.liu@nxp.com >
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220401015828.2959505-1-victor.liu@nxp.com
2022-04-04 11:24:54 +02:00
Jagan Teki
3730bc6147
drm: bridge: mcde_dsi: Drop explicit bridge remove
...
This driver has been changed to use the resource managed
devm_drm_of_get_bridge() to get bridge from ->bind(), it's
unnecessary to call drm_of_panel_bridge_remove() to remove the
bridge from ->unbind() as devm_drm_of_get_bridge()
is automatically remove the bridge when @dev is unbound.
Drop it the drm_bridge_remove().
Cc: Linus Walleij <linus.walleij@linaro.org >
Reported-by: Maxime Ripard <maxime@cerno.tech >
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220401150533.7777-1-jagan@amarulasolutions.com
2022-04-04 11:14:32 +02:00
Christian König
ba5f33cccc
drm/amdgpu: use dma_resv_get_singleton in amdgpu_pasid_free_cb
...
Makes the code a bit more simpler.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: amd-gfx@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-15-christian.koenig@amd.com
2022-04-03 20:15:51 +02:00
Christian König
c382df714a
drm/atomic-helper: support more than one write fence in drm_gem_plane_helper_prepare_fb
...
Use dma_resv_get_singleton() here to eventually get more than one write
fence as single fence.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-13-christian.koenig@amd.com
2022-04-03 20:14:39 +02:00
Christian König
644704740b
drm/amdgpu: use dma_resv_for_each_fence for CS workaround v2
...
Get the write fence using dma_resv_for_each_fence instead of accessing
it manually.
v2: add TODO comment
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: amd-gfx@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-9-christian.koenig@amd.com
2022-04-03 18:50:49 +02:00
Christian König
9b53fddf3f
drm/radeon: stop using dma_resv_excl_fence
...
Instead use the new dma_resv_get_singleton function.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: amd-gfx@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-8-christian.koenig@amd.com
2022-04-03 17:56:34 +02:00
Christian König
2029a6d028
drm/vmwgfx: stop using dma_resv_excl_fence v2
...
Instead use the new dma_resv_get_singleton function.
v2: drop the TODO comment.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Zack Rusin <zackr@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-7-christian.koenig@amd.com
2022-04-03 17:55:23 +02:00
Christian König
92cedee6a6
dma-buf: add dma_resv_get_singleton v2
...
Add a function to simplify getting a single fence for all the fences in
the dma_resv object.
v2: fix ref leak in error handling
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-3-christian.koenig@amd.com
2022-04-03 17:53:28 +02:00
Sui Jingfeng
d791aec9ff
drivers/dma-buf: dma-buf.c: fix a typo
...
Signed-off-by: Sui Jingfeng <15330273260@189.cn >
Link: https://patchwork.freedesktop.org/patch/msgid/20220402134413.1705246-1-15330273260@189.cn
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Christian König <christian.koenig@amd.com >
2022-04-03 17:30:44 +02:00
Ramalingam C
e36764ecf8
drm/ttm: Add a parameter to add extra pages into ttm_tt
...
Add a parameter called "extra_pages" for ttm_tt_init, to indicate that
driver needs extra pages in ttm_tt.
v2:
Used imperative wording [Thomas and Christian]
Signed-off-by: Ramalingam C <ramalingam.c@intel.com >
cc: Christian Koenig <christian.koenig@amd.com >
cc: Hellstrom Thomas <thomas.hellstrom@intel.com >
Reviewed-by: Thomas Hellstrom <thomas.hellstrom@linux.intel.com >
Reviewed-by: Christian Konig <christian.koenig@amd.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220401123751.27771-8-ramalingam.c@intel.com
2022-04-02 08:22:48 +05:30
Jani Nikula
ab0609a5fb
drm/edid: reduce magic when updating the EDID block checksum
...
The code modifying the EDID block should not need to do tricks to fix
the checksum. We have a function for computing the checksum, use it.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/5a11435419d804a58ef356c0b9acf445cffc1354.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:46 +03:00
Jani Nikula
ccc97def44
drm/edid: track invalid blocks in drm_do_get_edid()
...
Track invalid blocks instead of valid extensions to minimize impact on
the happy day scenario, and hide the details in the separate function.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/6215f85b01c579a44c66129d2b5f41e1ab9294de.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:46 +03:00
Jani Nikula
4ec53461d6
drm/edid: split out invalid block filtering to a separate function
...
It's such a special case there's no point in keeping it inline in the
happy day scenario, confusing matters.
v2: Rebase on the invalid block filtering fix
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ea8ccd654b5beca6ccf99666754aea09c836b6a5.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:46 +03:00
Jani Nikula
23e38d7b48
drm/edid: simplify block check when filtering invalid blocks
...
There's no need to handle complicated scenarios or debug log when
filtering blocks that have already been identified as invalid. Simplify
by adding an edid_block_valid() helper that operates on const data and
prints nothing.
(Finally, here's the justification for the previously added separate
edid_block_status_valid() function!)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/aa25131c3454c7dbc1e8fdb46549f3787bdf6354.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:46 +03:00
Jani Nikula
18d8345046
drm/edid: use a better variable name for EDID block read retries
...
Just i is a bit terse, clarify what it's about.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/9c95c01445f5735332cbbd9eae6cd078e152050f.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:46 +03:00
Jani Nikula
1f221284ab
drm/edid: split drm_edid_block_valid() to check and act parts
...
Add edid_block_check() that only checks the EDID block validity, without
any actions. Turns out it's simple and crystal clear.
Rewrite drm_edid_block_valid() around it, keeping all the functionality
fairly closely the same, warts and all. Turns out it's incredibly
complicated for a function you'd expect to be simple, with all the
fixing and printing and special casing. (Maybe we'll want to simplify it
in the future.)
To slightly simplify, drop the warning for EDID minor revisions > 4.
v2:
- Fix edid_fixup clamp (Ville)
- s/base/is_base_block/ (Ville)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/b7d108b69acccb7dccbdecc0ca06c2b3ca2e33ca.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
0a612bbd91
drm/edid: split out edid_header_fix()
...
Give a name to the EDID header fixup instead of having an inline memcpy.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/c10c24b179e942548cd5d693d159bb0d12be4d26.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
aa6292a380
drm/edid: clean up edid_is_zero()
...
Simplify, rename, take void pointer. No need for the drm_ prefix for
internal helpers.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/15220580f07b63c92a3e448347cf59b297990407.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
6d987ddd68
drm/edid: make drm_edid_header_is_valid() accept void pointer
...
It will be useful to accept a struct edid *, but for compatibility with
existing usage accept void *.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/33fbe1615a3bd82112eaf4077bbb521793cbb91a.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
4ba0f53ce6
drm/edid: add edid_block_tag() helper to get the EDID extension tag
...
The extension tag at offset 0 is not present in struct edid, add a
helper for it to reduce the need to use u8 *.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/3f27c67db63c186a48e83fdee2d1ac8a17714e78.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
70e49ebe90
drm/edid: clean up EDID block checksum functions
...
Have two clear functions, one to compute the checksum over the EDID, and
another to get the checksum from the EDID. Throw away the diff function.
Ditch the drm_ prefix for static functions, and accept const void * to
help transition to struct edid * usage.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/36641401c8eb0e403c0e33365ff4ad9a28f9fd4a.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:40 +03:00
Jani Nikula
e9a9e0768b
drm/edid: use struct edid * in drm_do_get_edid()
...
Mixing u8 * and struct edid * is confusing, switch to the latter.
v2:
- Rebase on the invalid block filtering fix
- Rename struct edid *base to *dest_block for clarity (Ville)
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/18bf820c1d20e616076b3275627e7ebf01bce7a3.1648752228.git.jani.nikula@intel.com
2022-04-01 17:44:02 +03:00
Christian König
15325e3c10
dma-buf: drop the DAG approach for the dma_resv object v3
...
So far we had the approach of using a directed acyclic
graph with the dma_resv obj.
This turned out to have many downsides, especially it means
that every single driver and user of this interface needs
to be aware of this restriction when adding fences. If the
rules for the DAG are not followed then we end up with
potential hard to debug memory corruption, information
leaks or even elephant big security holes because we allow
userspace to access freed up memory.
Since we already took a step back from that by always
looking at all fences we now go a step further and stop
dropping the shared fences when a new exclusive one is
added.
v2: Drop some now superflous documentation
v3: Add some more documentation for the new handling.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-11-christian.koenig@amd.com
2022-04-01 13:30:10 +02:00
Jagan Teki
3d7039e1e6
drm: bridge: mcde_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: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-5-jagan@amarulasolutions.com
2022-03-31 17:52:49 +02:00
Jagan Teki
1c74c1fb83
drm: bridge: dw-mipi-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.
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-4-jagan@amarulasolutions.com
2022-03-31 17:52:48 +02:00
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