OSDN Git Service

tomoyo/tomoyo-test1.git
3 years agodrm/doc: move composition function docs to new section
Simon Ser [Wed, 16 Dec 2020 20:22:16 +0000 (21:22 +0100)]
drm/doc: move composition function docs to new section

Move drm_blend.c function reference from the KMS properties section to
the plane abstraction section. This makes the KMS properties section
more readable for user-space developers.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201216202222.48146-3-contact@emersion.fr
3 years agodrm/doc: rename FB_DAMAGE_CLIPS section
Simon Ser [Wed, 16 Dec 2020 20:22:15 +0000 (21:22 +0100)]
drm/doc: rename FB_DAMAGE_CLIPS section

Make it more human-readable.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201216202222.48146-2-contact@emersion.fr
3 years agoMAINTAINERS: Update addresses for TI display drivers
Tomi Valkeinen [Wed, 16 Dec 2020 07:59:17 +0000 (09:59 +0200)]
MAINTAINERS: Update addresses for TI display drivers

Update the maintainer email addresses for TI display drivers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Jyri Sarha <jyri.sarha@iki.fi>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20201216075917.17481-1-tomi.valkeinen@ti.com
3 years agodma-buf: doc polish for pin/unpin
Daniel Vetter [Fri, 11 Dec 2020 15:58:43 +0000 (16:58 +0100)]
dma-buf: doc polish for pin/unpin

Motivated by a discussion with Christian and Thomas: Try to untangle a
bit what's relevant for importers and what's relevant for exporters.

Also add an assert that really only dynamic importers use the api
function, anything else doesn't make sense.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
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/20201211155843.3348718-4-daniel.vetter@ffwll.ch
3 years agodma-buf: begin/end_cpu might lock the dma_resv lock
Daniel Vetter [Mon, 14 Dec 2020 17:16:22 +0000 (18:16 +0100)]
dma-buf: begin/end_cpu might lock the dma_resv lock

At least amdgpu and i915 do, so lets just document this as the rule.

v2: Works better with less typos (intel-gfx-ci)

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
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/20201214171622.3868883-1-daniel.vetter@ffwll.ch
3 years agodma-buf: some kerneldoc formatting fixes
Daniel Vetter [Fri, 11 Dec 2020 15:58:41 +0000 (16:58 +0100)]
dma-buf: some kerneldoc formatting fixes

Noticed while reviewing the output. Adds a bunch more links and fixes
the function interface quoting.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
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/20201211155843.3348718-2-daniel.vetter@ffwll.ch
3 years agodma-buf: Remove kmap kerneldoc vestiges
Daniel Vetter [Fri, 11 Dec 2020 15:58:40 +0000 (16:58 +0100)]
dma-buf: Remove kmap kerneldoc vestiges

Also try to clarify a bit when dma_buf_begin/end_cpu_access should
be called.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
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/20201211155843.3348718-1-daniel.vetter@ffwll.ch
3 years agodrm/vc4: hdmi: Enable 10/12 bpc output
Maxime Ripard [Tue, 15 Dec 2020 15:42:43 +0000 (16:42 +0100)]
drm/vc4: hdmi: Enable 10/12 bpc output

The BCM2711 supports higher bpc count than just 8, so let's support it in
our driver.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-10-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Limit the BCM2711 to the max without scrambling
Maxime Ripard [Tue, 15 Dec 2020 15:42:42 +0000 (16:42 +0100)]
drm/vc4: hdmi: Limit the BCM2711 to the max without scrambling

Unlike the previous generations, the HSM clock limitation is way above
what we can reach without scrambling, so let's move the maximum
frequency we support to the maximum clock frequency without scrambling.

Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-9-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Use the connector state pixel rate for the PHY
Maxime Ripard [Tue, 15 Dec 2020 15:42:41 +0000 (16:42 +0100)]
drm/vc4: hdmi: Use the connector state pixel rate for the PHY

The PHY initialisation parameters are not based on the pixel clock but
the TMDS clock rate which can be the pixel clock in the standard case,
but could be adjusted based on some parameters like the bits per color.

Since the TMDS clock rate is stored in our custom connector state
already, let's reuse it from there instead of computing it again.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-8-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Store pixel frequency in the connector state
Maxime Ripard [Tue, 15 Dec 2020 15:42:40 +0000 (16:42 +0100)]
drm/vc4: hdmi: Store pixel frequency in the connector state

The pixel rate is for now quite simple to compute, but with more features
(30 and 36 bits output, YUV output, etc.) will depend on a bunch of
connectors properties.

Let's store the rate we have to run the pixel clock at in our custom
connector state, and compute it in atomic_check.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-7-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Create a custom connector state
Maxime Ripard [Tue, 15 Dec 2020 15:42:39 +0000 (16:42 +0100)]
drm/vc4: hdmi: Create a custom connector state

When run with a higher bpc than 8, the clock of the HDMI controller needs
to be adjusted. Let's create a connector state that will be used at
atomic_check and atomic_enable to compute and store the clock rate
associated to the state.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-6-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Don't access the connector state in reset if kmalloc fails
Maxime Ripard [Tue, 15 Dec 2020 15:42:38 +0000 (16:42 +0100)]
drm/vc4: hdmi: Don't access the connector state in reset if kmalloc fails

