From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-22 14:03:14
This series convert Allwinner DSI controller to full functional
drm bridge driver for supporting slave panel, bridges.
Here, are the previous version changes[1].
Patch 1: use drm_of_find_panel_or_bridge API
Patch 2: Adding DRM Bridge support
Patch 3: Convert to bridge driver, that indeed drop
encoder API's and support bridge API's
Patch 4: Overlay patch for bridge enablement in BPI-M2M
Note: Only nit on this series is kms hotplug, added Samuel Holland
for reviews and comments as he is authorized the code before.
[1] https://lkml.org/lkml/2021/2/14/173
Any inputs on this would be appreciated!
Jagan.
Jagan Teki (4):
drm: sun4i: dsi: Use drm_of_find_panel_or_bridge
drm: sun4i: dsi: Add bridge support
drm: sun4i: dsi: Convert to bridge driver
[DO NOT MERGE] ARM: dts: sun8i: bananapi-m2m: Enable S070WV20-CT16 panel
arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 85 ++++++++++++++++
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 100 +++++++++++++------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 8 +-
3 files changed, 160 insertions(+), 33 deletions(-)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-22 14:03:14
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4, v3:
- none
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-22 14:03:14
Some display panels would come up with a non-DSI output which
can have an option to connect DSI interface by means of bridge
converter.
This DSI to non-DSI bridge converter would require a bridge
driver that would communicate the DSI controller for bridge
functionalities.
So, add support for bridge functionalities in Allwinner DSI
controller.
Cc: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Note:
Samuel Holland, The existing kms hotplug dropped in order to
attach the bridge properly.
However, I did try several ways to support hotplug with the
bridge but it's resulting in a deadlock where bind never attach
bridge until bridge pointer found and bridge pointer cannot
found until bind finishes. Any inputs on this would be appreciated.
Changes for v4:
- none
Changes for v3:
- updated with new API's
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 34 +++++++++++++++++---------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 +-
2 files changed, 23 insertions(+), 13 deletions(-)
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-22 14:03:14
This patch add support for Bananapi S070WV20-CT16 panel to
BPI-M2M board.
Bananapi S070WV20-CT16 is a pure RGB output panel with ICN6211 DSI/RGB
converter bridge, so enable bridge along with associated panel.
DSI panel connected via board DSI port with,
- DCDC1 as VCC-DSI supply
- PL5 gpio for bridge enable gpio pin
- PB7 gpio for lcd enable gpio pin
- PL4 gpio for backlight enable pin
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- replace reset with enable-gpios
Changes for v3:
- none
arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 85 ++++++++++++++++++++
1 file changed, 85 insertions(+)
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-22 14:03:14
DRM bridge drivers have build-in handling of treating all display
pipeline components as bridges.
So, convert the existing to a drm bridge driver with a built-in
encoder support for compatibility with existing component drivers.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- none
Changes for v3:
- new patch
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 75 ++++++++++++++++----------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 6 +++
2 files changed, 54 insertions(+), 27 deletions(-)
Hi Jagan,
Thank you for the patch.
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Hi Jagan,
Thank you for the patch.
On Mon, Mar 22, 2021 at 07:31:50PM +0530, Jagan Teki wrote:
Some display panels would come up with a non-DSI output which
Did you mean input instead of output ?
quoted hunk
can have an option to connect DSI interface by means of bridge
converter.
This DSI to non-DSI bridge converter would require a bridge
driver that would communicate the DSI controller for bridge
functionalities.
So, add support for bridge functionalities in Allwinner DSI
controller.
Cc: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Note:
Samuel Holland, The existing kms hotplug dropped in order to
attach the bridge properly.
However, I did try several ways to support hotplug with the
bridge but it's resulting in a deadlock where bind never attach
bridge until bridge pointer found and bridge pointer cannot
found until bind finishes. Any inputs on this would be appreciated.
Changes for v4:
- none
Changes for v3:
- updated with new API's
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 34 +++++++++++++++++---------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 +-
2 files changed, 23 insertions(+), 13 deletions(-)
Instead of having code paths that depend on whether you have a panel or
a bridge, it would be better to wrap the panel a bridge (using
drivers/gpu/drm/bridge/panel.c). The dsi->panel_bridge pointer should be
renamed to next_bridge, and all the code (except in probe) can the use
next_bridge without caring if it's a direct connection to a panel or
another bridge.
Furthermore, the encoder should call bridge functions explicitly, this
should be handled by the DRM core.
Hi Jagan,
Thank you for the patch.
On Mon, Mar 22, 2021 at 07:31:51PM +0530, Jagan Teki wrote:
DRM bridge drivers have build-in handling of treating all display
pipeline components as bridges.
So, convert the existing to a drm bridge driver with a built-in
encoder support for compatibility with existing component drivers.
It would be best if possible to move this patch before 2/4, to first
convert to the bridge model, and then build on top of it.
quoted hunk
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- none
Changes for v3:
- new patch
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 75 ++++++++++++++++----------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 6 +++
2 files changed, 54 insertions(+), 27 deletions(-)
From: Samuel Holland <samuel@sholland.org> Date: 2021-03-24 02:50:20
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
Hi Jagan,
Thank you for the patch.
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
Regards,
Samuel
quoted
+ if (ret)
+ return ret;
- if (IS_ERR(panel))
- return PTR_ERR(panel);
if (!dsi->drm || !dsi->drm->registered)
return -EPROBE_DEFER;
From: Samuel Holland <samuel@sholland.org> Date: 2021-03-24 03:02:07
On 3/22/21 9:01 AM, Jagan Teki wrote:
Some display panels would come up with a non-DSI output which
can have an option to connect DSI interface by means of bridge
converter.
This DSI to non-DSI bridge converter would require a bridge
driver that would communicate the DSI controller for bridge
functionalities.
So, add support for bridge functionalities in Allwinner DSI
controller.
Cc: Samuel Holland <samuel@sholland.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Note:
Samuel Holland, The existing kms hotplug dropped in order to
attach the bridge properly.
However, I did try several ways to support hotplug with the
bridge but it's resulting in a deadlock where bind never attach
bridge until bridge pointer found and bridge pointer cannot
found until bind finishes. Any inputs on this would be appreciated.
The intended behavior is that sun6i_dsi_bind() is independent of any DSI
device. And sun6i_dsi_attach() must only be called after bind completes
and the DRM device is registered. This design allows the rest of the
display engine (such as the HDMI output) to work even if no panel is
listed in the device tree, or if a panel driver is missing.
quoted hunk
Changes for v4:
- none
Changes for v3:
- updated with new API's
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 34 +++++++++++++++++---------
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 2 +-
2 files changed, 23 insertions(+), 13 deletions(-)
You initialize dsi->panel_bridge in sun6i_dsi_attach() above, but that
function may run long after sun6i_dsi_bind() has completed -- for
example if this driver is built in, but the panel/bridge driver is built
as a module. So you cannot reference dsi->panel_bridge from this function.
Regards,
Samuel
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-24 09:16:15
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland [off-list ref] wrote:
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
quoted
Hi Jagan,
Thank you for the patch.
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
Hi Jagan,
On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote:
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote:
quoted
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
quoted
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
DT is an ABI, we need to ensure backward compatibility. Changes in
kernel drivers can't break devices that have an old DT.
--
Regards,
Laurent Pinchart
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Jagan Teki <jagan@amarulasolutions.com> Date: 2021-03-24 09:50:17
Hi Laurent,
On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart
[off-list ref] wrote:
Hi Jagan,
On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote:
quoted
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote:
quoted
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
quoted
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
DT is an ABI, we need to ensure backward compatibility. Changes in
kernel drivers can't break devices that have an old DT.
Thanks for your point.
So, we need to choose APIs that would compatible with the old DT and
new DT changes. Am I correct?
Jagan.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Jagan,
On Wed, Mar 24, 2021 at 03:19:10PM +0530, Jagan Teki wrote:
On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart wrote:
quoted
On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote:
quoted
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote:
quoted
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
quoted
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
From: Maxime Ripard <hidden> Date: 2021-03-24 10:12:11
On Wed, Mar 24, 2021 at 11:55:35AM +0200, Laurent Pinchart wrote:
Hi Jagan,
On Wed, Mar 24, 2021 at 03:19:10PM +0530, Jagan Teki wrote:
quoted
On Wed, Mar 24, 2021 at 3:09 PM Laurent Pinchart wrote:
quoted
On Wed, Mar 24, 2021 at 02:44:57PM +0530, Jagan Teki wrote:
quoted
On Wed, Mar 24, 2021 at 8:18 AM Samuel Holland wrote:
quoted
On 3/23/21 5:53 PM, Laurent Pinchart wrote:
quoted
On Mon, Mar 22, 2021 at 07:31:49PM +0530, Jagan Teki wrote:
quoted
Replace of_drm_find_panel with drm_of_find_panel_or_bridge
for finding panel, this indeed help to find the bridge if
bridge support added.
Added NULL in bridge argument, same will replace with bridge
parameter once bridge supported.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Looks good, there should be no functional change.
Actually this breaks all existing users of this driver, see below.
@@ -963,10 +964,14 @@ static int sun6i_dsi_attach(struct mipi_dsi_host *host,structmipi_dsi_device*device){structsun6i_dsi*dsi=host_to_sun6i_dsi(host);-structdrm_panel*panel=of_drm_find_panel(device->dev.of_node);
This is using the OF node of the DSI device, which is a direct child of
the DSI host's OF node. There is no OF graph involved.
quoted
quoted
+ struct drm_panel *panel;
+ int ret;
+
+ ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 0, 0,
+ &panel, NULL);
However, this function expects to find the panel using OF graph. This
does not work with existing device trees (PinePhone, PineTab) which do
not use OF graph to connect the panel. And it cannot work, because the
DSI host's binding specifies a single port: the input port from the
display engine.
DT is an ABI, we need to ensure backward compatibility. Changes in
kernel drivers can't break devices that have an old DT.
Thanks for your point.
So, we need to choose APIs that would compatible with the old DT and
new DT changes. Am I correct?
Yes, that's correct.
However, I see no particular reason to change the DT binding in this
case. The DSI devices are supposed to be described through a subnode of
their DSI controller, that's the generic binding and except for very odd
devices (and a bridge like this one is certainly not one), I see no
reason to deviate from that.
Maxime