* [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
@ 2021-04-09 4:53 Hsin-Yi Wang
2021-04-09 4:53 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Hsin-Yi Wang @ 2021-04-09 4:53 UTC (permalink / raw)
To: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra
Cc: Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
linux-mediatek, linux-arm-kernel, linux-kernel, Rob Herring,
devicetree
drm_dev_register() sets connector->registration_state to
DRM_CONNECTOR_REGISTERED and dev->registered to true. If
drm_connector_set_panel_orientation() is first called after
drm_dev_register(), it will fail several checks and results in following
warning. So set panel orientation in dsi before drm_dev_register() is
called.
[ 4.480976] ------------[ cut here ]------------
[ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
<snip>
[ 4.609772] Call trace:
[ 4.612208] __drm_mode_object_add+0xb4/0xbc
[ 4.616466] drm_mode_object_add+0x20/0x2c
[ 4.620552] drm_property_create+0xdc/0x174
[ 4.624723] drm_property_create_enum+0x34/0x98
[ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
[ 4.634716] boe_panel_get_modes+0x88/0xd8
[ 4.638802] drm_panel_get_modes+0x2c/0x48
[ 4.642887] panel_bridge_get_modes+0x1c/0x28
[ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
[ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
[ 4.658266] drm_mode_getconnector+0x1b4/0x45c
[ 4.662699] drm_ioctl_kernel+0xac/0x128
[ 4.666611] drm_ioctl+0x268/0x410
[ 4.670002] drm_compat_ioctl+0xdc/0xf0
[ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
[ 4.678436] el0_svc_common+0xf4/0x1c0
[ 4.682174] do_el0_svc_compat+0x28/0x3c
[ 4.686088] el0_svc_compat+0x10/0x1c
[ 4.689738] el0_sync_compat_handler+0xa8/0xcc
[ 4.694171] el0_sync_compat+0x178/0x180
[ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
[ 4.702721] ------------[ cut here ]------------
[ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
<snip>
[ 4.833830] Call trace:
[ 4.836266] drm_object_attach_property+0x48/0xb8
[ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
[ 4.846432] boe_panel_get_modes+0x88/0xd8
[ 4.850516] drm_panel_get_modes+0x2c/0x48
[ 4.854600] panel_bridge_get_modes+0x1c/0x28
[ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
[ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
[ 4.869978] drm_mode_getconnector+0x1b4/0x45c
[ 4.874410] drm_ioctl_kernel+0xac/0x128
[ 4.878320] drm_ioctl+0x268/0x410
[ 4.881711] drm_compat_ioctl+0xdc/0xf0
[ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
[ 4.890142] el0_svc_common+0xf4/0x1c0
[ 4.893879] do_el0_svc_compat+0x28/0x3c
[ 4.897791] el0_svc_compat+0x10/0x1c
[ 4.901441] el0_sync_compat_handler+0xa8/0xcc
[ 4.905873] el0_sync_compat+0x178/0x180
[ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index ae403c67cbd9..45a702ee09f3 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -205,6 +205,7 @@ struct mtk_dsi {
u32 irq_data;
wait_queue_head_t irq_wait_queue;
const struct mtk_dsi_driver_data *driver_data;
+ enum drm_panel_orientation orientation;
};
static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
@@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
}
drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
+ drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
+
return 0;
err_cleanup_encoder:
@@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
ret = PTR_ERR(dsi->next_bridge);
goto err_unregister_host;
}
+
+ ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
+ if (ret) {
+ dev_err(dev, "failed to get panel orientation %d\n", ret);
+ return ret;
+ }
}
dsi->driver_data = of_device_get_match_data(dev);
--
2.31.1.295.g9ea45b61b8-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2021-04-09 4:53 [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
@ 2021-04-09 4:53 ` Hsin-Yi Wang
2021-04-20 9:05 ` [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
2021-04-23 13:53 ` Sean Paul
2 siblings, 0 replies; 12+ messages in thread
From: Hsin-Yi Wang @ 2021-04-09 4:53 UTC (permalink / raw)
To: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra
Cc: Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
linux-mediatek, linux-arm-kernel, linux-kernel, Rob Herring,
devicetree
krane, kakadu, and kodama boards have a default panel rotation.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index ff56bcfa3370..793cc9501337 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -263,6 +263,7 @@ panel: panel@0 {
avee-supply = <&ppvarp_lcd>;
pp1800-supply = <&pp1800_lcd>;
backlight = <&backlight_lcd0>;
+ rotation = <270>;
port {
panel_in: endpoint {
remote-endpoint = <&dsi_out>;
--
2.31.1.295.g9ea45b61b8-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
2021-04-09 4:53 [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
2021-04-09 4:53 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
@ 2021-04-20 9:05 ` Hsin-Yi Wang
2021-04-20 23:46 ` Chun-Kuang Hu
2021-04-23 13:53 ` Sean Paul
2 siblings, 1 reply; 12+ messages in thread
From: Hsin-Yi Wang @ 2021-04-20 9:05 UTC (permalink / raw)
To: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra
Cc: Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml,
Rob Herring, Devicetree List
On Fri, Apr 9, 2021 at 12:53 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> drm_dev_register() sets connector->registration_state to
> DRM_CONNECTOR_REGISTERED and dev->registered to true. If
> drm_connector_set_panel_orientation() is first called after
> drm_dev_register(), it will fail several checks and results in following
> warning. So set panel orientation in dsi before drm_dev_register() is
> called.
>
> [ 4.480976] ------------[ cut here ]------------
> [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
> <snip>
> [ 4.609772] Call trace:
> [ 4.612208] __drm_mode_object_add+0xb4/0xbc
> [ 4.616466] drm_mode_object_add+0x20/0x2c
> [ 4.620552] drm_property_create+0xdc/0x174
> [ 4.624723] drm_property_create_enum+0x34/0x98
> [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
> [ 4.634716] boe_panel_get_modes+0x88/0xd8
> [ 4.638802] drm_panel_get_modes+0x2c/0x48
> [ 4.642887] panel_bridge_get_modes+0x1c/0x28
> [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
> [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
> [ 4.658266] drm_mode_getconnector+0x1b4/0x45c
> [ 4.662699] drm_ioctl_kernel+0xac/0x128
> [ 4.666611] drm_ioctl+0x268/0x410
> [ 4.670002] drm_compat_ioctl+0xdc/0xf0
> [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
> [ 4.678436] el0_svc_common+0xf4/0x1c0
> [ 4.682174] do_el0_svc_compat+0x28/0x3c
> [ 4.686088] el0_svc_compat+0x10/0x1c
> [ 4.689738] el0_sync_compat_handler+0xa8/0xcc
> [ 4.694171] el0_sync_compat+0x178/0x180
> [ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
> [ 4.702721] ------------[ cut here ]------------
> [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
> <snip>
> [ 4.833830] Call trace:
> [ 4.836266] drm_object_attach_property+0x48/0xb8
> [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
> [ 4.846432] boe_panel_get_modes+0x88/0xd8
> [ 4.850516] drm_panel_get_modes+0x2c/0x48
> [ 4.854600] panel_bridge_get_modes+0x1c/0x28
> [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
> [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
> [ 4.869978] drm_mode_getconnector+0x1b4/0x45c
> [ 4.874410] drm_ioctl_kernel+0xac/0x128
> [ 4.878320] drm_ioctl+0x268/0x410
> [ 4.881711] drm_compat_ioctl+0xdc/0xf0
> [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
> [ 4.890142] el0_svc_common+0xf4/0x1c0
> [ 4.893879] do_el0_svc_compat+0x28/0x3c
> [ 4.897791] el0_svc_compat+0x10/0x1c
> [ 4.901441] el0_sync_compat_handler+0xa8/0xcc
> [ 4.905873] el0_sync_compat+0x178/0x180
> [ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
ping on the thread, thanks.
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index ae403c67cbd9..45a702ee09f3 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -205,6 +205,7 @@ struct mtk_dsi {
> u32 irq_data;
> wait_queue_head_t irq_wait_queue;
> const struct mtk_dsi_driver_data *driver_data;
> + enum drm_panel_orientation orientation;
> };
>
> static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
> @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> }
> drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
>
> + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
> +
> return 0;
>
> err_cleanup_encoder:
> @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> ret = PTR_ERR(dsi->next_bridge);
> goto err_unregister_host;
> }
> +
> + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
> + if (ret) {
> + dev_err(dev, "failed to get panel orientation %d\n", ret);
> + return ret;
> + }
> }
>
> dsi->driver_data = of_device_get_match_data(dev);
> --
> 2.31.1.295.g9ea45b61b8-goog
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
2021-04-20 9:05 ` [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
@ 2021-04-20 23:46 ` Chun-Kuang Hu
2021-04-21 1:56 ` Hsin-Yi Wang
0 siblings, 1 reply; 12+ messages in thread
From: Chun-Kuang Hu @ 2021-04-20 23:46 UTC (permalink / raw)
To: Hsin-Yi Wang
Cc: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra,
Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml,
Rob Herring, Devicetree List
Hi, Hsin-Yi:
Hsin-Yi Wang <hsinyi@chromium.org> 於 2021年4月20日 週二 下午5:05寫道:
>
> On Fri, Apr 9, 2021 at 12:53 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > drm_dev_register() sets connector->registration_state to
> > DRM_CONNECTOR_REGISTERED and dev->registered to true. If
> > drm_connector_set_panel_orientation() is first called after
> > drm_dev_register(), it will fail several checks and results in following
> > warning. So set panel orientation in dsi before drm_dev_register() is
> > called.
All connector would have this problem, so I would like to fix this in
common code.
In drm_connector_init(), you could add "panel orientation" property
with value DRM_MODE_PANEL_ORIENTATION_UNKNOWN, so it would not add new
object when get modes.
Regards,
Chun-Kuang.
> >
> > [ 4.480976] ------------[ cut here ]------------
> > [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
> > <snip>
> > [ 4.609772] Call trace:
> > [ 4.612208] __drm_mode_object_add+0xb4/0xbc
> > [ 4.616466] drm_mode_object_add+0x20/0x2c
> > [ 4.620552] drm_property_create+0xdc/0x174
> > [ 4.624723] drm_property_create_enum+0x34/0x98
> > [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
> > [ 4.634716] boe_panel_get_modes+0x88/0xd8
> > [ 4.638802] drm_panel_get_modes+0x2c/0x48
> > [ 4.642887] panel_bridge_get_modes+0x1c/0x28
> > [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
> > [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
> > [ 4.658266] drm_mode_getconnector+0x1b4/0x45c
> > [ 4.662699] drm_ioctl_kernel+0xac/0x128
> > [ 4.666611] drm_ioctl+0x268/0x410
> > [ 4.670002] drm_compat_ioctl+0xdc/0xf0
> > [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
> > [ 4.678436] el0_svc_common+0xf4/0x1c0
> > [ 4.682174] do_el0_svc_compat+0x28/0x3c
> > [ 4.686088] el0_svc_compat+0x10/0x1c
> > [ 4.689738] el0_sync_compat_handler+0xa8/0xcc
> > [ 4.694171] el0_sync_compat+0x178/0x180
> > [ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
> > [ 4.702721] ------------[ cut here ]------------
> > [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
> > <snip>
> > [ 4.833830] Call trace:
> > [ 4.836266] drm_object_attach_property+0x48/0xb8
> > [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
> > [ 4.846432] boe_panel_get_modes+0x88/0xd8
> > [ 4.850516] drm_panel_get_modes+0x2c/0x48
> > [ 4.854600] panel_bridge_get_modes+0x1c/0x28
> > [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
> > [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
> > [ 4.869978] drm_mode_getconnector+0x1b4/0x45c
> > [ 4.874410] drm_ioctl_kernel+0xac/0x128
> > [ 4.878320] drm_ioctl+0x268/0x410
> > [ 4.881711] drm_compat_ioctl+0xdc/0xf0
> > [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
> > [ 4.890142] el0_svc_common+0xf4/0x1c0
> > [ 4.893879] do_el0_svc_compat+0x28/0x3c
> > [ 4.897791] el0_svc_compat+0x10/0x1c
> > [ 4.901441] el0_sync_compat_handler+0xa8/0xcc
> > [ 4.905873] el0_sync_compat+0x178/0x180
> > [ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
>
> ping on the thread, thanks.
>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > index ae403c67cbd9..45a702ee09f3 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > @@ -205,6 +205,7 @@ struct mtk_dsi {
> > u32 irq_data;
> > wait_queue_head_t irq_wait_queue;
> > const struct mtk_dsi_driver_data *driver_data;
> > + enum drm_panel_orientation orientation;
> > };
> >
> > static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
> > @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> > }
> > drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
> >
> > + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
> > +
> > return 0;
> >
> > err_cleanup_encoder:
> > @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> > ret = PTR_ERR(dsi->next_bridge);
> > goto err_unregister_host;
> > }
> > +
> > + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
> > + if (ret) {
> > + dev_err(dev, "failed to get panel orientation %d\n", ret);
> > + return ret;
> > + }
> > }
> >
> > dsi->driver_data = of_device_get_match_data(dev);
> > --
> > 2.31.1.295.g9ea45b61b8-goog
> >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
2021-04-20 23:46 ` Chun-Kuang Hu
@ 2021-04-21 1:56 ` Hsin-Yi Wang
0 siblings, 0 replies; 12+ messages in thread
From: Hsin-Yi Wang @ 2021-04-21 1:56 UTC (permalink / raw)
To: Chun-Kuang Hu
Cc: Matthias Brugger, Enric Balletbo i Serra, Philipp Zabel,
David Airlie, Daniel Vetter, dri-devel,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE, lkml,
Rob Herring, Devicetree List
On Wed, Apr 21, 2021 at 7:47 AM Chun-Kuang Hu <chunkuang.hu@kernel.org> wrote:
>
> Hi, Hsin-Yi:
>
> Hsin-Yi Wang <hsinyi@chromium.org> 於 2021年4月20日 週二 下午5:05寫道:
> >
> > On Fri, Apr 9, 2021 at 12:53 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> > >
> > > drm_dev_register() sets connector->registration_state to
> > > DRM_CONNECTOR_REGISTERED and dev->registered to true. If
> > > drm_connector_set_panel_orientation() is first called after
> > > drm_dev_register(), it will fail several checks and results in following
> > > warning. So set panel orientation in dsi before drm_dev_register() is
> > > called.
>
> All connector would have this problem, so I would like to fix this in
> common code.
> In drm_connector_init(), you could add "panel orientation" property
> with value DRM_MODE_PANEL_ORIENTATION_UNKNOWN, so it would not add new
> object when get modes.
Hi CK,
Calling drm_connector_set_panel_orientation() with
DRM_MODE_PANEL_ORIENTATION_UNKNOWN will be a no-op. And once the
orientation is set, the 2nd call to this is also no-op.
https://elixir.bootlin.com/linux/v5.12-rc8/source/drivers/gpu/drm/drm_connector.c#L2182
The 1st time call to drm_connector_set_panel_orientation() has to be
prior than drm_dev_register().
Orientation is an optional property, and different dsi has different
ways to read and handle this. Eg. vlv_dsi[1], intel_dp[2], so I think
it's better to let each connector decide how to handle orientation.
[1] https://elixir.bootlin.com/linux/v5.12-rc8/source/drivers/gpu/drm/i915/display/vlv_dsi.c#L1632
[2] https://elixir.bootlin.com/linux/v5.12-rc8/source/drivers/gpu/drm/i915/display/intel_dp.c#L6488
Thanks
>
> Regards,
> Chun-Kuang.
>
> > >
> > > [ 4.480976] ------------[ cut here ]------------
> > > [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
> > > <snip>
> > > [ 4.609772] Call trace:
> > > [ 4.612208] __drm_mode_object_add+0xb4/0xbc
> > > [ 4.616466] drm_mode_object_add+0x20/0x2c
> > > [ 4.620552] drm_property_create+0xdc/0x174
> > > [ 4.624723] drm_property_create_enum+0x34/0x98
> > > [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
> > > [ 4.634716] boe_panel_get_modes+0x88/0xd8
> > > [ 4.638802] drm_panel_get_modes+0x2c/0x48
> > > [ 4.642887] panel_bridge_get_modes+0x1c/0x28
> > > [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
> > > [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
> > > [ 4.658266] drm_mode_getconnector+0x1b4/0x45c
> > > [ 4.662699] drm_ioctl_kernel+0xac/0x128
> > > [ 4.666611] drm_ioctl+0x268/0x410
> > > [ 4.670002] drm_compat_ioctl+0xdc/0xf0
> > > [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
> > > [ 4.678436] el0_svc_common+0xf4/0x1c0
> > > [ 4.682174] do_el0_svc_compat+0x28/0x3c
> > > [ 4.686088] el0_svc_compat+0x10/0x1c
> > > [ 4.689738] el0_sync_compat_handler+0xa8/0xcc
> > > [ 4.694171] el0_sync_compat+0x178/0x180
> > > [ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
> > > [ 4.702721] ------------[ cut here ]------------
> > > [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
> > > <snip>
> > > [ 4.833830] Call trace:
> > > [ 4.836266] drm_object_attach_property+0x48/0xb8
> > > [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
> > > [ 4.846432] boe_panel_get_modes+0x88/0xd8
> > > [ 4.850516] drm_panel_get_modes+0x2c/0x48
> > > [ 4.854600] panel_bridge_get_modes+0x1c/0x28
> > > [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
> > > [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
> > > [ 4.869978] drm_mode_getconnector+0x1b4/0x45c
> > > [ 4.874410] drm_ioctl_kernel+0xac/0x128
> > > [ 4.878320] drm_ioctl+0x268/0x410
> > > [ 4.881711] drm_compat_ioctl+0xdc/0xf0
> > > [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
> > > [ 4.890142] el0_svc_common+0xf4/0x1c0
> > > [ 4.893879] do_el0_svc_compat+0x28/0x3c
> > > [ 4.897791] el0_svc_compat+0x10/0x1c
> > > [ 4.901441] el0_sync_compat_handler+0xa8/0xcc
> > > [ 4.905873] el0_sync_compat+0x178/0x180
> > > [ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
> > >
> > > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> >
> > ping on the thread, thanks.
> >
> > > ---
> > > drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > > index ae403c67cbd9..45a702ee09f3 100644
> > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > > @@ -205,6 +205,7 @@ struct mtk_dsi {
> > > u32 irq_data;
> > > wait_queue_head_t irq_wait_queue;
> > > const struct mtk_dsi_driver_data *driver_data;
> > > + enum drm_panel_orientation orientation;
> > > };
> > >
> > > static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
> > > @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> > > }
> > > drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
> > >
> > > + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
> > > +
> > > return 0;
> > >
> > > err_cleanup_encoder:
> > > @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> > > ret = PTR_ERR(dsi->next_bridge);
> > > goto err_unregister_host;
> > > }
> > > +
> > > + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
> > > + if (ret) {
> > > + dev_err(dev, "failed to get panel orientation %d\n", ret);
> > > + return ret;
> > > + }
> > > }
> > >
> > > dsi->driver_data = of_device_get_match_data(dev);
> > > --
> > > 2.31.1.295.g9ea45b61b8-goog
> > >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
2021-04-09 4:53 [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
2021-04-09 4:53 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
2021-04-20 9:05 ` [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
@ 2021-04-23 13:53 ` Sean Paul
2021-04-26 5:19 ` Hsin-Yi Wang
2 siblings, 1 reply; 12+ messages in thread
From: Sean Paul @ 2021-04-23 13:53 UTC (permalink / raw)
To: Hsin-Yi Wang
Cc: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra,
Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
moderated list:ARM/Mediatek SoC support, linux-arm-kernel, LKML,
Rob Herring, devicetree
On Fri, Apr 9, 2021 at 12:53 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> drm_dev_register() sets connector->registration_state to
> DRM_CONNECTOR_REGISTERED and dev->registered to true. If
> drm_connector_set_panel_orientation() is first called after
> drm_dev_register(), it will fail several checks and results in following
> warning. So set panel orientation in dsi before drm_dev_register() is
> called.
>
> [ 4.480976] ------------[ cut here ]------------
> [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
> <snip>
> [ 4.609772] Call trace:
> [ 4.612208] __drm_mode_object_add+0xb4/0xbc
> [ 4.616466] drm_mode_object_add+0x20/0x2c
> [ 4.620552] drm_property_create+0xdc/0x174
> [ 4.624723] drm_property_create_enum+0x34/0x98
> [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
> [ 4.634716] boe_panel_get_modes+0x88/0xd8
> [ 4.638802] drm_panel_get_modes+0x2c/0x48
> [ 4.642887] panel_bridge_get_modes+0x1c/0x28
> [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
> [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
> [ 4.658266] drm_mode_getconnector+0x1b4/0x45c
> [ 4.662699] drm_ioctl_kernel+0xac/0x128
> [ 4.666611] drm_ioctl+0x268/0x410
> [ 4.670002] drm_compat_ioctl+0xdc/0xf0
> [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
> [ 4.678436] el0_svc_common+0xf4/0x1c0
> [ 4.682174] do_el0_svc_compat+0x28/0x3c
> [ 4.686088] el0_svc_compat+0x10/0x1c
> [ 4.689738] el0_sync_compat_handler+0xa8/0xcc
> [ 4.694171] el0_sync_compat+0x178/0x180
> [ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
> [ 4.702721] ------------[ cut here ]------------
> [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
> <snip>
> [ 4.833830] Call trace:
> [ 4.836266] drm_object_attach_property+0x48/0xb8
> [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
> [ 4.846432] boe_panel_get_modes+0x88/0xd8
> [ 4.850516] drm_panel_get_modes+0x2c/0x48
> [ 4.854600] panel_bridge_get_modes+0x1c/0x28
> [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
> [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
> [ 4.869978] drm_mode_getconnector+0x1b4/0x45c
> [ 4.874410] drm_ioctl_kernel+0xac/0x128
> [ 4.878320] drm_ioctl+0x268/0x410
> [ 4.881711] drm_compat_ioctl+0xdc/0xf0
> [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
> [ 4.890142] el0_svc_common+0xf4/0x1c0
> [ 4.893879] do_el0_svc_compat+0x28/0x3c
> [ 4.897791] el0_svc_compat+0x10/0x1c
> [ 4.901441] el0_sync_compat_handler+0xa8/0xcc
> [ 4.905873] el0_sync_compat+0x178/0x180
> [ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index ae403c67cbd9..45a702ee09f3 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -205,6 +205,7 @@ struct mtk_dsi {
> u32 irq_data;
> wait_queue_head_t irq_wait_queue;
> const struct mtk_dsi_driver_data *driver_data;
> + enum drm_panel_orientation orientation;
> };
>
> static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
> @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> }
> drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
>
> + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
> +
> return 0;
>
> err_cleanup_encoder:
> @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> ret = PTR_ERR(dsi->next_bridge);
> goto err_unregister_host;
> }
> +
> + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
> + if (ret) {
> + dev_err(dev, "failed to get panel orientation %d\n", ret);
> + return ret;
> + }
I don't think this is the right place to mine orientation since it
duplicates the call from the panel driver.
Instead, how about splitting out
property_create_enum/attach_orientation_property from
set_panel_orientation such that you can attach the property (with
UNKNOWN value) in the connector init and then leave the panel to set
it properly in get_modes (I kind of disagree with populating this in
get_modes as well, but I don't think there's anywhere else to stick it
right now)?
AFAICT orientation is the only property which has the create/attach
calls in the set function which seems like a perfect recipe for this
type of failure.
Sean
> }
>
> dsi->driver_data = of_device_get_match_data(dev);
> --
> 2.31.1.295.g9ea45b61b8-goog
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register().
2021-04-23 13:53 ` Sean Paul
@ 2021-04-26 5:19 ` Hsin-Yi Wang
0 siblings, 0 replies; 12+ messages in thread
From: Hsin-Yi Wang @ 2021-04-26 5:19 UTC (permalink / raw)
To: Sean Paul
Cc: Chun-Kuang Hu, Matthias Brugger, Enric Balletbo i Serra,
Philipp Zabel, David Airlie, Daniel Vetter, dri-devel,
moderated list:ARM/Mediatek SoC support, linux-arm-kernel, LKML,
Rob Herring, devicetree
On Fri, Apr 23, 2021 at 9:53 PM Sean Paul <sean@poorly.run> wrote:
>
> On Fri, Apr 9, 2021 at 12:53 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > drm_dev_register() sets connector->registration_state to
> > DRM_CONNECTOR_REGISTERED and dev->registered to true. If
> > drm_connector_set_panel_orientation() is first called after
> > drm_dev_register(), it will fail several checks and results in following
> > warning. So set panel orientation in dsi before drm_dev_register() is
> > called.
> >
> > [ 4.480976] ------------[ cut here ]------------
> > [ 4.485603] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:45 __drm_mode_object_add+0xb4/0xbc
> > <snip>
> > [ 4.609772] Call trace:
> > [ 4.612208] __drm_mode_object_add+0xb4/0xbc
> > [ 4.616466] drm_mode_object_add+0x20/0x2c
> > [ 4.620552] drm_property_create+0xdc/0x174
> > [ 4.624723] drm_property_create_enum+0x34/0x98
> > [ 4.629241] drm_connector_set_panel_orientation+0x64/0xa0
> > [ 4.634716] boe_panel_get_modes+0x88/0xd8
> > [ 4.638802] drm_panel_get_modes+0x2c/0x48
> > [ 4.642887] panel_bridge_get_modes+0x1c/0x28
> > [ 4.647233] drm_bridge_connector_get_modes+0xa0/0xd4
> > [ 4.652273] drm_helper_probe_single_connector_modes+0x218/0x700
> > [ 4.658266] drm_mode_getconnector+0x1b4/0x45c
> > [ 4.662699] drm_ioctl_kernel+0xac/0x128
> > [ 4.666611] drm_ioctl+0x268/0x410
> > [ 4.670002] drm_compat_ioctl+0xdc/0xf0
> > [ 4.673829] __arm64_compat_sys_ioctl+0xc8/0x100
> > [ 4.678436] el0_svc_common+0xf4/0x1c0
> > [ 4.682174] do_el0_svc_compat+0x28/0x3c
> > [ 4.686088] el0_svc_compat+0x10/0x1c
> > [ 4.689738] el0_sync_compat_handler+0xa8/0xcc
> > [ 4.694171] el0_sync_compat+0x178/0x180
> > [ 4.698082] ---[ end trace b4f2db9d9c88610b ]---
> > [ 4.702721] ------------[ cut here ]------------
> > [ 4.707329] WARNING: CPU: 5 PID: 369 at drivers/gpu/drm/drm_mode_object.c:243 drm_object_attach_property+0x48/0xb8
> > <snip>
> > [ 4.833830] Call trace:
> > [ 4.836266] drm_object_attach_property+0x48/0xb8
> > [ 4.840958] drm_connector_set_panel_orientation+0x84/0xa0
> > [ 4.846432] boe_panel_get_modes+0x88/0xd8
> > [ 4.850516] drm_panel_get_modes+0x2c/0x48
> > [ 4.854600] panel_bridge_get_modes+0x1c/0x28
> > [ 4.858946] drm_bridge_connector_get_modes+0xa0/0xd4
> > [ 4.863984] drm_helper_probe_single_connector_modes+0x218/0x700
> > [ 4.869978] drm_mode_getconnector+0x1b4/0x45c
> > [ 4.874410] drm_ioctl_kernel+0xac/0x128
> > [ 4.878320] drm_ioctl+0x268/0x410
> > [ 4.881711] drm_compat_ioctl+0xdc/0xf0
> > [ 4.885536] __arm64_compat_sys_ioctl+0xc8/0x100
> > [ 4.890142] el0_svc_common+0xf4/0x1c0
> > [ 4.893879] do_el0_svc_compat+0x28/0x3c
> > [ 4.897791] el0_svc_compat+0x10/0x1c
> > [ 4.901441] el0_sync_compat_handler+0xa8/0xcc
> > [ 4.905873] el0_sync_compat+0x178/0x180
> > [ 4.909783] ---[ end trace b4f2db9d9c88610c ]---
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > index ae403c67cbd9..45a702ee09f3 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > @@ -205,6 +205,7 @@ struct mtk_dsi {
> > u32 irq_data;
> > wait_queue_head_t irq_wait_queue;
> > const struct mtk_dsi_driver_data *driver_data;
> > + enum drm_panel_orientation orientation;
> > };
> >
> > static inline struct mtk_dsi *bridge_to_dsi(struct drm_bridge *b)
> > @@ -966,6 +967,8 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> > }
> > drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
> >
> > + drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
> > +
> > return 0;
> >
> > err_cleanup_encoder:
> > @@ -1029,6 +1032,12 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> > ret = PTR_ERR(dsi->next_bridge);
> > goto err_unregister_host;
> > }
> > +
> > + ret = of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
> > + if (ret) {
> > + dev_err(dev, "failed to get panel orientation %d\n", ret);
> > + return ret;
> > + }
>
> I don't think this is the right place to mine orientation since it
> duplicates the call from the panel driver.
>
> Instead, how about splitting out
> property_create_enum/attach_orientation_property from
> set_panel_orientation such that you can attach the property (with
> UNKNOWN value) in the connector init and then leave the panel to set
> it properly in get_modes (I kind of disagree with populating this in
> get_modes as well, but I don't think there's anywhere else to stick it
> right now)?
>
> AFAICT orientation is the only property which has the create/attach
> calls in the set function which seems like a perfect recipe for this
> type of failure.
>
>
> Sean
>
Thanks for the review. It is updated in v2.
> > }
> >
> > dsi->driver_data = of_device_get_match_data(dev);
> > --
> > 2.31.1.295.g9ea45b61b8-goog
> >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] drm/mediatek: Config orientation property if panel provides it
@ 2022-05-30 11:30 Hsin-Yi Wang
2022-05-30 11:30 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
0 siblings, 1 reply; 12+ messages in thread
From: Hsin-Yi Wang @ 2022-05-30 11:30 UTC (permalink / raw)
To: Chun-Kuang Hu
Cc: Hans de Goede, Philipp Zabel, David Airlie, Daniel Vetter,
Matthias Brugger, dri-devel, linux-mediatek, Rob Clark,
Stephen Boyd, Douglas Anderson, Rob Herring, linux-arm-kernel,
linux-kernel
Panel orientation property should be set before drm_dev_register().
Mediatek drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.
Let the drm driver check if the remote end point is a panel and if it
contains the orientation property. If it does, set it before
drm_dev_register() is called.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
This patch is to solve the same problem as [1]
[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index d9f10a33e6fa..091107f97ccc 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -198,6 +198,7 @@ struct mtk_dsi {
unsigned long mode_flags;
enum mipi_dsi_pixel_format format;
+ enum drm_panel_orientation orientation;
unsigned int lanes;
struct videomode vm;
struct mtk_phy_timing phy_timing;
@@ -822,6 +823,10 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
ret = PTR_ERR(dsi->connector);
goto err_cleanup_encoder;
}
+
+ if (dsi->orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
+ drm_connector_set_panel_orientation(dsi->connector, dsi->orientation);
+
drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
return 0;
@@ -836,6 +841,14 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
int ret;
struct drm_device *drm = data;
struct mtk_dsi *dsi = dev_get_drvdata(dev);
+ struct drm_panel *panel;
+
+ /* Read panel orientation if existed */
+ dsi->orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+ ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, NULL);
+ if (!ret && panel && panel->dev) {
+ of_drm_get_panel_orientation(panel->dev->of_node, &dsi->orientation);
+ }
ret = mtk_dsi_encoder_init(drm, dsi);
if (ret)
--
2.36.1.124.g0e6072fb45-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2022-05-30 11:30 [PATCH 1/2] drm/mediatek: Config orientation property if panel provides it Hsin-Yi Wang
@ 2022-05-30 11:30 ` Hsin-Yi Wang
2022-06-06 15:29 ` Hsin-Yi Wang
0 siblings, 1 reply; 12+ messages in thread
From: Hsin-Yi Wang @ 2022-05-30 11:30 UTC (permalink / raw)
To: Chun-Kuang Hu
Cc: Hans de Goede, Philipp Zabel, David Airlie, Daniel Vetter,
Matthias Brugger, dri-devel, linux-mediatek, Rob Clark,
Stephen Boyd, Douglas Anderson, Rob Herring, linux-arm-kernel,
linux-kernel
krane, kakadu, and kodama boards have a default panel rotation.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index 8d5bf73a9099..f0dd5a06629d 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -276,6 +276,7 @@ panel: panel@0 {
avee-supply = <&ppvarp_lcd>;
pp1800-supply = <&pp1800_lcd>;
backlight = <&backlight_lcd0>;
+ rotation = <270>;
port {
panel_in: endpoint {
remote-endpoint = <&dsi_out>;
--
2.36.1.124.g0e6072fb45-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2022-05-30 11:30 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
@ 2022-06-06 15:29 ` Hsin-Yi Wang
2022-06-17 14:10 ` Matthias Brugger
0 siblings, 1 reply; 12+ messages in thread
From: Hsin-Yi Wang @ 2022-06-06 15:29 UTC (permalink / raw)
To: Chun-Kuang Hu, Matthias Brugger
Cc: Hans de Goede, Philipp Zabel, David Airlie, Daniel Vetter,
dri-devel, linux-mediatek, Rob Clark, Stephen Boyd,
Douglas Anderson, Rob Herring, linux-arm-kernel, linux-kernel
On Mon, May 30, 2022 at 7:30 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> krane, kakadu, and kodama boards have a default panel rotation.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
Hi Matthias,
The series ("Add a panel API to return panel orientation") might land
in drm-misc. With this series applied, we can add this patch to give
the correct default orientation for mt8183 kukui devices.
I didn't send this patch again with the series, since they might land
in different trees.
Thanks.
> arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> index 8d5bf73a9099..f0dd5a06629d 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> @@ -276,6 +276,7 @@ panel: panel@0 {
> avee-supply = <&ppvarp_lcd>;
> pp1800-supply = <&pp1800_lcd>;
> backlight = <&backlight_lcd0>;
> + rotation = <270>;
> port {
> panel_in: endpoint {
> remote-endpoint = <&dsi_out>;
> --
> 2.36.1.124.g0e6072fb45-goog
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2022-06-06 15:29 ` Hsin-Yi Wang
@ 2022-06-17 14:10 ` Matthias Brugger
2022-06-17 14:25 ` Hsin-Yi Wang
0 siblings, 1 reply; 12+ messages in thread
From: Matthias Brugger @ 2022-06-17 14:10 UTC (permalink / raw)
To: Hsin-Yi Wang, Chun-Kuang Hu
Cc: Hans de Goede, Philipp Zabel, David Airlie, Daniel Vetter,
dri-devel, linux-mediatek, Rob Clark, Stephen Boyd,
Douglas Anderson, Rob Herring, linux-arm-kernel, linux-kernel
Hi Hsin-Yi Wang,
On 06/06/2022 17:29, Hsin-Yi Wang wrote:
> On Mon, May 30, 2022 at 7:30 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> krane, kakadu, and kodama boards have a default panel rotation.
>>
>> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
>> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>
> Hi Matthias,
>
> The series ("Add a panel API to return panel orientation") might land
> in drm-misc. With this series applied, we can add this patch to give
> the correct default orientation for mt8183 kukui devices.
> I didn't send this patch again with the series, since they might land
> in different trees.
>
I had a look on Linux next (next-20220617) and wasn't able to find the mtk_dsi.c
changes. What is the status of this?
Regards,
Matthias
> Thanks.
>
>> arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>> index 8d5bf73a9099..f0dd5a06629d 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>> +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>> @@ -276,6 +276,7 @@ panel: panel@0 {
>> avee-supply = <&ppvarp_lcd>;
>> pp1800-supply = <&pp1800_lcd>;
>> backlight = <&backlight_lcd0>;
>> + rotation = <270>;
>> port {
>> panel_in: endpoint {
>> remote-endpoint = <&dsi_out>;
>> --
>> 2.36.1.124.g0e6072fb45-goog
>>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2022-06-17 14:10 ` Matthias Brugger
@ 2022-06-17 14:25 ` Hsin-Yi Wang
2022-07-07 14:53 ` Matthias Brugger
0 siblings, 1 reply; 12+ messages in thread
From: Hsin-Yi Wang @ 2022-06-17 14:25 UTC (permalink / raw)
To: Matthias Brugger
Cc: Chun-Kuang Hu, Hans de Goede, Philipp Zabel, David Airlie,
Daniel Vetter, dri-devel, linux-mediatek, Rob Clark,
Stephen Boyd, Douglas Anderson, Rob Herring, linux-arm-kernel,
linux-kernel
On Fri, Jun 17, 2022 at 10:10 PM Matthias Brugger
<matthias.bgg@gmail.com> wrote:
>
> Hi Hsin-Yi Wang,
>
> On 06/06/2022 17:29, Hsin-Yi Wang wrote:
> > On Mon, May 30, 2022 at 7:30 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >>
> >> krane, kakadu, and kodama boards have a default panel rotation.
> >>
> >> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> >> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> >> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> >> ---
> >
> > Hi Matthias,
> >
> > The series ("Add a panel API to return panel orientation") might land
> > in drm-misc. With this series applied, we can add this patch to give
> > the correct default orientation for mt8183 kukui devices.
> > I didn't send this patch again with the series, since they might land
> > in different trees.
> >
>
> I had a look on Linux next (next-20220617) and wasn't able to find the mtk_dsi.c
> changes. What is the status of this?
>
The mtk_dsi change got dropped. The latest is this series:
https://lore.kernel.org/lkml/20220609072722.3488207-1-hsinyi@chromium.org/,
still waiting to be picked or others' comments.
If the dts patch is picked without the drm series, there will be a
WARN, but won't affect boot or display up.
> Regards,
> Matthias
>
> > Thanks.
> >
> >> arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> >> index 8d5bf73a9099..f0dd5a06629d 100644
> >> --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> >> +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
> >> @@ -276,6 +276,7 @@ panel: panel@0 {
> >> avee-supply = <&ppvarp_lcd>;
> >> pp1800-supply = <&pp1800_lcd>;
> >> backlight = <&backlight_lcd0>;
> >> + rotation = <270>;
> >> port {
> >> panel_in: endpoint {
> >> remote-endpoint = <&dsi_out>;
> >> --
> >> 2.36.1.124.g0e6072fb45-goog
> >>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] arm64: dts: mt8183: Add panel rotation
2022-06-17 14:25 ` Hsin-Yi Wang
@ 2022-07-07 14:53 ` Matthias Brugger
0 siblings, 0 replies; 12+ messages in thread
From: Matthias Brugger @ 2022-07-07 14:53 UTC (permalink / raw)
To: Hsin-Yi Wang
Cc: Chun-Kuang Hu, Hans de Goede, Philipp Zabel, David Airlie,
Daniel Vetter, dri-devel, linux-mediatek, Rob Clark,
Stephen Boyd, Douglas Anderson, Rob Herring, linux-arm-kernel,
linux-kernel
On 17/06/2022 16:25, Hsin-Yi Wang wrote:
> On Fri, Jun 17, 2022 at 10:10 PM Matthias Brugger
> <matthias.bgg@gmail.com> wrote:
>>
>> Hi Hsin-Yi Wang,
>>
>> On 06/06/2022 17:29, Hsin-Yi Wang wrote:
>>> On Mon, May 30, 2022 at 7:30 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>>>
>>>> krane, kakadu, and kodama boards have a default panel rotation.
>>>>
>>>> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
>>>> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>>>> ---
>>>
>>> Hi Matthias,
>>>
>>> The series ("Add a panel API to return panel orientation") might land
>>> in drm-misc. With this series applied, we can add this patch to give
>>> the correct default orientation for mt8183 kukui devices.
>>> I didn't send this patch again with the series, since they might land
>>> in different trees.
>>>
>>
>> I had a look on Linux next (next-20220617) and wasn't able to find the mtk_dsi.c
>> changes. What is the status of this?
>>
> The mtk_dsi change got dropped. The latest is this series:
> https://lore.kernel.org/lkml/20220609072722.3488207-1-hsinyi@chromium.org/,
> still waiting to be picked or others' comments.
>
I saw this got merged, so merging this patch now.
Thanks!
> If the dts patch is picked without the drm series, there will be a
> WARN, but won't affect boot or display up.
>
>
>> Regards,
>> Matthias
>>
>>> Thanks.
>>>
>>>> arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>>>> index 8d5bf73a9099..f0dd5a06629d 100644
>>>> --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
>>>> @@ -276,6 +276,7 @@ panel: panel@0 {
>>>> avee-supply = <&ppvarp_lcd>;
>>>> pp1800-supply = <&pp1800_lcd>;
>>>> backlight = <&backlight_lcd0>;
>>>> + rotation = <270>;
>>>> port {
>>>> panel_in: endpoint {
>>>> remote-endpoint = <&dsi_out>;
>>>> --
>>>> 2.36.1.124.g0e6072fb45-goog
>>>>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-07-07 14:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 4:53 [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
2021-04-09 4:53 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
2021-04-20 9:05 ` [PATCH 1/2] drm/mediatek: set panel orientation before drm_dev_register() Hsin-Yi Wang
2021-04-20 23:46 ` Chun-Kuang Hu
2021-04-21 1:56 ` Hsin-Yi Wang
2021-04-23 13:53 ` Sean Paul
2021-04-26 5:19 ` Hsin-Yi Wang
2022-05-30 11:30 [PATCH 1/2] drm/mediatek: Config orientation property if panel provides it Hsin-Yi Wang
2022-05-30 11:30 ` [PATCH 2/2] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
2022-06-06 15:29 ` Hsin-Yi Wang
2022-06-17 14:10 ` Matthias Brugger
2022-06-17 14:25 ` Hsin-Yi Wang
2022-07-07 14:53 ` Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).