drm_atomic_helper_connector_reset uses kmalloc which, from an API
standpoint, can fail, and thus setting connector->state to NULL.
However, our reset hook then calls drm_atomic_helper_connector_tv_reset
that will access connector->state without checking if it's a valid
pointer or not.

Make sure we don't end up accessing a NULL pointer.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Suggested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-5-maxime@cerno.tech
3 years agodrm/vc4: hdmi: Take into account the clock doubling flag in atomic_check
Maxime Ripard [Tue, 15 Dec 2020 15:42:37 +0000 (16:42 +0100)]
drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check

Commit 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within
limits") was intended to compute the pixel rate to make sure we remain
within the boundaries of what the hardware can provide.

However, unlike what mode_valid was checking for, we forgot to take
into account the clock doubling flag that can be set for modes. Let's
honor that flag if it's there.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reported-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Fixes: 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-4-maxime@cerno.tech
3 years agodrm/vc4: Pass the atomic state to encoder hooks
Maxime Ripard [Tue, 15 Dec 2020 15:42:36 +0000 (16:42 +0100)]
drm/vc4: Pass the atomic state to encoder hooks

We'll need to access the connector state in our encoder setup, so let's
just pass the whole DRM state to our private encoder hooks.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-3-maxime@cerno.tech
3 years agodrm/vc4: hvs: Align the HVS atomic hooks to the new API
Maxime Ripard [Tue, 15 Dec 2020 15:42:35 +0000 (16:42 +0100)]
drm/vc4: hvs: Align the HVS atomic hooks to the new API

Since the CRTC setup in vc4 is split between the PixelValves/TXP and the
HVS, only the PV/TXP atomic hooks were updated in the previous commits, but
it makes sense to update the HVS ones too.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215154243.540115-2-maxime@cerno.tech
3 years agodrm/hisilicon: Fix rmmod hibmc_drm failed
Tian Tao [Tue, 15 Dec 2020 12:18:59 +0000 (20:18 +0800)]
drm/hisilicon: Fix rmmod hibmc_drm failed

drm_irq_uninstall should be called before pci_disable_msi, if use
devm_drm_irq_install to register the interrupt, the system will
call pci_disable_msi first and then call drm_irq_uninstall, which
will result in the following callstack.

This reverts commit e4401247070a37c2fce62b2773a4eb7757983938.

kernel BUG at drivers/pci/msi.c:376!
Internal error: Oops - BUG: 0 [#1] SMP
CPU: 93 PID: 173814 Comm: rmmod Tainted:
pstate: a0400009 (NzCv daif +PAN -UAO -TCO BTYPE=--)
pc : free_msi_irqs+0x17c/0x1a0
lr : free_msi_irqs+0x16c/0x1a0
sp : ffff2028157f7bd0
x29: ffff2028157f7bd0 x28: ffff202849edab00
x27: 0000000000000000 x26: 0000000000000000
x25: 0000000000000000 x24: 0000000000000000
x23: ffff0020851da000 x22: ffff0020851da2d8
x21: ffff0020cc829000 x20: 0000000000000000
x19: ffff0020d6714800 x18: 0000000000000010
x17: 0000000000000000 x16: 0000000000000000
x15: ffffffffffffffff x14: ffff2028957f77df
x13: ffff2028157f77ed x12: 0000000000000000
x11: 0000000000000040 x10: ffff800011b2f8e0
x9 : ffff800011b2f8d8 x8 : ffff2020203fc458
x7 : 0000000000000000 x6 : 0000000000000000
x5 : ffff2020203fc430 x4 : ffff2020203fc4a0
x3 : 0000000000000000 x2 : 0000000000000000
x1 : 00000000000002c9 x0 : ffff0020d6719500
Call trace:
 free_msi_irqs+0x17c/0x1a0
 pci_disable_msi+0xe4/0x118
 hibmc_unload+0x44/0x80 [hibmc_drm]
 hibmc_pci_remove+0x2c/0x38 [hibmc_drm]
 pci_device_remove+0x48/0x108
 device_release_driver_internal+0x118/0x1f0
 driver_detach+0x6c/0xe0
 bus_remove_driver+0x74/0x100
 driver_unregister+0x34/0x60
 pci_unregister_driver+0x24/0xd8
 hibmc_pci_driver_exit+0x14/0xe768 [hibmc_drm]
 __arm64_sys_delete_module+0x1fc/0x2d0
 el0_svc_common.constprop.3+0xa8/0x188
 do_el0_svc+0x80/0xa0
 el0_sync_handler+0x8c/0xb0
 el0_sync+0x15c/0x180
Code: f940b400 b4ffff00 a903e7b8 f90013b5 (d4210000)
---[ end trace 310d94ee8abef44f ]---
Kernel panic - not syncing: Oops - BUG: Fatal exception

v2:
update the commit log to indicate the patch that needs to be revert.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1608034739-699-1-git-send-email-tiantao6@hisilicon.com
3 years agodrm/ttm: cleanup LRU handling further
Christian König [Fri, 27 Nov 2020 14:14:34 +0000 (15:14 +0100)]
drm/ttm: cleanup LRU handling further

We only completely delete the BO from the LRU on destruction.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/404618/
3 years agodrm/ttm: use pin_count more extensively
Christian König [Fri, 27 Nov 2020 11:51:33 +0000 (12:51 +0100)]
drm/ttm: use pin_count more extensively

Check the pin_count instead of the lru list is empty here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Link: https://patchwork.freedesktop.org/patch/404617/
3 years agodrm: require a non_NULL drm_crtc.primary
Simon Ser [Fri, 11 Dec 2020 18:46:33 +0000 (19:46 +0100)]
drm: require a non_NULL drm_crtc.primary

If a CRTC is missing a legacy primary plane pointer, a lot of things
will be broken for user-space: fbdev stops working and the entire legacy
uAPI stops working.

Require all drivers to populate drm_crtc.primary to prevent these
issues. Warn if it's NULL.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201211184634.74534-3-contact@emersion.fr
3 years agodrm: validate possible_crtcs for primary and cursor planes
Simon Ser [Fri, 11 Dec 2020 18:46:32 +0000 (19:46 +0100)]
drm: validate possible_crtcs for primary and cursor planes

If a primary or cursor plane is not compatible with a CRTC it's attached
to via the legacy primary/cursor field, things will be broken for legacy
user-space.

v4: use drm_crtc_mask instead of BIT (Ville)

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201211184634.74534-2-contact@emersion.fr
3 years agodrm: rework description of primary and cursor planes
Simon Ser [Fri, 11 Dec 2020 18:46:31 +0000 (19:46 +0100)]
drm: rework description of primary and cursor planes

The previous wording could be understood by user-space evelopers as "a
primary/cursor plane is only compatible with a single CRTC" [1].

Reword the planes description to make it clear the DRM-internal
drm_crtc.primary and drm_crtc.cursor planes are for legacy uAPI.

[1]: https://github.com/swaywm/wlroots/pull/2333#discussion_r456788057

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201211184634.74534-1-contact@emersion.fr
3 years agodrm/omap: Delete useless kfree code
Zheng Yongjun [Mon, 14 Dec 2020 13:46:28 +0000 (21:46 +0800)]
drm/omap: Delete useless kfree code

The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201214134628.4937-1-zhengyongjun3@huawei.com
3 years agodrm/omap: dsi: allow DSI commands to be sent early
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:57 +0000 (12:46 +0200)]
drm/omap: dsi: allow DSI commands to be sent early

