* [PATCH v3 01/12] dt-bindings: display: fsl-imx-drm: drop edid property support
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 02/12] dt-bindings: display: imx/ldb: drop ddc-i2c-bus property Dmitry Baryshkov
` (13 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
None of the in-kernel DT files ever used edid override with the
fsl-imx-drm driver. In case the EDID needs to be specified manually, DRM
core allows one to either override it via the debugfs or to load it via
request_firmware by using DRM_LOAD_EDID_FIRMWARE. In all other cases
EDID and/or modes are to be provided as a part of the panel driver.
Drop the edid property from the fsl-imx-drm bindings.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt b/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt
index 3c35338a2867..269b1ae2fca9 100644
--- a/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt
+++ b/Documentation/devicetree/bindings/display/imx/fsl-imx-drm.txt
@@ -119,7 +119,6 @@ Optional properties:
- interface-pix-fmt: How this display is connected to the
display interface. Currently supported types: "rgb24", "rgb565", "bgr666"
and "lvds666".
-- edid: verbatim EDID data block describing attached display.
- ddc: phandle describing the i2c bus handling the display data
channel
- port@[0-1]: Port nodes with endpoint definitions as defined in
@@ -131,7 +130,6 @@ example:
disp0 {
compatible = "fsl,imx-parallel-display";
- edid = [edid-data];
interface-pix-fmt = "rgb24";
port@0 {
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 02/12] dt-bindings: display: imx/ldb: drop ddc-i2c-bus property
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 01/12] dt-bindings: display: fsl-imx-drm: drop edid property support Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 03/12] drm/imx: cleanup the imx-drm header Dmitry Baryshkov
` (12 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
The in-kernel DT files do not use ddc-i2c-bus property with the iMX LVDS
Display Bridge. If in future a need arises to support such usecase, the
panel-simple should be used, which is able to handle the DDC bus.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Documentation/devicetree/bindings/display/imx/ldb.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/display/imx/ldb.txt b/Documentation/devicetree/bindings/display/imx/ldb.txt
index 8e6e7d797943..03653a291b54 100644
--- a/Documentation/devicetree/bindings/display/imx/ldb.txt
+++ b/Documentation/devicetree/bindings/display/imx/ldb.txt
@@ -62,7 +62,6 @@ Required properties:
display-timings are used instead.
Optional properties (required if display-timings are used):
- - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
- display-timings : A node that describes the display timings as defined in
Documentation/devicetree/bindings/display/panel/display-timing.txt.
- fsl,data-mapping : should be "spwg" or "jeida"
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 03/12] drm/imx: cleanup the imx-drm header
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 01/12] dt-bindings: display: fsl-imx-drm: drop edid property support Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 02/12] dt-bindings: display: imx/ldb: drop ddc-i2c-bus property Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 04/12] drm/imx: parallel-display: drop edid override support Dmitry Baryshkov
` (11 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Drop unused defines and obsolete prototypes from the imx-drm.h header.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/imx-drm.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm.h b/drivers/gpu/drm/imx/ipuv3/imx-drm.h
index e721bebda2bd..e01f026047de 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-drm.h
+++ b/drivers/gpu/drm/imx/ipuv3/imx-drm.h
@@ -3,14 +3,9 @@
#define _IMX_DRM_H_
struct device_node;
-struct drm_crtc;
struct drm_connector;
struct drm_device;
-struct drm_display_mode;
struct drm_encoder;
-struct drm_framebuffer;
-struct drm_plane;
-struct platform_device;
struct imx_crtc_state {
struct drm_crtc_state base;
@@ -24,16 +19,9 @@ static inline struct imx_crtc_state *to_imx_crtc_state(struct drm_crtc_state *s)
{
return container_of(s, struct imx_crtc_state, base);
}
-int imx_drm_init_drm(struct platform_device *pdev,
- int preferred_bpp);
-int imx_drm_exit_drm(void);
extern struct platform_driver ipu_drm_driver;
-void imx_drm_mode_config_init(struct drm_device *drm);
-
-struct drm_gem_dma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb);
-
int imx_drm_encoder_parse_of(struct drm_device *drm,
struct drm_encoder *encoder, struct device_node *np);
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 04/12] drm/imx: parallel-display: drop edid override support
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (2 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 03/12] drm/imx: cleanup the imx-drm header Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 05/12] drm/imx: ldb: drop custom EDID support Dmitry Baryshkov
` (10 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
None of the in-kernel DT files ever used edid override with the
fsl-imx-drm driver. In case the EDID needs to be specified manually, DRM
core allows one to either override it via the debugfs or to load it via
request_firmware by using DRM_LOAD_EDID_FIRMWARE. In all other cases
EDID and/or modes are to be provided as a part of the panel driver.
Drop support for the edid property.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index 55dedd73f528..4d17fb96e77c 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -16,7 +16,6 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
@@ -34,7 +33,6 @@ struct imx_parallel_display_encoder {
struct imx_parallel_display {
struct device *dev;
- void *edid;
u32 bus_format;
u32 bus_flags;
struct drm_display_mode mode;
@@ -62,11 +60,6 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
if (num_modes > 0)
return num_modes;
- if (imxpd->edid) {
- drm_connector_update_edid_property(connector, imxpd->edid);
- num_modes = drm_add_edid_modes(connector, imxpd->edid);
- }
-
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
int ret;
@@ -312,9 +305,7 @@ static int imx_pd_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
- const u8 *edidp;
struct imx_parallel_display *imxpd;
- int edid_len;
int ret;
u32 bus_format = 0;
const char *fmt;
@@ -329,10 +320,6 @@ static int imx_pd_probe(struct platform_device *pdev)
if (ret && ret != -ENODEV)
return ret;
- edidp = of_get_property(np, "edid", &edid_len);
- if (edidp)
- imxpd->edid = devm_kmemdup(dev, edidp, edid_len, GFP_KERNEL);
-
ret = of_property_read_string(np, "interface-pix-fmt", &fmt);
if (!ret) {
if (!strcmp(fmt, "rgb24"))
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 05/12] drm/imx: ldb: drop custom EDID support
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (3 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 04/12] drm/imx: parallel-display: drop edid override support Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 06/12] drm/imx: ldb: drop custom DDC bus support Dmitry Baryshkov
` (9 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Bindings for the imx-ldb never allowed specifying the EDID in DT. None
of the existing DT files use it. Drop it now in favour of using debugfs
overrides or the drm.edid_firmware support.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index 793dfb1a3ed0..1924d8921c62 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -72,7 +72,6 @@ struct imx_ldb_channel {
struct device_node *child;
struct i2c_adapter *ddc;
int chno;
- const struct drm_edid *drm_edid;
struct drm_display_mode mode;
int mode_valid;
u32 bus_format;
@@ -142,14 +141,17 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
if (num_modes > 0)
return num_modes;
- if (!imx_ldb_ch->drm_edid && imx_ldb_ch->ddc) {
- imx_ldb_ch->drm_edid = drm_edid_read_ddc(connector,
- imx_ldb_ch->ddc);
- drm_edid_connector_update(connector, imx_ldb_ch->drm_edid);
- }
+ if (imx_ldb_ch->ddc) {
+ const struct drm_edid *edid = drm_edid_read_ddc(connector,
+ imx_ldb_ch->ddc);
- if (imx_ldb_ch->drm_edid)
- num_modes = drm_edid_connector_add_modes(connector);
+ if (edid) {
+ drm_edid_connector_update(connector, edid);
+ drm_edid_free(edid);
+
+ return drm_edid_connector_add_modes(connector);
+ }
+ }
if (imx_ldb_ch->mode_valid) {
struct drm_display_mode *mode;
@@ -566,18 +568,10 @@ static int imx_ldb_panel_ddc(struct device *dev,
}
if (!channel->ddc) {
- const void *edidp;
- int edid_len;
-
/* if no DDC available, fallback to hardcoded EDID */
dev_dbg(dev, "no ddc available\n");
- edidp = of_get_property(child, "edid", &edid_len);
- if (edidp) {
- channel->drm_edid = drm_edid_alloc(edidp, edid_len);
- if (!channel->drm_edid)
- return -ENOMEM;
- } else if (!channel->panel) {
+ if (!channel->panel) {
/* fallback to display-timings node */
ret = of_get_drm_display_mode(child,
&channel->mode,
@@ -744,7 +738,6 @@ static void imx_ldb_remove(struct platform_device *pdev)
for (i = 0; i < 2; i++) {
struct imx_ldb_channel *channel = &imx_ldb->channel[i];
- drm_edid_free(channel->drm_edid);
i2c_put_adapter(channel->ddc);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 06/12] drm/imx: ldb: drop custom DDC bus support
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (4 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 05/12] drm/imx: ldb: drop custom EDID support Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-02 12:04 ` [PATCH v3 07/12] drm/imx: ldb: switch to drm_panel_bridge Dmitry Baryshkov
` (8 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
None of the boards ever supported by the upstream kernel used the custom
DDC bus support with the LDB connector. If a need arises to do so, one
should use panel-simple and its DDC bus code. Drop ddc-i2c-bus support
from the imx-ldb driver.
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 73 +++++--------------------------------
1 file changed, 10 insertions(+), 63 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index 1924d8921c62..3f669604377e 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -25,7 +25,6 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
@@ -70,7 +69,6 @@ struct imx_ldb_channel {
struct drm_bridge *bridge;
struct device_node *child;
- struct i2c_adapter *ddc;
int chno;
struct drm_display_mode mode;
int mode_valid;
@@ -141,18 +139,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
if (num_modes > 0)
return num_modes;
- if (imx_ldb_ch->ddc) {
- const struct drm_edid *edid = drm_edid_read_ddc(connector,
- imx_ldb_ch->ddc);
-
- if (edid) {
- drm_edid_connector_update(connector, edid);
- drm_edid_free(edid);
-
- return drm_edid_connector_add_modes(connector);
- }
- }
-
if (imx_ldb_ch->mode_valid) {
struct drm_display_mode *mode;
@@ -481,10 +467,9 @@ static int imx_ldb_register(struct drm_device *drm,
*/
drm_connector_helper_add(connector,
&imx_ldb_connector_helper_funcs);
- drm_connector_init_with_ddc(drm, connector,
- &imx_ldb_connector_funcs,
- DRM_MODE_CONNECTOR_LVDS,
- imx_ldb_ch->ddc);
+ drm_connector_init(drm, connector,
+ &imx_ldb_connector_funcs,
+ DRM_MODE_CONNECTOR_LVDS);
drm_connector_attach_encoder(connector, encoder);
}
@@ -551,39 +536,6 @@ static const struct of_device_id imx_ldb_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, imx_ldb_dt_ids);
-static int imx_ldb_panel_ddc(struct device *dev,
- struct imx_ldb_channel *channel, struct device_node *child)
-{
- struct device_node *ddc_node;
- int ret;
-
- ddc_node = of_parse_phandle(child, "ddc-i2c-bus", 0);
- if (ddc_node) {
- channel->ddc = of_find_i2c_adapter_by_node(ddc_node);
- of_node_put(ddc_node);
- if (!channel->ddc) {
- dev_warn(dev, "failed to get ddc i2c adapter\n");
- return -EPROBE_DEFER;
- }
- }
-
- if (!channel->ddc) {
- /* if no DDC available, fallback to hardcoded EDID */
- dev_dbg(dev, "no ddc available\n");
-
- if (!channel->panel) {
- /* fallback to display-timings node */
- ret = of_get_drm_display_mode(child,
- &channel->mode,
- &channel->bus_flags,
- OF_USE_NATIVE_MODE);
- if (!ret)
- channel->mode_valid = 1;
- }
- }
- return 0;
-}
-
static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
{
struct drm_device *drm = data;
@@ -694,11 +646,15 @@ static int imx_ldb_probe(struct platform_device *pdev)
if (ret && ret != -ENODEV)
goto free_child;
- /* panel ddc only if there is no bridge */
- if (!channel->bridge) {
- ret = imx_ldb_panel_ddc(dev, channel, child);
+ if (!channel->bridge && !channel->panel) {
+ ret = of_get_drm_display_mode(child,
+ &channel->mode,
+ &channel->bus_flags,
+ OF_USE_NATIVE_MODE);
if (ret)
goto free_child;
+
+ channel->mode_valid = 1;
}
bus_format = of_get_bus_format(dev, child);
@@ -732,15 +688,6 @@ static int imx_ldb_probe(struct platform_device *pdev)
static void imx_ldb_remove(struct platform_device *pdev)
{
- struct imx_ldb *imx_ldb = platform_get_drvdata(pdev);
- int i;
-
- for (i = 0; i < 2; i++) {
- struct imx_ldb_channel *channel = &imx_ldb->channel[i];
-
- i2c_put_adapter(channel->ddc);
- }
-
component_del(&pdev->dev, &imx_ldb_ops);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 07/12] drm/imx: ldb: switch to drm_panel_bridge
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (5 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 06/12] drm/imx: ldb: drop custom DDC bus support Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
2024-06-02 12:04 ` [PATCH v3 08/12] drm/imx: parallel-display: " Dmitry Baryshkov
` (7 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Defer panel handling to drm_panel_bridge, unifying codepaths for the
panel and bridge cases. The MFD_SYSCON symbol is moved to select to
prevent Kconfig symbol loops.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/Kconfig | 6 +++--
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 44 ++++++++++++-------------------------
2 files changed, 18 insertions(+), 32 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index bacf0655ebaf..6abcf9c833d4 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -26,9 +26,11 @@ config DRM_IMX_TVE
config DRM_IMX_LDB
tristate "Support for LVDS displays"
- depends on DRM_IMX && MFD_SYSCON
+ depends on DRM_IMX
depends on COMMON_CLK
- select DRM_PANEL
+ select MFD_SYSCON
+ select DRM_BRIDGE
+ select DRM_PANEL_BRIDGE
help
Choose this to enable the internal LVDS Display Bridge (LDB)
found on i.MX53 and i.MX6 processors.
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index 3f669604377e..bc7ad9697130 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -27,7 +27,6 @@
#include <drm/drm_bridge.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
-#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
@@ -64,8 +63,6 @@ struct imx_ldb;
struct imx_ldb_channel {
struct imx_ldb *ldb;
- /* Defines what is connected to the ldb, only one at a time */
- struct drm_panel *panel;
struct drm_bridge *bridge;
struct device_node *child;
@@ -135,10 +132,6 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)
struct imx_ldb_channel *imx_ldb_ch = con_to_imx_ldb_ch(connector);
int num_modes;
- num_modes = drm_panel_get_modes(imx_ldb_ch->panel, connector);
- if (num_modes > 0)
- return num_modes;
-
if (imx_ldb_ch->mode_valid) {
struct drm_display_mode *mode;
@@ -193,8 +186,6 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
return;
}
- drm_panel_prepare(imx_ldb_ch->panel);
-
if (dual) {
clk_set_parent(ldb->clk_sel[mux], ldb->clk[0]);
clk_set_parent(ldb->clk_sel[mux], ldb->clk[1]);
@@ -233,8 +224,6 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder)
}
regmap_write(ldb->regmap, IOMUXC_GPR2, ldb->ldb_ctrl);
-
- drm_panel_enable(imx_ldb_ch->panel);
}
static void
@@ -311,8 +300,6 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
int mux, ret;
- drm_panel_disable(imx_ldb_ch->panel);
-
if (imx_ldb_ch == &ldb->channel[0] || dual)
ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK;
if (imx_ldb_ch == &ldb->channel[1] || dual)
@@ -346,8 +333,6 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
dev_err(ldb->dev,
"unable to set di%d parent clock to original parent\n",
mux);
-
- drm_panel_unprepare(imx_ldb_ch->panel);
}
static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
@@ -640,13 +625,15 @@ static int imx_ldb_probe(struct platform_device *pdev)
* The output port is port@4 with an external 4-port mux or
* port@2 with the internal 2-port mux.
*/
- ret = drm_of_find_panel_or_bridge(child,
- imx_ldb->lvds_mux ? 4 : 2, 0,
- &channel->panel, &channel->bridge);
- if (ret && ret != -ENODEV)
- goto free_child;
+ channel->bridge = devm_drm_of_get_bridge(dev, child,
+ imx_ldb->lvds_mux ? 4 : 2, 0);
+ if (IS_ERR(channel->bridge)) {
+ ret = PTR_ERR(channel->bridge);
+ if (ret != -ENODEV)
+ goto free_child;
+
+ channel->bridge = NULL;
- if (!channel->bridge && !channel->panel) {
ret = of_get_drm_display_mode(child,
&channel->mode,
&channel->bus_flags,
@@ -658,15 +645,12 @@ static int imx_ldb_probe(struct platform_device *pdev)
}
bus_format = of_get_bus_format(dev, child);
- if (bus_format == -EINVAL) {
- /*
- * If no bus format was specified in the device tree,
- * we can still get it from the connected panel later.
- */
- if (channel->panel && channel->panel->funcs &&
- channel->panel->funcs->get_modes)
- bus_format = 0;
- }
+ /*
+ * If no bus format was specified in the device tree,
+ * we can still get it from the connected panel later.
+ */
+ if (bus_format == -EINVAL && channel->bridge)
+ bus_format = 0;
if (bus_format < 0) {
dev_err(dev, "could not determine data mapping: %d\n",
bus_format);
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 07/12] drm/imx: ldb: switch to drm_panel_bridge
2024-06-02 12:04 ` [PATCH v3 07/12] drm/imx: ldb: switch to drm_panel_bridge Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
0 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> Defer panel handling to drm_panel_bridge, unifying codepaths for the
> panel and bridge cases. The MFD_SYSCON symbol is moved to select to
> prevent Kconfig symbol loops.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 08/12] drm/imx: parallel-display: switch to drm_panel_bridge
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (6 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 07/12] drm/imx: ldb: switch to drm_panel_bridge Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
2024-06-02 12:04 ` [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node Dmitry Baryshkov
` (6 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Defer panel handling to drm_panel_bridge, unifying codepaths for the
panel and bridge cases.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/Kconfig | 3 ++-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 36 +++++++---------------------
2 files changed, 10 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index 6abcf9c833d4..f083d313d1d3 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -11,8 +11,9 @@ config DRM_IMX
config DRM_IMX_PARALLEL_DISPLAY
tristate "Support for parallel displays"
- select DRM_PANEL
depends on DRM_IMX
+ select DRM_BRIDGE
+ select DRM_PANEL_BRIDGE
select VIDEOMODE_HELPERS
config DRM_IMX_TVE
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index 4d17fb96e77c..9ac2a94fa62b 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -18,7 +18,6 @@
#include <drm/drm_bridge.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
-#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
@@ -36,7 +35,6 @@ struct imx_parallel_display {
u32 bus_format;
u32 bus_flags;
struct drm_display_mode mode;
- struct drm_panel *panel;
struct drm_bridge *next_bridge;
};
@@ -56,10 +54,6 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
struct device_node *np = imxpd->dev->of_node;
int num_modes;
- num_modes = drm_panel_get_modes(imxpd->panel, connector);
- if (num_modes > 0)
- return num_modes;
-
if (np) {
struct drm_display_mode *mode = drm_mode_create(connector->dev);
int ret;
@@ -84,22 +78,6 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
return num_modes;
}
-static void imx_pd_bridge_enable(struct drm_bridge *bridge)
-{
- struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
-
- drm_panel_prepare(imxpd->panel);
- drm_panel_enable(imxpd->panel);
-}
-
-static void imx_pd_bridge_disable(struct drm_bridge *bridge)
-{
- struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
-
- drm_panel_disable(imxpd->panel);
- drm_panel_unprepare(imxpd->panel);
-}
-
static const u32 imx_pd_bus_fmts[] = {
MEDIA_BUS_FMT_RGB888_1X24,
MEDIA_BUS_FMT_BGR888_1X24,
@@ -237,8 +215,6 @@ static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
};
static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
- .enable = imx_pd_bridge_enable,
- .disable = imx_pd_bridge_disable,
.atomic_reset = drm_atomic_helper_bridge_reset,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -315,10 +291,14 @@ static int imx_pd_probe(struct platform_device *pdev)
return -ENOMEM;
/* port@1 is the output port */
- ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
- &imxpd->next_bridge);
- if (ret && ret != -ENODEV)
- return ret;
+ imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
+ if (IS_ERR(imxpd->next_bridge)) {
+ ret = PTR_ERR(imxpd->next_bridge);
+ if (ret != -ENODEV)
+ return ret;
+
+ imxpd->next_bridge = NULL;
+ }
ret = of_property_read_string(np, "interface-pix-fmt", &fmt);
if (!ret) {
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 08/12] drm/imx: parallel-display: switch to drm_panel_bridge
2024-06-02 12:04 ` [PATCH v3 08/12] drm/imx: parallel-display: " Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
0 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> Defer panel handling to drm_panel_bridge, unifying codepaths for the
> panel and bridge cases.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (7 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 08/12] drm/imx: parallel-display: " Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
2024-06-02 12:04 ` [PATCH v3 10/12] drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector Dmitry Baryshkov
` (5 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
i.MX DRM DT bindings allow using either a proper panel / bridge graph to
provide information about connected panels, or just a display-timings DT
node, describing just the timings and the flags. Add helper bridge
driver supporting the latter usecase. It will be used by both LDB and
parallel-display drivers.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/bridge/imx/Kconfig | 10 +++
drivers/gpu/drm/bridge/imx/Makefile | 1 +
drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c | 85 ++++++++++++++++++++++++++
include/drm/bridge/imx.h | 13 ++++
4 files changed, 109 insertions(+)
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index 8dd89efa8ea7..9a480c6abb85 100644
--- a/drivers/gpu/drm/bridge/imx/Kconfig
+++ b/drivers/gpu/drm/bridge/imx/Kconfig
@@ -3,6 +3,16 @@ if ARCH_MXC || COMPILE_TEST
config DRM_IMX_LDB_HELPER
tristate
+config DRM_IMX_LEGACY_BRIDGE
+ tristate
+ depends on DRM_IMX
+ help
+ This is a DRM bridge implementation for the DRM i.MX IPUv3 driver,
+ that uses of_get_drm_display_mode to acquire display mode.
+
+ Newer designs should not use this bridge and should use proper panel
+ driver instead.
+
config DRM_IMX8MP_DW_HDMI_BRIDGE
tristate "Freescale i.MX8MP HDMI-TX bridge support"
depends on OF
diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile
index edb0a7b71b30..dd5d48584806 100644
--- a/drivers/gpu/drm/bridge/imx/Makefile
+++ b/drivers/gpu/drm/bridge/imx/Makefile
@@ -1,4 +1,5 @@
obj-$(CONFIG_DRM_IMX_LDB_HELPER) += imx-ldb-helper.o
+obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) += imx-legacy-bridge.o
obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) += imx8mp-hdmi-tx.o
obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) += imx8mp-hdmi-pvi.o
obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o
diff --git a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c b/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
new file mode 100644
index 000000000000..fb3a030928f0
--- /dev/null
+++ b/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Freescale i.MX drm driver
+ *
+ * bridge driver for legacy DT bindings, utilizing display-timings node
+ */
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/bridge/imx.h>
+
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+
+struct imx_legacy_bridge {
+ struct drm_bridge base;
+
+ struct drm_display_mode mode;
+ u32 bus_flags;
+};
+
+#define to_imx_legacy_bridge(bridge) container_of(bridge, struct imx_legacy_bridge, base)
+
+static int imx_legacy_bridge_attach(struct drm_bridge *bridge,
+ enum drm_bridge_attach_flags flags)
+{
+ if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+ return -EINVAL;
+
+ return 0;
+}
+
+static int imx_legacy_bridge_get_modes(struct drm_bridge *bridge,
+ struct drm_connector *connector)
+{
+ struct imx_legacy_bridge *imx_bridge = to_imx_legacy_bridge(bridge);
+ int ret;
+
+ ret = drm_connector_helper_get_modes_fixed(connector, &imx_bridge->mode);
+ if (ret)
+ return ret;
+
+ connector->display_info.bus_flags = imx_bridge->bus_flags;
+
+ return 0;
+}
+
+struct drm_bridge_funcs imx_legacy_bridge_funcs = {
+ .attach = imx_legacy_bridge_attach,
+ .get_modes = imx_legacy_bridge_get_modes,
+};
+
+struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
+ struct device_node *np,
+ int type)
+{
+ struct imx_legacy_bridge *imx_bridge;
+ int ret;
+
+ imx_bridge = devm_kzalloc(dev, sizeof(*imx_bridge), GFP_KERNEL);
+ if (!imx_bridge)
+ return ERR_PTR(-ENOMEM);
+
+ ret = of_get_drm_display_mode(np,
+ &imx_bridge->mode,
+ &imx_bridge->bus_flags,
+ OF_USE_NATIVE_MODE);
+ if (ret)
+ return ERR_PTR(ret);
+
+ imx_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
+
+ imx_bridge->base.funcs = &imx_legacy_bridge_funcs;
+ imx_bridge->base.of_node = np;
+ imx_bridge->base.ops = DRM_BRIDGE_OP_MODES;
+ imx_bridge->base.type = type;
+
+ ret = devm_drm_bridge_add(dev, &imx_bridge->base);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return &imx_bridge->base;
+}
+EXPORT_SYMBOL_GPL(devm_imx_drm_legacy_bridge);
diff --git a/include/drm/bridge/imx.h b/include/drm/bridge/imx.h
new file mode 100644
index 000000000000..e14f429a9ca2
--- /dev/null
+++ b/include/drm/bridge/imx.h
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ */
+
+#ifndef DRM_IMX_BRIDGE_H
+#define DRM_IMX_BRIDGE_H
+
+struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
+ struct device_node *np,
+ int type);
+
+#endif
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node
2024-06-02 12:04 ` [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
0 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> i.MX DRM DT bindings allow using either a proper panel / bridge graph to
> provide information about connected panels, or just a display-timings DT
> node, describing just the timings and the flags. Add helper bridge
> driver supporting the latter usecase. It will be used by both LDB and
> parallel-display drivers.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 10/12] drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (8 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 09/12] drm/imx: add internal bridge handling display-timings DT node Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
2024-06-02 12:04 ` [PATCH v3 11/12] drm/imx: parallel-display: " Dmitry Baryshkov
` (4 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Use the imx_legacy bridge driver instead of handlign display modes via
the connector node.
All existing usecases already support attaching using
the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag, while the imx_legacy bridge
doesn't support creating connector at all. Switch to
drm_bridge_connector at the same time.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/Kconfig | 1 +
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 103 ++++++++++--------------------------
2 files changed, 30 insertions(+), 74 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index f083d313d1d3..5a40c878ebb0 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -32,6 +32,7 @@ config DRM_IMX_LDB
select MFD_SYSCON
select DRM_BRIDGE
select DRM_PANEL_BRIDGE
+ select DRM_IMX_LEGACY_BRIDGE
help
Choose this to enable the internal LVDS Display Bridge (LDB)
found on i.MX53 and i.MX6 processors.
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index bc7ad9697130..ff74018ac5cd 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -19,17 +19,16 @@
#include <linux/regmap.h>
#include <linux/videodev2.h>
-#include <video/of_display_timing.h>
-#include <video/of_videomode.h>
-
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
+#include <drm/bridge/imx.h>
#include "imx-drm.h"
@@ -53,7 +52,6 @@
struct imx_ldb_channel;
struct imx_ldb_encoder {
- struct drm_connector connector;
struct drm_encoder encoder;
struct imx_ldb_channel *channel;
};
@@ -67,17 +65,9 @@ struct imx_ldb_channel {
struct device_node *child;
int chno;
- struct drm_display_mode mode;
- int mode_valid;
u32 bus_format;
- u32 bus_flags;
};
-static inline struct imx_ldb_channel *con_to_imx_ldb_ch(struct drm_connector *c)
-{
- return container_of(c, struct imx_ldb_encoder, connector)->channel;
-}
-
static inline struct imx_ldb_channel *enc_to_imx_ldb_ch(struct drm_encoder *e)
{
return container_of(e, struct imx_ldb_encoder, encoder)->channel;
@@ -127,25 +117,6 @@ static void imx_ldb_ch_set_bus_format(struct imx_ldb_channel *imx_ldb_ch,
}
}
-static int imx_ldb_connector_get_modes(struct drm_connector *connector)
-{
- struct imx_ldb_channel *imx_ldb_ch = con_to_imx_ldb_ch(connector);
- int num_modes;
-
- if (imx_ldb_ch->mode_valid) {
- struct drm_display_mode *mode;
-
- mode = drm_mode_duplicate(connector->dev, &imx_ldb_ch->mode);
- if (!mode)
- return -EINVAL;
- mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
- drm_mode_probed_add(connector, mode);
- num_modes++;
- }
-
- return num_modes;
-}
-
static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno,
unsigned long serial_clk, unsigned long di_clk)
{
@@ -347,11 +318,12 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
/* Bus format description in DT overrides connector display info. */
if (!bus_format && di->num_bus_formats) {
bus_format = di->bus_formats[0];
- imx_crtc_state->bus_flags = di->bus_flags;
} else {
bus_format = imx_ldb_ch->bus_format;
- imx_crtc_state->bus_flags = imx_ldb_ch->bus_flags;
}
+
+ imx_crtc_state->bus_flags = di->bus_flags;
+
switch (bus_format) {
case MEDIA_BUS_FMT_RGB666_1X7X3_SPWG:
imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
@@ -371,18 +343,6 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
}
-static const struct drm_connector_funcs imx_ldb_connector_funcs = {
- .fill_modes = drm_helper_probe_single_connector_modes,
- .destroy = imx_drm_connector_destroy,
- .reset = drm_atomic_helper_connector_reset,
- .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
- .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
-};
-
-static const struct drm_connector_helper_funcs imx_ldb_connector_helper_funcs = {
- .get_modes = imx_ldb_connector_get_modes,
-};
-
static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = {
.atomic_mode_set = imx_ldb_encoder_atomic_mode_set,
.enable = imx_ldb_encoder_enable,
@@ -420,7 +380,6 @@ static int imx_ldb_register(struct drm_device *drm,
return PTR_ERR(ldb_encoder);
ldb_encoder->channel = imx_ldb_ch;
- connector = &ldb_encoder->connector;
encoder = &ldb_encoder->encoder;
ret = imx_drm_encoder_parse_of(drm, encoder, imx_ldb_ch->child);
@@ -439,24 +398,16 @@ static int imx_ldb_register(struct drm_device *drm,
drm_encoder_helper_add(encoder, &imx_ldb_encoder_helper_funcs);
- if (imx_ldb_ch->bridge) {
- ret = drm_bridge_attach(encoder, imx_ldb_ch->bridge, NULL, 0);
- if (ret)
- return ret;
- } else {
- /*
- * We want to add the connector whenever there is no bridge
- * that brings its own, not only when there is a panel. For
- * historical reasons, the ldb driver can also work without
- * a panel.
- */
- drm_connector_helper_add(connector,
- &imx_ldb_connector_helper_funcs);
- drm_connector_init(drm, connector,
- &imx_ldb_connector_funcs,
- DRM_MODE_CONNECTOR_LVDS);
- drm_connector_attach_encoder(connector, encoder);
- }
+ ret = drm_bridge_attach(encoder, imx_ldb_ch->bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ if (ret)
+ return ret;
+
+ connector = drm_bridge_connector_init(drm, encoder);
+ if (IS_ERR(connector))
+ return PTR_ERR(connector);
+
+ drm_connector_attach_encoder(connector, encoder);
return 0;
}
@@ -631,17 +582,7 @@ static int imx_ldb_probe(struct platform_device *pdev)
ret = PTR_ERR(channel->bridge);
if (ret != -ENODEV)
goto free_child;
-
channel->bridge = NULL;
-
- ret = of_get_drm_display_mode(child,
- &channel->mode,
- &channel->bus_flags,
- OF_USE_NATIVE_MODE);
- if (ret)
- goto free_child;
-
- channel->mode_valid = 1;
}
bus_format = of_get_bus_format(dev, child);
@@ -658,6 +599,20 @@ static int imx_ldb_probe(struct platform_device *pdev)
goto free_child;
}
channel->bus_format = bus_format;
+
+ /*
+ * legacy bridge doesn't handle bus_format, so create it after
+ * checking the bus_format property.
+ */
+ if (!channel->bridge) {
+ channel->bridge = devm_imx_drm_legacy_bridge(dev, child,
+ DRM_MODE_CONNECTOR_LVDS);
+ if (IS_ERR(channel->bridge)) {
+ ret = PTR_ERR(channel->bridge);
+ goto free_child;
+ }
+ }
+
channel->child = child;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 10/12] drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector
2024-06-02 12:04 ` [PATCH v3 10/12] drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
0 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> Use the imx_legacy bridge driver instead of handlign display modes via
> the connector node.
>
> All existing usecases already support attaching using
> the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag, while the imx_legacy bridge
> doesn't support creating connector at all. Switch to
> drm_bridge_connector at the same time.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 11/12] drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (9 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 10/12] drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-06-03 3:05 ` Chris Healy
2024-08-09 11:00 ` Philipp Zabel
2024-06-02 12:04 ` [PATCH v3 12/12] drm/imx: move imx_drm_connector_destroy to imx-tve Dmitry Baryshkov
` (3 subsequent siblings)
14 siblings, 2 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
Use the imx_legacy bridge driver instead of handlign display modes via
the connector node.
All existing usecases already support attaching using
the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag, while the imx_legacy bridge
doesn't support creating connector at all. Switch to
drm_bridge_connector at the same time.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 100 ++++++---------------------
1 file changed, 20 insertions(+), 80 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index 9ac2a94fa62b..70f62e89622e 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -12,19 +12,18 @@
#include <linux/platform_device.h>
#include <linux/videodev2.h>
-#include <video/of_display_timing.h>
-
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_managed.h>
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>
+#include <drm/bridge/imx.h>
#include "imx-drm.h"
struct imx_parallel_display_encoder {
- struct drm_connector connector;
struct drm_encoder encoder;
struct drm_bridge bridge;
struct imx_parallel_display *pd;
@@ -33,51 +32,14 @@ struct imx_parallel_display_encoder {
struct imx_parallel_display {
struct device *dev;
u32 bus_format;
- u32 bus_flags;
- struct drm_display_mode mode;
struct drm_bridge *next_bridge;
};
-static inline struct imx_parallel_display *con_to_imxpd(struct drm_connector *c)
-{
- return container_of(c, struct imx_parallel_display_encoder, connector)->pd;
-}
-
static inline struct imx_parallel_display *bridge_to_imxpd(struct drm_bridge *b)
{
return container_of(b, struct imx_parallel_display_encoder, bridge)->pd;
}
-static int imx_pd_connector_get_modes(struct drm_connector *connector)
-{
- struct imx_parallel_display *imxpd = con_to_imxpd(connector);
- struct device_node *np = imxpd->dev->of_node;
- int num_modes;
-
- if (np) {
- struct drm_display_mode *mode = drm_mode_create(connector->dev);
- int ret;
-
- if (!mode)
- return 0;
-
- ret = of_get_drm_display_mode(np, &imxpd->mode,
- &imxpd->bus_flags,
- OF_USE_NATIVE_MODE);
- if (ret) {
- drm_mode_destroy(connector->dev, mode);
- return 0;
- }
-
- drm_mode_copy(mode, &imxpd->mode);
- mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
- drm_mode_probed_add(connector, mode);
- num_modes++;
- }
-
- return num_modes;
-}
-
static const u32 imx_pd_bus_fmts[] = {
MEDIA_BUS_FMT_RGB888_1X24,
MEDIA_BUS_FMT_BGR888_1X24,
@@ -171,7 +133,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
{
struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
struct drm_display_info *di = &conn_state->connector->display_info;
- struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
struct drm_bridge_state *next_bridge_state = NULL;
struct drm_bridge *next_bridge;
u32 bus_flags, bus_fmt;
@@ -183,10 +144,8 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
if (next_bridge_state)
bus_flags = next_bridge_state->input_bus_cfg.flags;
- else if (di->num_bus_formats)
- bus_flags = di->bus_flags;
else
- bus_flags = imxpd->bus_flags;
+ bus_flags = di->bus_flags;
bus_fmt = bridge_state->input_bus_cfg.format;
if (!imx_pd_format_supported(bus_fmt))
@@ -202,19 +161,16 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
return 0;
}
-static const struct drm_connector_funcs imx_pd_connector_funcs = {
- .fill_modes = drm_helper_probe_single_connector_modes,
- .destroy = imx_drm_connector_destroy,
- .reset = drm_atomic_helper_connector_reset,
- .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
- .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
-};
+static int imx_pd_bridge_attach(struct drm_bridge *bridge,
+ enum drm_bridge_attach_flags flags)
+{
+ struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
-static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
- .get_modes = imx_pd_connector_get_modes,
-};
+ return drm_bridge_attach(bridge->encoder, imxpd->next_bridge, bridge, flags);
+}
static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
+ .attach = imx_pd_bridge_attach,
.atomic_reset = drm_atomic_helper_bridge_reset,
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
@@ -239,7 +195,6 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(imxpd_encoder);
imxpd_encoder->pd = imxpd;
- connector = &imxpd_encoder->connector;
encoder = &imxpd_encoder->encoder;
bridge = &imxpd_encoder->bridge;
@@ -247,28 +202,14 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
if (ret)
return ret;
- /* set the connector's dpms to OFF so that
- * drm_helper_connector_dpms() won't return
- * immediately since the current state is ON
- * at this point.
- */
- connector->dpms = DRM_MODE_DPMS_OFF;
-
bridge->funcs = &imx_pd_bridge_funcs;
- drm_bridge_attach(encoder, bridge, NULL, 0);
-
- if (imxpd->next_bridge) {
- ret = drm_bridge_attach(encoder, imxpd->next_bridge, bridge, 0);
- if (ret < 0)
- return ret;
- } else {
- drm_connector_helper_add(connector,
- &imx_pd_connector_helper_funcs);
- drm_connector_init(drm, connector, &imx_pd_connector_funcs,
- DRM_MODE_CONNECTOR_DPI);
-
- drm_connector_attach_encoder(connector, encoder);
- }
+ drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+
+ connector = drm_bridge_connector_init(drm, encoder);
+ if (IS_ERR(connector))
+ return PTR_ERR(connector);
+
+ drm_connector_attach_encoder(connector, encoder);
return 0;
}
@@ -292,12 +233,11 @@ static int imx_pd_probe(struct platform_device *pdev)
/* port@1 is the output port */
imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
+ if (imxpd->next_bridge == ERR_PTR(-ENODEV))
+ imxpd->next_bridge = devm_imx_drm_legacy_bridge(dev, np, DRM_MODE_CONNECTOR_DPI);
if (IS_ERR(imxpd->next_bridge)) {
ret = PTR_ERR(imxpd->next_bridge);
- if (ret != -ENODEV)
- return ret;
-
- imxpd->next_bridge = NULL;
+ return ret;
}
ret = of_property_read_string(np, "interface-pix-fmt", &fmt);
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 11/12] drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
2024-06-02 12:04 ` [PATCH v3 11/12] drm/imx: parallel-display: " Dmitry Baryshkov
@ 2024-06-03 3:05 ` Chris Healy
2024-08-09 11:00 ` Philipp Zabel
1 sibling, 0 replies; 27+ messages in thread
From: Chris Healy @ 2024-06-03 3:05 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, dri-devel, devicetree,
imx, linux-arm-kernel
On Sun, Jun 2, 2024 at 5:04 AM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> Use the imx_legacy bridge driver instead of handlign display modes via
> the connector node.
fix spelling of "handling"
>
> All existing usecases already support attaching using
> the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag, while the imx_legacy bridge
> doesn't support creating connector at all. Switch to
> drm_bridge_connector at the same time.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 100 ++++++---------------------
> 1 file changed, 20 insertions(+), 80 deletions(-)
>
> diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
> index 9ac2a94fa62b..70f62e89622e 100644
> --- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
> +++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
> @@ -12,19 +12,18 @@
> #include <linux/platform_device.h>
> #include <linux/videodev2.h>
>
> -#include <video/of_display_timing.h>
> -
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_bridge.h>
> +#include <drm/drm_bridge_connector.h>
> #include <drm/drm_managed.h>
> #include <drm/drm_of.h>
> #include <drm/drm_probe_helper.h>
> #include <drm/drm_simple_kms_helper.h>
> +#include <drm/bridge/imx.h>
>
> #include "imx-drm.h"
>
> struct imx_parallel_display_encoder {
> - struct drm_connector connector;
> struct drm_encoder encoder;
> struct drm_bridge bridge;
> struct imx_parallel_display *pd;
> @@ -33,51 +32,14 @@ struct imx_parallel_display_encoder {
> struct imx_parallel_display {
> struct device *dev;
> u32 bus_format;
> - u32 bus_flags;
> - struct drm_display_mode mode;
> struct drm_bridge *next_bridge;
> };
>
> -static inline struct imx_parallel_display *con_to_imxpd(struct drm_connector *c)
> -{
> - return container_of(c, struct imx_parallel_display_encoder, connector)->pd;
> -}
> -
> static inline struct imx_parallel_display *bridge_to_imxpd(struct drm_bridge *b)
> {
> return container_of(b, struct imx_parallel_display_encoder, bridge)->pd;
> }
>
> -static int imx_pd_connector_get_modes(struct drm_connector *connector)
> -{
> - struct imx_parallel_display *imxpd = con_to_imxpd(connector);
> - struct device_node *np = imxpd->dev->of_node;
> - int num_modes;
> -
> - if (np) {
> - struct drm_display_mode *mode = drm_mode_create(connector->dev);
> - int ret;
> -
> - if (!mode)
> - return 0;
> -
> - ret = of_get_drm_display_mode(np, &imxpd->mode,
> - &imxpd->bus_flags,
> - OF_USE_NATIVE_MODE);
> - if (ret) {
> - drm_mode_destroy(connector->dev, mode);
> - return 0;
> - }
> -
> - drm_mode_copy(mode, &imxpd->mode);
> - mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> - drm_mode_probed_add(connector, mode);
> - num_modes++;
> - }
> -
> - return num_modes;
> -}
> -
> static const u32 imx_pd_bus_fmts[] = {
> MEDIA_BUS_FMT_RGB888_1X24,
> MEDIA_BUS_FMT_BGR888_1X24,
> @@ -171,7 +133,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
> {
> struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
> struct drm_display_info *di = &conn_state->connector->display_info;
> - struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
> struct drm_bridge_state *next_bridge_state = NULL;
> struct drm_bridge *next_bridge;
> u32 bus_flags, bus_fmt;
> @@ -183,10 +144,8 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
>
> if (next_bridge_state)
> bus_flags = next_bridge_state->input_bus_cfg.flags;
> - else if (di->num_bus_formats)
> - bus_flags = di->bus_flags;
> else
> - bus_flags = imxpd->bus_flags;
> + bus_flags = di->bus_flags;
>
> bus_fmt = bridge_state->input_bus_cfg.format;
> if (!imx_pd_format_supported(bus_fmt))
> @@ -202,19 +161,16 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
> return 0;
> }
>
> -static const struct drm_connector_funcs imx_pd_connector_funcs = {
> - .fill_modes = drm_helper_probe_single_connector_modes,
> - .destroy = imx_drm_connector_destroy,
> - .reset = drm_atomic_helper_connector_reset,
> - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
> - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> -};
> +static int imx_pd_bridge_attach(struct drm_bridge *bridge,
> + enum drm_bridge_attach_flags flags)
> +{
> + struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
>
> -static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
> - .get_modes = imx_pd_connector_get_modes,
> -};
> + return drm_bridge_attach(bridge->encoder, imxpd->next_bridge, bridge, flags);
> +}
>
> static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
> + .attach = imx_pd_bridge_attach,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> @@ -239,7 +195,6 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
> return PTR_ERR(imxpd_encoder);
>
> imxpd_encoder->pd = imxpd;
> - connector = &imxpd_encoder->connector;
> encoder = &imxpd_encoder->encoder;
> bridge = &imxpd_encoder->bridge;
>
> @@ -247,28 +202,14 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
> if (ret)
> return ret;
>
> - /* set the connector's dpms to OFF so that
> - * drm_helper_connector_dpms() won't return
> - * immediately since the current state is ON
> - * at this point.
> - */
> - connector->dpms = DRM_MODE_DPMS_OFF;
> -
> bridge->funcs = &imx_pd_bridge_funcs;
> - drm_bridge_attach(encoder, bridge, NULL, 0);
> -
> - if (imxpd->next_bridge) {
> - ret = drm_bridge_attach(encoder, imxpd->next_bridge, bridge, 0);
> - if (ret < 0)
> - return ret;
> - } else {
> - drm_connector_helper_add(connector,
> - &imx_pd_connector_helper_funcs);
> - drm_connector_init(drm, connector, &imx_pd_connector_funcs,
> - DRM_MODE_CONNECTOR_DPI);
> -
> - drm_connector_attach_encoder(connector, encoder);
> - }
> + drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> +
> + connector = drm_bridge_connector_init(drm, encoder);
> + if (IS_ERR(connector))
> + return PTR_ERR(connector);
> +
> + drm_connector_attach_encoder(connector, encoder);
>
> return 0;
> }
> @@ -292,12 +233,11 @@ static int imx_pd_probe(struct platform_device *pdev)
>
> /* port@1 is the output port */
> imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
> + if (imxpd->next_bridge == ERR_PTR(-ENODEV))
> + imxpd->next_bridge = devm_imx_drm_legacy_bridge(dev, np, DRM_MODE_CONNECTOR_DPI);
> if (IS_ERR(imxpd->next_bridge)) {
> ret = PTR_ERR(imxpd->next_bridge);
> - if (ret != -ENODEV)
> - return ret;
> -
> - imxpd->next_bridge = NULL;
> + return ret;
> }
>
> ret = of_property_read_string(np, "interface-pix-fmt", &fmt);
>
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 11/12] drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
2024-06-02 12:04 ` [PATCH v3 11/12] drm/imx: parallel-display: " Dmitry Baryshkov
2024-06-03 3:05 ` Chris Healy
@ 2024-08-09 11:00 ` Philipp Zabel
1 sibling, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> Use the imx_legacy bridge driver instead of handlign display modes via
> the connector node.
>
> All existing usecases already support attaching using
> the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag, while the imx_legacy bridge
> doesn't support creating connector at all. Switch to
> drm_bridge_connector at the same time.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 12/12] drm/imx: move imx_drm_connector_destroy to imx-tve
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (10 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 11/12] drm/imx: parallel-display: " Dmitry Baryshkov
@ 2024-06-02 12:04 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
2024-06-03 3:25 ` [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Chris Healy
` (2 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-02 12:04 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel,
Dmitry Baryshkov
The imx-tve driver is the only remaining user of
imx_drm_connector_destroy(). Move the function to imx-tve.c
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 7 -------
drivers/gpu/drm/imx/ipuv3/imx-drm.h | 2 --
drivers/gpu/drm/imx/ipuv3/imx-tve.c | 8 +++++++-
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c
index 4cfabcf7375a..189d395349b8 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c
@@ -34,13 +34,6 @@ module_param(legacyfb_depth, int, 0444);
DEFINE_DRM_GEM_DMA_FOPS(imx_drm_driver_fops);
-void imx_drm_connector_destroy(struct drm_connector *connector)
-{
- drm_connector_unregister(connector);
- drm_connector_cleanup(connector);
-}
-EXPORT_SYMBOL_GPL(imx_drm_connector_destroy);
-
static int imx_drm_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state)
{
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-drm.h b/drivers/gpu/drm/imx/ipuv3/imx-drm.h
index e01f026047de..0c85bf83ffbf 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-drm.h
+++ b/drivers/gpu/drm/imx/ipuv3/imx-drm.h
@@ -25,8 +25,6 @@ extern struct platform_driver ipu_drm_driver;
int imx_drm_encoder_parse_of(struct drm_device *drm,
struct drm_encoder *encoder, struct device_node *np);
-void imx_drm_connector_destroy(struct drm_connector *connector);
-
int ipu_planes_assign_pre(struct drm_device *dev,
struct drm_atomic_state *state);
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-tve.c b/drivers/gpu/drm/imx/ipuv3/imx-tve.c
index 29f494bfff67..d46d07d25f51 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-tve.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-tve.c
@@ -305,9 +305,15 @@ static int imx_tve_atomic_check(struct drm_encoder *encoder,
return 0;
}
+static void imx_tve_connector_destroy(struct drm_connector *connector)
+{
+ drm_connector_unregister(connector);
+ drm_connector_cleanup(connector);
+}
+
static const struct drm_connector_funcs imx_tve_connector_funcs = {
.fill_modes = drm_helper_probe_single_connector_modes,
- .destroy = imx_drm_connector_destroy,
+ .destroy = imx_tve_connector_destroy,
.reset = drm_atomic_helper_connector_reset,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
--
2.39.2
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 12/12] drm/imx: move imx_drm_connector_destroy to imx-tve
2024-06-02 12:04 ` [PATCH v3 12/12] drm/imx: move imx_drm_connector_destroy to imx-tve Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
0 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> The imx-tve driver is the only remaining user of
> imx_drm_connector_destroy(). Move the function to imx-tve.c
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (11 preceding siblings ...)
2024-06-02 12:04 ` [PATCH v3 12/12] drm/imx: move imx_drm_connector_destroy to imx-tve Dmitry Baryshkov
@ 2024-06-03 3:25 ` Chris Healy
2024-06-03 10:12 ` Dmitry Baryshkov
2024-07-27 11:17 ` Dmitry Baryshkov
2024-08-09 11:00 ` Philipp Zabel
14 siblings, 1 reply; 27+ messages in thread
From: Chris Healy @ 2024-06-03 3:25 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, dri-devel, devicetree,
imx, linux-arm-kernel
On an i.MX53 QSB with HDMI daughter board, this patch series is:
Tested-by: Chris Healy <cphealy@gmail.com>
HDMI output still works correctly and the bridges file reflects the changes:
Before:
root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
bridge[0]: 0xc0fa76d8
type: [0] Unknown
ops: [0x0]
bridge[1]: 0xc0fba03c
type: [0] Unknown
OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
ops: [0x7] detect edid hpd
After:
root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
bridge[0]: 0xc0fa76d8
type: [0] Unknown
ops: [0x0]
bridge[1]: 0xc0fb9f5c
type: [0] Unknown
OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
ops: [0x7] detect edid hpd
bridge[2]: 0xc0fb9794
type: [11] HDMI-A
OF: /connector-hdmi:hdmi-connector
ops: [0x0]
On Sun, Jun 2, 2024 at 5:04 AM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> The IPUv3 DRM i.MX driver contains several codepaths for different
> usescases: both LDB and paralllel-display drivers handle next-bridge,
> panel and the legacy display-timings DT node on their own.
>
> Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> upstream ever used these features), switch to panel-bridge driver,
> removing the need to handle drm_panel codepaths separately and finally
> switch to drm_bridge_connector, removing requirement for the downstream
> bridges to create drm_connector on their own.
>
> This has been tested on the iMX53 with the DPI panel attached to LDB via
> LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> linked directly to LDB node and the display-timings node).
>
> To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
>
> [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> Changes in v3:
> - Notice (soft) dependencies in the cover letter (Chris)
> - Select DRM_BRIDGE instead of depending on it (Philipp)
> - Dropped unused selection of DRM_PANEL (Philipp)
> - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> (Philipp)
> - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
>
> Changes in v2:
> - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> - Moved the legacy bridge to drivers/gpu/drm/bridge
> - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
>
> ---
> Dmitry Baryshkov (12):
> dt-bindings: display: fsl-imx-drm: drop edid property support
> dt-bindings: display: imx/ldb: drop ddc-i2c-bus property
> drm/imx: cleanup the imx-drm header
> drm/imx: parallel-display: drop edid override support
> drm/imx: ldb: drop custom EDID support
> drm/imx: ldb: drop custom DDC bus support
> drm/imx: ldb: switch to drm_panel_bridge
> drm/imx: parallel-display: switch to drm_panel_bridge
> drm/imx: add internal bridge handling display-timings DT node
> drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector
> drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
> drm/imx: move imx_drm_connector_destroy to imx-tve
>
> .../bindings/display/imx/fsl-imx-drm.txt | 2 -
> .../devicetree/bindings/display/imx/ldb.txt | 1 -
> drivers/gpu/drm/bridge/imx/Kconfig | 10 +
> drivers/gpu/drm/bridge/imx/Makefile | 1 +
> drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c | 85 +++++++++
> drivers/gpu/drm/imx/ipuv3/Kconfig | 10 +-
> drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 7 -
> drivers/gpu/drm/imx/ipuv3/imx-drm.h | 14 --
> drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 203 +++++----------------
> drivers/gpu/drm/imx/ipuv3/imx-tve.c | 8 +-
> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 139 +++-----------
> include/drm/bridge/imx.h | 13 ++
> 12 files changed, 187 insertions(+), 306 deletions(-)
> ---
> base-commit: 850ca533e572247b6f71dafcbf7feb0359350963
> change-id: 20240310-drm-imx-cleanup-10746a9b71f5
>
> Best regards,
> --
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-06-03 3:25 ` [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Chris Healy
@ 2024-06-03 10:12 ` Dmitry Baryshkov
2024-06-03 14:35 ` Chris Healy
0 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-06-03 10:12 UTC (permalink / raw)
To: Chris Healy
Cc: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, dri-devel, devicetree,
imx, linux-arm-kernel
On Sun, Jun 02, 2024 at 08:25:39PM -0700, Chris Healy wrote:
> On an i.MX53 QSB with HDMI daughter board, this patch series is:
>
> Tested-by: Chris Healy <cphealy@gmail.com>
Thank you! I assume this is imx53-qsrb-hdmi ?
>
> HDMI output still works correctly and the bridges file reflects the changes:
>
> Before:
>
> root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
> bridge[0]: 0xc0fa76d8
> type: [0] Unknown
> ops: [0x0]
> bridge[1]: 0xc0fba03c
> type: [0] Unknown
> OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
> ops: [0x7] detect edid hpd
>
>
> After:
>
> root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
> bridge[0]: 0xc0fa76d8
> type: [0] Unknown
> ops: [0x0]
> bridge[1]: 0xc0fb9f5c
> type: [0] Unknown
> OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
> ops: [0x7] detect edid hpd
> bridge[2]: 0xc0fb9794
> type: [11] HDMI-A
> OF: /connector-hdmi:hdmi-connector
> ops: [0x0]
>
> On Sun, Jun 2, 2024 at 5:04 AM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > The IPUv3 DRM i.MX driver contains several codepaths for different
> > usescases: both LDB and paralllel-display drivers handle next-bridge,
> > panel and the legacy display-timings DT node on their own.
> >
> > Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> > upstream ever used these features), switch to panel-bridge driver,
> > removing the need to handle drm_panel codepaths separately and finally
> > switch to drm_bridge_connector, removing requirement for the downstream
> > bridges to create drm_connector on their own.
> >
> > This has been tested on the iMX53 with the DPI panel attached to LDB via
> > LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> > linked directly to LDB node and the display-timings node).
> >
> > To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
> >
> > [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> > [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> > Changes in v3:
> > - Notice (soft) dependencies in the cover letter (Chris)
> > - Select DRM_BRIDGE instead of depending on it (Philipp)
> > - Dropped unused selection of DRM_PANEL (Philipp)
> > - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> > (Philipp)
> > - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
> >
> > Changes in v2:
> > - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> > - Moved the legacy bridge to drivers/gpu/drm/bridge
> > - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> > - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
> >
> > ---
> > Dmitry Baryshkov (12):
> > dt-bindings: display: fsl-imx-drm: drop edid property support
> > dt-bindings: display: imx/ldb: drop ddc-i2c-bus property
> > drm/imx: cleanup the imx-drm header
> > drm/imx: parallel-display: drop edid override support
> > drm/imx: ldb: drop custom EDID support
> > drm/imx: ldb: drop custom DDC bus support
> > drm/imx: ldb: switch to drm_panel_bridge
> > drm/imx: parallel-display: switch to drm_panel_bridge
> > drm/imx: add internal bridge handling display-timings DT node
> > drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector
> > drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
> > drm/imx: move imx_drm_connector_destroy to imx-tve
> >
> > .../bindings/display/imx/fsl-imx-drm.txt | 2 -
> > .../devicetree/bindings/display/imx/ldb.txt | 1 -
> > drivers/gpu/drm/bridge/imx/Kconfig | 10 +
> > drivers/gpu/drm/bridge/imx/Makefile | 1 +
> > drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c | 85 +++++++++
> > drivers/gpu/drm/imx/ipuv3/Kconfig | 10 +-
> > drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 7 -
> > drivers/gpu/drm/imx/ipuv3/imx-drm.h | 14 --
> > drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 203 +++++----------------
> > drivers/gpu/drm/imx/ipuv3/imx-tve.c | 8 +-
> > drivers/gpu/drm/imx/ipuv3/parallel-display.c | 139 +++-----------
> > include/drm/bridge/imx.h | 13 ++
> > 12 files changed, 187 insertions(+), 306 deletions(-)
> > ---
> > base-commit: 850ca533e572247b6f71dafcbf7feb0359350963
> > change-id: 20240310-drm-imx-cleanup-10746a9b71f5
> >
> > Best regards,
> > --
> > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-06-03 10:12 ` Dmitry Baryshkov
@ 2024-06-03 14:35 ` Chris Healy
0 siblings, 0 replies; 27+ messages in thread
From: Chris Healy @ 2024-06-03 14:35 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, dri-devel, devicetree,
imx, linux-arm-kernel
On Mon, Jun 3, 2024 at 3:12 AM Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> On Sun, Jun 02, 2024 at 08:25:39PM -0700, Chris Healy wrote:
> > On an i.MX53 QSB with HDMI daughter board, this patch series is:
> >
> > Tested-by: Chris Healy <cphealy@gmail.com>
>
> Thank you! I assume this is imx53-qsrb-hdmi ?
Yes
>
> >
> > HDMI output still works correctly and the bridges file reflects the changes:
> >
> > Before:
> >
> > root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
> > bridge[0]: 0xc0fa76d8
> > type: [0] Unknown
> > ops: [0x0]
> > bridge[1]: 0xc0fba03c
> > type: [0] Unknown
> > OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
> > ops: [0x7] detect edid hpd
> >
> >
> > After:
> >
> > root:/sys/kernel/debug/dri/display-subsystem/encoder-0 cat bridges
> > bridge[0]: 0xc0fa76d8
> > type: [0] Unknown
> > ops: [0x0]
> > bridge[1]: 0xc0fb9f5c
> > type: [0] Unknown
> > OF: /soc/bus@60000000/i2c@63fc4000/bridge-hdmi@39:sil,sii9022
> > ops: [0x7] detect edid hpd
> > bridge[2]: 0xc0fb9794
> > type: [11] HDMI-A
> > OF: /connector-hdmi:hdmi-connector
> > ops: [0x0]
> >
> > On Sun, Jun 2, 2024 at 5:04 AM Dmitry Baryshkov
> > <dmitry.baryshkov@linaro.org> wrote:
> > >
> > > The IPUv3 DRM i.MX driver contains several codepaths for different
> > > usescases: both LDB and paralllel-display drivers handle next-bridge,
> > > panel and the legacy display-timings DT node on their own.
> > >
> > > Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> > > upstream ever used these features), switch to panel-bridge driver,
> > > removing the need to handle drm_panel codepaths separately and finally
> > > switch to drm_bridge_connector, removing requirement for the downstream
> > > bridges to create drm_connector on their own.
> > >
> > > This has been tested on the iMX53 with the DPI panel attached to LDB via
> > > LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> > > linked directly to LDB node and the display-timings node).
> > >
> > > To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
> > >
> > > [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> > > [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
> > >
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > > ---
> > > Changes in v3:
> > > - Notice (soft) dependencies in the cover letter (Chris)
> > > - Select DRM_BRIDGE instead of depending on it (Philipp)
> > > - Dropped unused selection of DRM_PANEL (Philipp)
> > > - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> > > (Philipp)
> > > - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
> > >
> > > Changes in v2:
> > > - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> > > - Moved the legacy bridge to drivers/gpu/drm/bridge
> > > - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> > > - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
> > >
> > > ---
> > > Dmitry Baryshkov (12):
> > > dt-bindings: display: fsl-imx-drm: drop edid property support
> > > dt-bindings: display: imx/ldb: drop ddc-i2c-bus property
> > > drm/imx: cleanup the imx-drm header
> > > drm/imx: parallel-display: drop edid override support
> > > drm/imx: ldb: drop custom EDID support
> > > drm/imx: ldb: drop custom DDC bus support
> > > drm/imx: ldb: switch to drm_panel_bridge
> > > drm/imx: parallel-display: switch to drm_panel_bridge
> > > drm/imx: add internal bridge handling display-timings DT node
> > > drm/imx: ldb: switch to imx_legacy_bridge / drm_bridge_connector
> > > drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector
> > > drm/imx: move imx_drm_connector_destroy to imx-tve
> > >
> > > .../bindings/display/imx/fsl-imx-drm.txt | 2 -
> > > .../devicetree/bindings/display/imx/ldb.txt | 1 -
> > > drivers/gpu/drm/bridge/imx/Kconfig | 10 +
> > > drivers/gpu/drm/bridge/imx/Makefile | 1 +
> > > drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c | 85 +++++++++
> > > drivers/gpu/drm/imx/ipuv3/Kconfig | 10 +-
> > > drivers/gpu/drm/imx/ipuv3/imx-drm-core.c | 7 -
> > > drivers/gpu/drm/imx/ipuv3/imx-drm.h | 14 --
> > > drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 203 +++++----------------
> > > drivers/gpu/drm/imx/ipuv3/imx-tve.c | 8 +-
> > > drivers/gpu/drm/imx/ipuv3/parallel-display.c | 139 +++-----------
> > > include/drm/bridge/imx.h | 13 ++
> > > 12 files changed, 187 insertions(+), 306 deletions(-)
> > > ---
> > > base-commit: 850ca533e572247b6f71dafcbf7feb0359350963
> > > change-id: 20240310-drm-imx-cleanup-10746a9b71f5
> > >
> > > Best regards,
> > > --
> > > Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > >
>
> --
> With best wishes
> Dmitry
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (12 preceding siblings ...)
2024-06-03 3:25 ` [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Chris Healy
@ 2024-07-27 11:17 ` Dmitry Baryshkov
2024-07-31 13:12 ` Philipp Zabel
2024-08-09 11:00 ` Philipp Zabel
14 siblings, 1 reply; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-07-27 11:17 UTC (permalink / raw)
To: Philipp Zabel, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On Sun, Jun 02, 2024 at 03:04:40PM GMT, Dmitry Baryshkov wrote:
> The IPUv3 DRM i.MX driver contains several codepaths for different
> usescases: both LDB and paralllel-display drivers handle next-bridge,
> panel and the legacy display-timings DT node on their own.
>
> Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> upstream ever used these features), switch to panel-bridge driver,
> removing the need to handle drm_panel codepaths separately and finally
> switch to drm_bridge_connector, removing requirement for the downstream
> bridges to create drm_connector on their own.
>
> This has been tested on the iMX53 with the DPI panel attached to LDB via
> LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> linked directly to LDB node and the display-timings node).
>
> To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
>
> [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> Changes in v3:
> - Notice (soft) dependencies in the cover letter (Chris)
> - Select DRM_BRIDGE instead of depending on it (Philipp)
> - Dropped unused selection of DRM_PANEL (Philipp)
> - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> (Philipp)
> - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
>
> Changes in v2:
> - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> - Moved the legacy bridge to drivers/gpu/drm/bridge
> - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
Just a gracious ping, this has been without maintainer's review for
nearly two months.
Should we change ipu-v3 to the 'S: Odd Fixes' state?
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-07-27 11:17 ` Dmitry Baryshkov
@ 2024-07-31 13:12 ` Philipp Zabel
2024-07-31 13:37 ` Dmitry Baryshkov
0 siblings, 1 reply; 27+ messages in thread
From: Philipp Zabel @ 2024-07-31 13:12 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
Hi Dmitry,
On Sa, 2024-07-27 at 14:17 +0300, Dmitry Baryshkov wrote:
> On Sun, Jun 02, 2024 at 03:04:40PM GMT, Dmitry Baryshkov wrote:
> > The IPUv3 DRM i.MX driver contains several codepaths for different
> > usescases: both LDB and paralllel-display drivers handle next-bridge,
> > panel and the legacy display-timings DT node on their own.
> >
> > Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> > upstream ever used these features), switch to panel-bridge driver,
> > removing the need to handle drm_panel codepaths separately and finally
> > switch to drm_bridge_connector, removing requirement for the downstream
> > bridges to create drm_connector on their own.
> >
> > This has been tested on the iMX53 with the DPI panel attached to LDB via
> > LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> > linked directly to LDB node and the display-timings node).
> >
> > To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
> >
> > [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> > [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> > Changes in v3:
> > - Notice (soft) dependencies in the cover letter (Chris)
> > - Select DRM_BRIDGE instead of depending on it (Philipp)
> > - Dropped unused selection of DRM_PANEL (Philipp)
> > - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> > (Philipp)
> > - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
> >
> > Changes in v2:
> > - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> > - Moved the legacy bridge to drivers/gpu/drm/bridge
> > - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> > - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
>
> Just a gracious ping, this has been without maintainer's review for
> nearly two months.
I don't have any active i.MX6 projects right now, which increases
latency. I'll get around to reviewing the remaining changes and testing
on i.MX6 this week or next.
> Should we change ipu-v3 to the 'S: Odd Fixes' state?
Odd is on point, but fixes-only doesn't really fit.
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-07-31 13:12 ` Philipp Zabel
@ 2024-07-31 13:37 ` Dmitry Baryshkov
0 siblings, 0 replies; 27+ messages in thread
From: Dmitry Baryshkov @ 2024-07-31 13:37 UTC (permalink / raw)
To: Philipp Zabel
Cc: David Airlie, Daniel Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On Wed, Jul 31, 2024 at 03:12:44PM GMT, Philipp Zabel wrote:
> Hi Dmitry,
>
> On Sa, 2024-07-27 at 14:17 +0300, Dmitry Baryshkov wrote:
> > On Sun, Jun 02, 2024 at 03:04:40PM GMT, Dmitry Baryshkov wrote:
> > > The IPUv3 DRM i.MX driver contains several codepaths for different
> > > usescases: both LDB and paralllel-display drivers handle next-bridge,
> > > panel and the legacy display-timings DT node on their own.
> > >
> > > Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> > > upstream ever used these features), switch to panel-bridge driver,
> > > removing the need to handle drm_panel codepaths separately and finally
> > > switch to drm_bridge_connector, removing requirement for the downstream
> > > bridges to create drm_connector on their own.
> > >
> > > This has been tested on the iMX53 with the DPI panel attached to LDB via
> > > LVDS decoder, using all possible usecases (lvds-codec + panel, panel
> > > linked directly to LDB node and the display-timings node).
> > >
> > > To be able to test on the iMX53 QSRB with the HDMI cape apply [1], [2]
> > >
> > > [1] https://lore.kernel.org/all/20240514030718.533169-1-victor.liu@nxp.com/
> > > [2] https://lore.kernel.org/all/20240602-imx-sii902x-defconfig-v1-1-71a6c382b422@linaro.org/
> > >
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > > ---
> > > Changes in v3:
> > > - Notice (soft) dependencies in the cover letter (Chris)
> > > - Select DRM_BRIDGE instead of depending on it (Philipp)
> > > - Dropped unused selection of DRM_PANEL (Philipp)
> > > - Added missing include of <drm/bridge/imx.h> to parallel-display.c
> > > (Philipp)
> > > - Link to v2: https://lore.kernel.org/r/20240331-drm-imx-cleanup-v2-0-d81c1d1c1026@linaro.org
> > >
> > > Changes in v2:
> > > - Fixed drm_bridge_attach flags in imx/parallel-display driver.
> > > - Moved the legacy bridge to drivers/gpu/drm/bridge
> > > - Added missing EXPORT_SYMBOL_GPL to the iMX legacy bridge
> > > - Link to v1: https://lore.kernel.org/r/20240311-drm-imx-cleanup-v1-0-e104f05caa51@linaro.org
> >
> > Just a gracious ping, this has been without maintainer's review for
> > nearly two months.
>
> I don't have any active i.MX6 projects right now, which increases
> latency. I'll get around to reviewing the remaining changes and testing
> on i.MX6 this week or next.
Thanks!
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector
2024-06-02 12:04 [PATCH v3 00/12] drm/imx/ipuv3: switch LDB and parallel-display driver to use drm_bridge_connector Dmitry Baryshkov
` (13 preceding siblings ...)
2024-07-27 11:17 ` Dmitry Baryshkov
@ 2024-08-09 11:00 ` Philipp Zabel
14 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2024-08-09 11:00 UTC (permalink / raw)
To: Dmitry Baryshkov, David Airlie, Daniel Vetter, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam
Cc: Chris Healy, dri-devel, devicetree, imx, linux-arm-kernel
On So, 2024-06-02 at 15:04 +0300, Dmitry Baryshkov wrote:
> The IPUv3 DRM i.MX driver contains several codepaths for different
> usescases: both LDB and paralllel-display drivers handle next-bridge,
> panel and the legacy display-timings DT node on their own.
>
> Drop unused ddc-i2c-bus and edid handling (none of the DT files merged
> upstream ever used these features), switch to panel-bridge driver,
> removing the need to handle drm_panel codepaths separately and finally
> switch to drm_bridge_connector, removing requirement for the downstream
> bridges to create drm_connector on their own.
Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # on imx6q-nitrogen6x
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread