The first patch adds support for drm panels to tilcdc. The second is just for convenience. The third adds support for am335x-evm's panel to panel-simple driver. The third changes am335x-evm's dts file to use panel-simple instead of tilcdc's bundled dpi-panel support.
After the review I will pick the tilcdc patches, but how about the panel-simple, who will take it?
There is no hurry with the dts patch. We can even wait with it until the next release, when everything certainly ready for it. The evm works just fine with the old tilcdc bundled panel support and we probably have to keep it around indefinately for backward compatibility.
Best regards, Jyri
Jyri Sarha (4): drm/tilcdc: Add support for drm panels drm/tilcdc: tilcdc_panel: Rename device from "panel" to "tilcdc-panel" drm/panel: simple: Add TVC S9700RTWV43TR-01B 800x480 panel support ARM: dts: am335x-evm: Use drm simple-panel instead of tilcdc-panel
arch/arm/boot/dts/am335x-evm.dts | 44 +++++++++++++------------------- drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ drivers/gpu/drm/tilcdc/Kconfig | 2 ++ drivers/gpu/drm/tilcdc/tilcdc_external.c | 29 ++++++++++++++------- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- 5 files changed, 67 insertions(+), 36 deletions(-)
Add support for drm panels to tilcdc. Adding the support on top of the existing bridge support needs only couple of lines of code when using using the drm panel bridge helpers.
Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/gpu/drm/tilcdc/Kconfig | 2 ++ drivers/gpu/drm/tilcdc/tilcdc_external.c | 29 ++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig index 81ac824..5259804 100644 --- a/drivers/gpu/drm/tilcdc/Kconfig +++ b/drivers/gpu/drm/tilcdc/Kconfig @@ -4,6 +4,8 @@ config DRM_TILCDC select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER + select DRM_BRIDGE + select DRM_PANEL_BRIDGE select VIDEOMODE_HELPERS select BACKLIGHT_CLASS_DEVICE select BACKLIGHT_LCD_SUPPORT diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c index 711c7b3..d651bdd 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_external.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c @@ -188,18 +188,16 @@ int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridge) int tilcdc_attach_external_device(struct drm_device *ddev) { struct tilcdc_drm_private *priv = ddev->dev_private; - struct device_node *remote_node; struct drm_bridge *bridge; + struct drm_panel *panel; int ret;
- remote_node = of_graph_get_remote_node(ddev->dev->of_node, 0, 0); - if (!remote_node) + ret = drm_of_find_panel_or_bridge(ddev->dev->of_node, 0, 0, + &panel, &bridge); + if (ret == -ENODEV) return 0; - - bridge = of_drm_find_bridge(remote_node); - of_node_put(remote_node); - if (!bridge) - return -EPROBE_DEFER; + else if (ret) + return ret;
priv->external_encoder = devm_kzalloc(ddev->dev, sizeof(*priv->external_encoder), @@ -215,10 +213,23 @@ int tilcdc_attach_external_device(struct drm_device *ddev) return ret; }
+ if (panel) { + bridge = devm_drm_panel_bridge_add(ddev->dev, panel, + DRM_MODE_CONNECTOR_DPI); + if (IS_ERR(bridge)) { + ret = PTR_ERR(bridge); + goto err_encoder_cleanup; + } + } + ret = tilcdc_attach_bridge(ddev, bridge); if (ret) - drm_encoder_cleanup(priv->external_encoder); + goto err_encoder_cleanup; + + return 0;
+err_encoder_cleanup: + drm_encoder_cleanup(priv->external_encoder); return ret; }
Rename the bundled tilcdc_panel driver from just "panel" to "tilcdc-panel" to avoid noisy error messages from the driver trying to probe all device nodes named "panel".
Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c index cf9ca16..d616d64 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c @@ -421,7 +421,7 @@ struct platform_driver panel_driver = { .remove = panel_remove, .driver = { .owner = THIS_MODULE, - .name = "panel", + .name = "tilcdc-panel", .of_match_table = panel_of_match, }, };
Add support for TVC S9700RTWV43TR-01B 800x480 panel found on TI's AM335X-EVM.
Signed-off-by: Jyri Sarha jsarha@ti.com --- drivers/gpu/drm/panel/panel-simple.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 5591984..3b0ba9f 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -1962,6 +1962,29 @@ static const struct panel_desc tpk_f10a_0102 = { }, };
+static const struct drm_display_mode tvc_s9700rtwv43tr_01b_mode = { + .clock = 3000, + .hdisplay = 800, + .hsync_start = 800 + 39, + .hsync_end = 800 + 39 + 47, + .htotal = 800 + 39 + 47 + 39, + .vdisplay = 480, + .vsync_start = 480 + 13, + .vsync_end = 480 + 13 + 2, + .vtotal = 480 + 13 + 2 + 29, + .vrefresh = 62, +}; + +static const struct panel_desc tvc_s9700rtwv43tr_01b = { + .modes = &tvc_s9700rtwv43tr_01b_mode, + .num_modes = 1, + .bpc = 8, + .size = { + .width = 155, + .height = 90, + }, +}; + static const struct display_timing urt_umsh_8596md_timing = { .pixelclock = { 33260000, 33260000, 33260000 }, .hactive = { 800, 800, 800 }, @@ -2214,6 +2237,9 @@ static const struct of_device_id platform_of_match[] = { .compatible = "tpk,f10a-0102", .data = &tpk_f10a_0102, }, { + .compatible = "tvc,s9700rtwv43tr-01b", + .data = &tvc_s9700rtwv43tr_01b, + }, { .compatible = "urt,umsh-8596md-t", .data = &urt_umsh_8596md_parallel, }, {
Move to use the new drm panel support in tilcdc together with added "tvc,s9700rtwv43tr-01b"-panel support in drm panel-simple.
Signed-off-by: Jyri Sarha jsarha@ti.com --- arch/arm/boot/dts/am335x-evm.dts | 44 ++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 26 deletions(-)
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index fee6b3e..5a442b5 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts @@ -98,7 +98,7 @@ }; };
- backlight { + backlight: backlight { compatible = "pwm-backlight"; pwms = <&ecap0 0 50000 0>; brightness-levels = <0 51 53 56 62 75 101 152 255>; @@ -106,35 +106,19 @@ };
panel { - compatible = "ti,tilcdc,panel"; + compatible = "tvc,s9700rtwv43tr-01b"; + status = "okay"; + pinctrl-names = "default"; pinctrl-0 = <&lcd_pins_s0>; - panel-info { - ac-bias = <255>; - ac-bias-intrpt = <0>; - dma-burst-sz = <16>; - bpp = <32>; - fdd = <0x80>; - sync-edge = <0>; - sync-ctrl = <1>; - raster-order = <0>; - fifo-th = <0>; - };
- display-timings { - 800x480p62 { - clock-frequency = <30000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <39>; - hback-porch = <39>; - hsync-len = <47>; - vback-porch = <29>; - vfront-porch = <13>; - vsync-len = <2>; - hsync-active = <1>; - vsync-active = <1>; + backlight = <&backlight>; + ports { + port { + panel_0: endpoint@0 { + remote-endpoint = <&lcdc_0>; + }; }; }; }; @@ -503,6 +487,14 @@ status = "okay";
blue-and-red-wiring = "crossed"; + + ports { + port { + lcdc_0: endpoint@0 { + remote-endpoint = <&panel_0>; + }; + }; + }; };
&elm {
On 22/02/18 19:07, Jyri Sarha wrote:
The first patch adds support for drm panels to tilcdc. The second is just for convenience. The third adds support for am335x-evm's panel to panel-simple driver. The third changes am335x-evm's dts file to use panel-simple instead of tilcdc's bundled dpi-panel support.
After the review I will pick the tilcdc patches, but how about the panel-simple, who will take it?
There is no hurry with the dts patch. We can even wait with it until the next release, when everything certainly ready for it. The evm works just fine with the old tilcdc bundled panel support and we probably have to keep it around indefinately for backward compatibility.
Best regards, Jyri
Jyri Sarha (4): drm/tilcdc: Add support for drm panels drm/tilcdc: tilcdc_panel: Rename device from "panel" to "tilcdc-panel" drm/panel: simple: Add TVC S9700RTWV43TR-01B 800x480 panel support ARM: dts: am335x-evm: Use drm simple-panel instead of tilcdc-panel
arch/arm/boot/dts/am335x-evm.dts | 44 +++++++++++++------------------- drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ drivers/gpu/drm/tilcdc/Kconfig | 2 ++ drivers/gpu/drm/tilcdc/tilcdc_external.c | 29 ++++++++++++++------- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- 5 files changed, 67 insertions(+), 36 deletions(-)
Reviewed-by: Tomi Valkeinen tomi.valkeinen@ti.com
Tomi
On Mon, Feb 26, 2018 at 11:59:48AM +0200, Tomi Valkeinen wrote:
On 22/02/18 19:07, Jyri Sarha wrote:
The first patch adds support for drm panels to tilcdc. The second is just for convenience. The third adds support for am335x-evm's panel to panel-simple driver. The third changes am335x-evm's dts file to use panel-simple instead of tilcdc's bundled dpi-panel support.
After the review I will pick the tilcdc patches, but how about the panel-simple, who will take it?
There is no hurry with the dts patch. We can even wait with it until the next release, when everything certainly ready for it. The evm works just fine with the old tilcdc bundled panel support and we probably have to keep it around indefinately for backward compatibility.
Best regards, Jyri
Jyri Sarha (4): drm/tilcdc: Add support for drm panels drm/tilcdc: tilcdc_panel: Rename device from "panel" to "tilcdc-panel" drm/panel: simple: Add TVC S9700RTWV43TR-01B 800x480 panel support ARM: dts: am335x-evm: Use drm simple-panel instead of tilcdc-panel
arch/arm/boot/dts/am335x-evm.dts | 44 +++++++++++++------------------- drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ drivers/gpu/drm/tilcdc/Kconfig | 2 ++ drivers/gpu/drm/tilcdc/tilcdc_external.c | 29 ++++++++++++++------- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- 5 files changed, 67 insertions(+), 36 deletions(-)
Reviewed-by: Tomi Valkeinen tomi.valkeinen@ti.com
Since panel drivers are in drm-misc probably simplest if we push these all through that tree? Want commit rights for that? -Daniel
On 05/03/18 10:46, Daniel Vetter wrote:
On Mon, Feb 26, 2018 at 11:59:48AM +0200, Tomi Valkeinen wrote:
On 22/02/18 19:07, Jyri Sarha wrote:
The first patch adds support for drm panels to tilcdc. The second is just for convenience. The third adds support for am335x-evm's panel to panel-simple driver. The third changes am335x-evm's dts file to use panel-simple instead of tilcdc's bundled dpi-panel support.
After the review I will pick the tilcdc patches, but how about the panel-simple, who will take it?
There is no hurry with the dts patch. We can even wait with it until the next release, when everything certainly ready for it. The evm works just fine with the old tilcdc bundled panel support and we probably have to keep it around indefinately for backward compatibility.
Best regards, Jyri
Jyri Sarha (4): drm/tilcdc: Add support for drm panels drm/tilcdc: tilcdc_panel: Rename device from "panel" to "tilcdc-panel" drm/panel: simple: Add TVC S9700RTWV43TR-01B 800x480 panel support ARM: dts: am335x-evm: Use drm simple-panel instead of tilcdc-panel
arch/arm/boot/dts/am335x-evm.dts | 44 +++++++++++++------------------- drivers/gpu/drm/panel/panel-simple.c | 26 +++++++++++++++++++ drivers/gpu/drm/tilcdc/Kconfig | 2 ++ drivers/gpu/drm/tilcdc/tilcdc_external.c | 29 ++++++++++++++------- drivers/gpu/drm/tilcdc/tilcdc_panel.c | 2 +- 5 files changed, 67 insertions(+), 36 deletions(-)
Reviewed-by: Tomi Valkeinen tomi.valkeinen@ti.com
Since panel drivers are in drm-misc probably simplest if we push these all through that tree? Want commit rights for that? -Daniel
Sure. However, I already sent a pull request for tilcdc patches. But I can send another for the panel patch to drm misc.
There is no direct dependency and I the dts patch can wait until the next release, just to be sure that there is no breakage.
Best regards, Jyri
On 05/03/18 11:29, Jyri Sarha wrote:
Since panel drivers are in drm-misc probably simplest if we push these all through that tree? Want commit rights for that? -Daniel
Sure. However, I already sent a pull request for tilcdc patches. But I can send another for the panel patch to drm misc.
There is no direct dependency and I the dts patch can wait until the next release, just to be sure that there is no breakage.
Oh... I was hasty in replying. But yes can push the panel patch to drm-misc if you give me the rights. I guess you need my ssh public key (attached) for that.
BR, Jyri
On Mon, Mar 05, 2018 at 02:12:16PM +0200, Jyri Sarha wrote:
On 05/03/18 11:29, Jyri Sarha wrote:
Since panel drivers are in drm-misc probably simplest if we push these all through that tree? Want commit rights for that? -Daniel
Sure. However, I already sent a pull request for tilcdc patches. But I can send another for the panel patch to drm misc.
There is no direct dependency and I the dts patch can wait until the next release, just to be sure that there is no breakage.
Oh... I was hasty in replying. But yes can push the panel patch to drm-misc if you give me the rights. I guess you need my ssh public key (attached) for that.
You need a fd.o account, please follow the procedure here:
https://www.freedesktop.org/wiki/AccountRequests/
btw if we go this way there's also the question whether you want to maintain tilcdc in drm-misc, but that's up to you.
Cheers, Daniel
dri-devel@lists.freedesktop.org