Panel drivers can send DSI commands in panel's prepare(), which happens
before the bridge's enable() is called. The OMAP DSI driver currently
only sets up the DSI interface at bridge's enable(), so prepare() cannot
be used to send DSI commands.

This patch fixes the issue by making it possible to enable the DSI
interface any time a command is about to be sent. Disabling the
interface is be done via delayed work.

Clarifications for the delayed disable work and the panel doing DSI
transactions:

bridge_enable: If the disable callback is called just before
bridge_enable takes the dsi_bus_lock, no problem, bridge_enable just
enables the interface again. If the callback is ran just after
bridge_enable's dsi_bus_unlock, no problem, dsi->video_enabled == true
so the callback does nothing.

bridge_disable: similar to bridge-enable, the callback won't do anything
if video_enabled == true, and after bridge-disable has turned the video
and the interface off, there's nothing to do for the callback.

omap_dsi_host_detach: this is called when the panel does
mipi_dsi_detach(), and we expect the panel to _not_ do any DSI
transactions after (or during) mipi_dsi_detatch(), so there are no
race conditions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-85-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: fix DCS_CMD_ENABLE
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:56 +0000 (12:46 +0200)]
drm/omap: dsi: fix DCS_CMD_ENABLE

We only need to set VC_CTRL:DCS_CMD_ENABLE for command mode panels when
the HW has DSI_QUIRK_DCS_CMD_CONFIG_VC quirk. The old code did this
right by accident, but now we set DCS_CMD_ENABLE for video mode panels
too.

Fix this by skipping the set for video mode.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-84-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: remove ulps support
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:55 +0000 (12:46 +0200)]
drm/omap: dsi: remove ulps support

ULPS is a niche power-saving feature which only really affects command
mode panels showing a static picture. I know the ULPS code used to work
very long time ago, but I could not get it working with the current
driver. As the ULPS code is not trivial and includes delayed work (so
lots of chances for race issues), and just keeping DSI video and command
mode panels working has been challenging enough even without ULPS, lets
remove ULPS support.

When the DSI driver works reliably for command and video mode displays,
someone interested can work on ULPS and add it back if the power saving
is substantial enough.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-83-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: fix and cleanup ddr_clk_always_on
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:54 +0000 (12:46 +0200)]
drm/omap: dsi: fix and cleanup ddr_clk_always_on

The driver ignores MIPI_DSI_CLOCK_NON_CONTINUOUS, and always uses
non-continuous clock.

Fix this by using MIPI_DSI_CLOCK_NON_CONTINUOUS and at the same time,
drop ddr_clk_always_on field which seems pretty useless.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-82-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: split video mode enable/disable into separate func
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:53 +0000 (12:46 +0200)]
drm/omap: dsi: split video mode enable/disable into separate func

Clean up the code by separating video-mode enable/disable code into
functions of their own.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-81-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: cleanup initial vc setup
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:52 +0000 (12:46 +0200)]
drm/omap: dsi: cleanup initial vc setup

As we now have a fixed setup for VCs (VC0 for video stream, VC1 for
commands), we can simplify the VC setup.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-80-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: rename dsi_display_* functions
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:51 +0000 (12:46 +0200)]
drm/omap: dsi: rename dsi_display_* functions

The function names have evolved to be very confusing, and bunch of them
have "display" in them even if the function doesn't deal with display as
such (e.g. dsi_display_enable which just enables the DSI interface).
Rename them by dropping the "display".

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-79-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: display_disable cleanup
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:50 +0000 (12:46 +0200)]
drm/omap: dsi: display_disable cleanup

We can drop dsi_display_disable() which just calls
_dsi_display_disable(), and rename _dsi_display_disable() to
dsi_display_disable().

The WARN_ON(!dsi_bus_is_locked(dsi)) in dsi_display_disable is extra and
can be dropped, as _dsi_display_disable() has the same WARN_ON().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-78-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: display_enable cleanup
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:49 +0000 (12:46 +0200)]
drm/omap: dsi: display_enable cleanup

We can drop dsi_display_enable(), which just calls
_dsi_display_enable(), and rename _dsi_display_enable() to
dsi_display_enable().

The WARN_ON(!dsi_bus_is_locked(dsi)) in dsi_display_enable is extra and
can be dropped, as _dsi_display_enable() has the same WARN_ON().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-77-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: move enable/disable to bridge enable/disable
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:48 +0000 (12:46 +0200)]
drm/omap: dsi: move enable/disable to bridge enable/disable

Clean up the code by inlining dsi_enable_video_outputs and
dsi_disable_video_outputs functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-76-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: move structs & defines to dsi.h
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:47 +0000 (12:46 +0200)]
drm/omap: dsi: move structs & defines to dsi.h

Move structs and defines to a private dsi.h header file to make dsi.c a
bit easier to navigate. Also move the (now) private structs and defines
from omapdss.h to dsi.h.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-75-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: drop unneeded includes
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:46 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: drop unneeded includes

Drop unneeded includes.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-74-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: add panel database to driver
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:45 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: add panel database to driver

Add a panel database to the driver instead of reading propertes from DT
data. This is similar to panel-simple, and I believe it's more future
safe way to handle the panels.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-73-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: remove extra 'if'
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:44 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: remove extra 'if'

We have a useless 'if' in the dsicm_bl_update_status(), a left over from
the conversion to DRM model. Drop the if.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-72-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: use separate VCs for cmd and video
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:43 +0000 (12:46 +0200)]
drm/omap: dsi: use separate VCs for cmd and video

For command mode panels we can use a single VC for sending command and
video data, even if we have to change the data source for that VC when
going from command to video or vice versa.

However, with video mode panels we want to keep the pixel data VC
enabled, and use another VC for command data, and the commands will get
interleaved into the pixel data.

This patch makes the driver use VC0 for commands and VC1 for video.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-71-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: enable HS before sending the frame
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:42 +0000 (12:46 +0200)]
drm/omap: dsi: enable HS before sending the frame

We currently use a single VC for sending commands and pixel data. The
LP/HS mode for pixel data is correctly set to HS by accident, as we have
set the VC to HS already earlier.

However, if we use a different VC for video data, the VC is in LP mode.
Fix this by always enabling HS mode before starting a frame update.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-70-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: skip dsi_vc_enable_hs when already in correct mode
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:41 +0000 (12:46 +0200)]
drm/omap: dsi: skip dsi_vc_enable_hs when already in correct mode

Simplify and optimize dsi_vc_enable_hs() so that it can be called
without checking the current HS/LP mode. Make dsi_vc_enable_hs() return
if the VC is already in the correct mode.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-69-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: untangle vc & channel
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:40 +0000 (12:46 +0200)]
drm/omap: dsi: untangle vc & channel

DSI virtual channel and hardware VC blocks have gotten tangled as
described in the previous commits. This has not caused any issues, as
the value for both is 0, so it happens to work.

To fix the issue, change the code to use the correct one of the two.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-68-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: pass vc and channel to various functions
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:39 +0000 (12:46 +0200)]
drm/omap: dsi: pass vc and channel to various functions

To start fixing the issues related to channels and vcs described in the
previous commit, pass vc and/or channel to various functions which will
need it do properly handle different DSI channels and VCs.

No functional changes.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-67-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: rename 'channel' to 'vc'
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:38 +0000 (12:46 +0200)]
drm/omap: dsi: rename 'channel' to 'vc'

The "channel" usage in omap dsi driver is confusing. We have three
different "channels":

1) DSI virtual channel ID. This is a number from 0 to 3, included in the
packet payload.

2) VC. This is a register block in the DSI IP. There are four of those
blocks. A VC is a DSI "pipeline", with defined fifo settings, data
source (cpu or dispc), and some other settings. It has no relation to
the 1).

3) dispc channel. It's the "pipeline" number dispc uses to send pixel
data.

The previous patch handled the third case.

 To start fixing 1) and 2), we first rename all uses of 'channel' to
'vc', as in most of the cases that is the correct thing to use.

However, in some places 1) and 2) have gotten mixed up (i.e. the code
uses msg->channel when it should use vc), which will be fixed in the
following patch.

Note that mixing 1) and 2) currently is "fine", as at the moment we only
support DSI peripherals with DSI virtual channel 0, and we always use
VC0 to send data. So both 1) and 2) are always 0.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-66-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: cleanup dispc channel usage
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:37 +0000 (12:46 +0200)]
drm/omap: dsi: cleanup dispc channel usage

The "channel" usage in omap dsi driver is confusing. As the first step,
change "channel" to "dispc_channel" when dealing with the dispc channel.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-65-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop useless channel checks
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:36 +0000 (12:46 +0200)]
drm/omap: dsi: drop useless channel checks

A DSI peripheral can have virtual channel ID of 0-3. This should be
always the case, and there's no need in the driver to validate the
channel.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-64-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: simplify VC handling
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:35 +0000 (12:46 +0200)]
drm/omap: dsi: simplify VC handling

The VC handling has gotten quite tangled up. As the first step to clean
it up, lets define that we only support a single DSI peripheral (which
was really already the case), and we always use VC0 (define VC_DEFAULT
0) register block to send data to the peripheral.

We can thus have a single mipi_dsi_device pointer and remove the
for-loops which made passes over all the four VCs (just the first one
was ever used).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-63-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: send nop instead of page & column
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:34 +0000 (12:46 +0200)]
drm/omap: dsi: send nop instead of page & column

The OMAP DSI command mode panel driver used to send page & column
address before each frame update, and this code was moved into the DSI
host driver when converting it to the DRM bridge model.

However, it's not really required to send the page & column address
before each frame. It's also something that doesn't really belong to the
DSI host driver, so we should drop the code.

That said, frame updates break if we don't send _something_ between the
frames. A NOP command does the trick.

It is not clear if this behavior is as expected from a DSI command mode
frame transfer, or is it a feature/issue with OMAP DSI driver, or a
feature/issue in the command mode panel used.

Most likely this is related to the following from the DSI spec:

"To enable PHY synchronization the host processor should periodically
end HS transmission and drive the Data Lanes to the LP state. This
transition should take place at least once per frame."

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-62-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: set column & page at setup
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:33 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: set column & page at setup

Set the column & page address once during setup, instead of relying the
DSI host driver to set those.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-61-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: set trans_mode according to client mode_flags
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:32 +0000 (12:46 +0200)]
drm/omap: dsi: set trans_mode according to client mode_flags

The DSI host driver currently ignores the video mode flags in
client->mode_flags. Add the code to take the transfer mode from client's
mode_flags.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-60-tomi.valkeinen@ti.com
3 years agodrm/omap: pll: fix iteration loop check
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:31 +0000 (12:46 +0200)]
drm/omap: pll: fix iteration loop check

If the PLL calc function is given bad parameters, n_start/m_start may be
higher than n_stop/m_stop, which leads to the loops iterating through
the whole u32 number space.

Fix this by failing early on such cases.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-59-tomi.valkeinen@ti.com
3 years agoARM: dts: omap5: add address-cells & size-cells to dsi
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:30 +0000 (12:46 +0200)]
ARM: dts: omap5: add address-cells & size-cells to dsi

Add address-cells & size-cells to DSI nodes so that board files do not
need to define them.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-58-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: cleanup tear enable
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:29 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: cleanup tear enable

Simplify the code by moving code from _dsicm_enable_te() into
dsicm_power_on().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-57-tomi.valkeinen@ti.com
3 years agodrm/panel: panel-dsi-cm: use MIPI_DCS_GET_ERROR_COUNT_ON_DSI
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:28 +0000 (12:46 +0200)]
drm/panel: panel-dsi-cm: use MIPI_DCS_GET_ERROR_COUNT_ON_DSI

Use the common MIPI_DCS_GET_ERROR_COUNT_ON_DSI define instead of
driver's own.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-56-tomi.valkeinen@ti.com
3 years agodrm/omap: remove dss_mgr_ops
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:27 +0000 (12:46 +0200)]
drm/omap: remove dss_mgr_ops

dss_mgr_ops was needed with the multi-module architecture, but is no
longer needed. We can thus remove it and use direct calls.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-55-tomi.valkeinen@ti.com
3 years agodrm/omap: remove dispc_ops
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:26 +0000 (12:46 +0200)]
drm/omap: remove dispc_ops

dispc_ops was created to help with the multi-module architecture and
giving us the possibility of multiple dispc implementations. Neither of
these is valid anymore, and we can remove dispc_ops and use direct
calls to dispc.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-54-tomi.valkeinen@ti.com
3 years agodrm/omap: drop unused owner field
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:25 +0000 (12:46 +0200)]
drm/omap: drop unused owner field

dssdev->owner is set, but never used. We can drop the field.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-53-tomi.valkeinen@ti.com
3 years agodrm/omap: remove unused display.c
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:24 +0000 (12:46 +0200)]
drm/omap: remove unused display.c

The functions in display.c are not used, so drop the file.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-52-tomi.valkeinen@ti.com
3 years agodrm/omap: squash omapdrm sub-modules into one
Tomi Valkeinen [Tue, 15 Dec 2020 10:46:23 +0000 (12:46 +0200)]
drm/omap: squash omapdrm sub-modules into one

At the moment we have three different modules: omapdss-base, omapdss,
omapdrm. This setup is finally obsolete, as the last omapdrm specific
panel has been converted to DRM panel.

We can thus remove omapdss-base and omapdss, and just compile everything
into omapdrm.ko.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-51-tomi.valkeinen@ti.com
3 years agoARM: omap2plus_defconfig: Update for moved DSI command mode panel
Sebastian Reichel [Tue, 15 Dec 2020 10:46:22 +0000 (12:46 +0200)]
ARM: omap2plus_defconfig: Update for moved DSI command mode panel

The DSI command mode panel is no longer specific
to OMAP and thus the config option has been renamed
slightly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-50-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: simplify pin config
Sebastian Reichel [Tue, 15 Dec 2020 10:46:21 +0000 (12:46 +0200)]
drm/omap: dsi: simplify pin config

Simplify DSI pin config, which always originates from DT
nowadays. With the code being fully contained in the DSI
encoder, we can drop the public structure.

Since the function is no longer exposed, it now directly
takes the private DSI data pointer. This drops a pointless
conversion and means the pins can be configured earlier.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-49-tomi.valkeinen@ti.com
3 years agodrm/omap: simplify DSI manual update code
Sebastian Reichel [Tue, 15 Dec 2020 10:46:20 +0000 (12:46 +0200)]
drm/omap: simplify DSI manual update code

Move dsi_ops into the main structure, since all other ops
are gone. Instead of checking the device type we can simply
check if dsi_ops are set.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-48-tomi.valkeinen@ti.com
3 years agodrm/omap: drop dssdev display field
Sebastian Reichel [Tue, 15 Dec 2020 10:46:19 +0000 (12:46 +0200)]
drm/omap: drop dssdev display field

All displays are now using a drm_panel or a drm_bridge that models the
connector instead of dssdev, so this field is always 0 and can be
dropped.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-47-tomi.valkeinen@ti.com
3 years agodrm/omap: drop DSS ops_flags
Sebastian Reichel [Tue, 15 Dec 2020 10:46:18 +0000 (12:46 +0200)]
drm/omap: drop DSS ops_flags

The omapdss device's ops_flags field is no longer
used and can be dropped.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-46-tomi.valkeinen@ti.com
3 years agodrm/omap: drop unused DSS next pointer
Sebastian Reichel [Tue, 15 Dec 2020 10:46:17 +0000 (12:46 +0200)]
drm/omap: drop unused DSS next pointer

Since all encoders and panels are using the bridge API now,
we next pointer is no longer useful and can be dropped.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-45-tomi.valkeinen@ti.com
3 years agodrm/omap: simplify omap_display_id
Sebastian Reichel [Tue, 15 Dec 2020 10:46:16 +0000 (12:46 +0200)]
drm/omap: simplify omap_display_id

We no longer need to check for the DSS API, since all encoders,
panels and connectors have been converted to the bridge API.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-44-tomi.valkeinen@ti.com
3 years agodrm/omap: remove unused omap_connector
Sebastian Reichel [Tue, 15 Dec 2020 10:46:15 +0000 (12:46 +0200)]
drm/omap: remove unused omap_connector

Remove unused code. Connectors are now created via drm_bridge_connector_init()
and no longer OMAP specific.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-43-tomi.valkeinen@ti.com
3 years agodrm/omap: remove legacy DSS device operations
Sebastian Reichel [Tue, 15 Dec 2020 10:46:14 +0000 (12:46 +0200)]
drm/omap: remove legacy DSS device operations

All DSS devices have been converted to bridge API, so
the device operations are always NULL. This removes
the device ops function pointers and all code using it.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-42-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: Register a drm_bridge
Sebastian Reichel [Tue, 15 Dec 2020 10:46:13 +0000 (12:46 +0200)]
drm/omap: dsi: Register a drm_bridge

In order to integrate with a chain of drm_bridge, the internal DSI
output has to expose its operations through the drm_bridge API.
Register a bridge at initialisation time to do so and remove the
omap_dss_device operations that are now unused.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-41-tomi.valkeinen@ti.com
3 years agodrm/panel: Move OMAP's DSI command mode panel driver
Sebastian Reichel [Tue, 15 Dec 2020 10:46:12 +0000 (12:46 +0200)]
drm/panel: Move OMAP's DSI command mode panel driver

The panel driver is no longer using any OMAP specific APIs, so
let's move it into the generic panel directory.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-40-tomi.valkeinen@ti.com
3 years agodrm/omap: remove global dss_device variable
Sebastian Reichel [Tue, 15 Dec 2020 10:46:11 +0000 (12:46 +0200)]
drm/omap: remove global dss_device variable

We can simply provide the device to the omapdrm driver
via pdata. omapdss_is_initialized() is no longer required
(even before this patch), since omapdrm device is only
registered after the pointer is initialized.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-39-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: fix remove()
Sebastian Reichel [Tue, 15 Dec 2020 10:46:10 +0000 (12:46 +0200)]
drm/omap: panel-dsi-cm: fix remove()

Do not try to reset the panel after DSI has been
detached, since the DSI clocks may have been disabled
at this point. The panel will be disabled and unprepared
before being removed and a reset will be done when being
probed again.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-38-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: support unbinding
Sebastian Reichel [Tue, 15 Dec 2020 10:46:09 +0000 (12:46 +0200)]
drm/omap: panel-dsi-cm: support unbinding

Now, that the driver implements the common DRM panel API
the unbind no longer needs to be suppressed.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-37-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: use DEVICE_ATTR_RO
Sebastian Reichel [Tue, 15 Dec 2020 10:46:08 +0000 (12:46 +0200)]
drm/omap: panel-dsi-cm: use DEVICE_ATTR_RO

Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-36-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: implement check timings
Sebastian Reichel [Tue, 15 Dec 2020 10:46:07 +0000 (12:46 +0200)]
drm/omap: dsi: implement check timings

Implement check timings, which will check if it's possible to
configure the clocks for the provided mode using the same code
as the set_config() hook.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-35-tomi.valkeinen@ti.com
3 years agodrm/omap: drop omapdss-boot-init
Sebastian Reichel [Tue, 15 Dec 2020 10:46:06 +0000 (12:46 +0200)]
drm/omap: drop omapdss-boot-init

The table of compatible values needed to be prefixed with "omapdss,"
is empty, so all of this code is doing nothing now. Let's drop it.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-34-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: convert to drm_panel
Sebastian Reichel [Tue, 15 Dec 2020 10:46:05 +0000 (12:46 +0200)]
drm/omap: dsi: convert to drm_panel

This converts the DSI module to expect common drm_panel display
drivers instead of dssdev based ones.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-33-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop custom panel capability support
Sebastian Reichel [Tue, 15 Dec 2020 10:46:04 +0000 (12:46 +0200)]
drm/omap: dsi: drop custom panel capability support

Due to previous changes the DSI encoder gets the capabilities
via DSI client's mode_flags and no longer needs the omapdss
specific caps. The core code now checks if the DSI encoder
is actually configured into command mode instead of just checking
the panel capabilities.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-32-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: Reverse direction of the DSS device enable/disable operations
Sebastian Reichel [Tue, 15 Dec 2020 10:46:03 +0000 (12:46 +0200)]
drm/omap: dsi: Reverse direction of the DSS device enable/disable operations

Complete the direction reversal of the DSS device enable/disable
operations started by commit 19b4200d8f4b ("drm/omap: Reverse direction
of the DSS device enable/disable operations").

This effectively drops the requirement of calling DSS specific
code from the DSI panel driver moving it a bit further to a
standard drm_panel driver.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-31-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: move panel refresh function to host
Sebastian Reichel [Tue, 15 Dec 2020 10:46:02 +0000 (12:46 +0200)]
drm/omap: dsi: move panel refresh function to host

This moves the panel refresh/update function from the panel
driver into the DSI host driver to prepare for common drm_panel
support.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-30-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: do ULPS in host driver
Sebastian Reichel [Tue, 15 Dec 2020 10:46:01 +0000 (12:46 +0200)]
drm/omap: dsi: do ULPS in host driver

Move ULPS handling into the DSI host controller, so that we
no longer need a custom API for the DSI client.

Note that for now ULPS is always disabled.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-29-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: untangle ulps ops from enable/disable
Sebastian Reichel [Tue, 15 Dec 2020 10:46:00 +0000 (12:46 +0200)]
drm/omap: dsi: untangle ulps ops from enable/disable

Create a custom function pointer for ULPS and use it instead of
reusing disable/enable functions for ULPS mode switch. This allows
us to use the common disable/enable functions pointers for DSI.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-28-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: do bus locking in host driver
Sebastian Reichel [Tue, 15 Dec 2020 10:45:59 +0000 (12:45 +0200)]
drm/omap: dsi: do bus locking in host driver

This moves the bus locking into the host driver and unexports
the custom API in preparation for drm_panel support.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-27-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop custom enable_te() API
Sebastian Reichel [Tue, 15 Dec 2020 10:45:58 +0000 (12:45 +0200)]
drm/omap: dsi: drop custom enable_te() API

Instead of using the custom enable_te() API, this automatically
enables/disables TE core support when a matching packet is sent
to the panel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-26-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: move TE GPIO handling into core
Sebastian Reichel [Tue, 15 Dec 2020 10:45:57 +0000 (12:45 +0200)]
drm/omap: dsi: move TE GPIO handling into core

In preparation for removing custom DSS calls from the DSI
panel driver, this moves support for external tearing event
GPIOs into the DSI host driver. This way tearing events are
always handled in the core resulting in simplification of
the panel drivers.

The TE GPIO acquisition follows works in the same way as the
exynos DSI implementation.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-25-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: lp/hs switching support for transfer()
Sebastian Reichel [Tue, 15 Dec 2020 10:45:56 +0000 (12:45 +0200)]
drm/omap: dsi: lp/hs switching support for transfer()

Integrate low-power / high-speed bus switching into transfer
function and drop the omapdrm specific enable_hs() callback.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-24-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: use bulk regulator API
Sebastian Reichel [Tue, 15 Dec 2020 10:45:55 +0000 (12:45 +0200)]
drm/omap: panel-dsi-cm: use bulk regulator API

Use bulk regulator API to simplify the code. This also switches
from _optional variant to normal variant, which will provide a
dummy regulator (i.e. if some always-enabled regulator is not
described in DT).

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-23-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: use pixel-format and mode from attach
Sebastian Reichel [Tue, 15 Dec 2020 10:45:54 +0000 (12:45 +0200)]
drm/omap: dsi: use pixel-format and mode from attach

In order to reduce the amount of custom functionality, this moves
handling of pixel format and DSI mode from set_config() to dsi
attach.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-22-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop useless sync()
Sebastian Reichel [Tue, 15 Dec 2020 10:45:53 +0000 (12:45 +0200)]
drm/omap: dsi: drop useless sync()

The DSI sync() function only locks the bus and then releases
it again. Currently the only invocation is directly before
update(), which locks the bus anyways.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-21-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop unused enable_te()
Sebastian Reichel [Tue, 15 Dec 2020 10:45:52 +0000 (12:45 +0200)]
drm/omap: dsi: drop unused enable_te()

enable_te() is not used, so the custom API can be dropped.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-20-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop unused get_te()
Sebastian Reichel [Tue, 15 Dec 2020 10:45:51 +0000 (12:45 +0200)]
drm/omap: dsi: drop unused get_te()

The get_te() callback is not used, so we can drop the
custom API.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-19-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop unused memory_read()
Sebastian Reichel [Tue, 15 Dec 2020 10:45:50 +0000 (12:45 +0200)]
drm/omap: dsi: drop unused memory_read()

memory_read is not used, so we can drop the code.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-18-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: use common MIPI DCS 1.3 defines
Sebastian Reichel [Tue, 15 Dec 2020 10:45:49 +0000 (12:45 +0200)]
drm/omap: panel-dsi-cm: use common MIPI DCS 1.3 defines

Drop local definition of common MIPI DCS 1.3 defines.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-17-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: drop hardcoded VC
Sebastian Reichel [Tue, 15 Dec 2020 10:45:48 +0000 (12:45 +0200)]
drm/omap: panel-dsi-cm: drop hardcoded VC

Use dsi->channel everywhere, which originates from DT.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-16-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: request VC via mipi_dsi_attach
Sebastian Reichel [Tue, 15 Dec 2020 10:45:47 +0000 (12:45 +0200)]
drm/omap: dsi: request VC via mipi_dsi_attach

Drop custom request_vc/release_vc callbacks by using the
generic mipi_dsi_attach/mipi_dsi_detach functions.

To use mipi_dsi_attach() we need to fill in the mipi_dsi_device fields,
and some of these fields overlap with the fields in omap_dss_dsi_config.
In later patches the latter will get dropped.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-15-tomi.valkeinen@ti.com
3 years agodrm/omap: panel-dsi-cm: use DSI helpers
Sebastian Reichel [Tue, 15 Dec 2020 10:45:46 +0000 (12:45 +0200)]
drm/omap: panel-dsi-cm: use DSI helpers

After converting the driver to mipi_dsi_device we can use the generic
message helpers to simplify the driver a lot.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-14-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: introduce mipi_dsi_host
Sebastian Reichel [Tue, 15 Dec 2020 10:45:45 +0000 (12:45 +0200)]
drm/omap: dsi: introduce mipi_dsi_host

This moves from custom platform driver infrastructure to mipi_dsi_host
and mipi_dsi_device. Note, that this is a graduate step and the driver
only uses the devices types and transfer function, but not yet the new
device binding style or drm_panel.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-13-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg
Sebastian Reichel [Tue, 15 Dec 2020 10:45:44 +0000 (12:45 +0200)]
drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg

Simplify the DSI encoder by using mipi_dsi_msg for
dsi_vc_send_long and dsi_vc_send_short. Further improvements
require cleaning up the channel allocation code first.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-12-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: simplify read functions
Sebastian Reichel [Tue, 15 Dec 2020 10:45:43 +0000 (12:45 +0200)]
drm/omap: dsi: simplify read functions

Simplify the read related message handling by using the functionality
provided by CONFIG_DRM_MIPI_DSI.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-11-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: simplify write function
Sebastian Reichel [Tue, 15 Dec 2020 10:45:42 +0000 (12:45 +0200)]
drm/omap: dsi: simplify write function

Simplify the write related messages handling by using the functionality
provided by CONFIG_DRM_MIPI_DSI.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-10-tomi.valkeinen@ti.com
3 years agodrm/omap: dsi: drop virtual channel logic
Sebastian Reichel [Tue, 15 Dec 2020 10:45:41 +0000 (12:45 +0200)]
drm/omap: dsi: drop virtual channel logic

This drops the virtual channel logic. Afterwards DSI clients
request their channel number and get the virtual channel with
the same number or -EBUSY if already in use.

The change here is not strictly speaking correct, as it combines the VC
(DSI's "configuration block") and virtual channel ID (the ID sent in the
DSI packets). But as we currently only support a single DSI command mode
panel, this works fine: we always use VC0, and VC ID 0.

This needs more work to support video mode panels, but that can be done
after moving to DRM bridge and panel model, after which we can do that
work with the proper APIs.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201215104657.802264-9-tomi.valkeinen@ti.com