* [PATCH] drm/mediatek: Only try to attach bridge if there is one
@ 2018-11-26 4:07 ` Nicolas Boichat
2018-11-26 5:30 ` CK Hu
2018-11-26 6:58 ` Andrzej Hajda
0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Boichat @ 2018-11-26 4:07 UTC (permalink / raw)
To: CK Hu
Cc: Philipp Zabel, David Airlie, Matthias Brugger, dri-devel,
linux-arm-kernel, linux-mediatek, linux-kernel
Even if dsi->bridge is NULL, we still try to call drm_bridge_attach,
and print out an error message, before creating the connector.
When no bridge is provided, let's skip these 2 steps and directly
create the connector.
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 66df1b17795921..27b507eb4a997d 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi)
dsi->encoder.possible_crtcs = 1;
/* If there's a bridge, attach to it and let it create the connector */
- ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
- if (ret) {
- DRM_ERROR("Failed to attach bridge to drm\n");
-
+ if (dsi->bridge) {
+ ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
+ if (ret) {
+ DRM_ERROR("Failed to attach bridge to drm\n");
+ goto err_encoder_cleanup;
+ }
+ } else {
/* Otherwise create our own connector and attach to a panel */
ret = mtk_dsi_create_connector(drm, dsi);
if (ret)
--
2.20.0.rc0.387.gc7a69e6b6c-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/mediatek: Only try to attach bridge if there is one
2018-11-26 4:07 ` [PATCH] drm/mediatek: Only try to attach bridge if there is one Nicolas Boichat
@ 2018-11-26 5:30 ` CK Hu
2018-12-03 3:27 ` CK Hu
2018-11-26 6:58 ` Andrzej Hajda
1 sibling, 1 reply; 4+ messages in thread
From: CK Hu @ 2018-11-26 5:30 UTC (permalink / raw)
To: Nicolas Boichat
Cc: Philipp Zabel, David Airlie, Matthias Brugger, dri-devel,
linux-arm-kernel, linux-mediatek, linux-kernel
Hi, Nicolas:
On Mon, 2018-11-26 at 12:07 +0800, Nicolas Boichat wrote:
> Even if dsi->bridge is NULL, we still try to call drm_bridge_attach,
> and print out an error message, before creating the connector.
>
> When no bridge is provided, let's skip these 2 steps and directly
> create the connector.
Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 66df1b17795921..27b507eb4a997d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi)
> dsi->encoder.possible_crtcs = 1;
>
> /* If there's a bridge, attach to it and let it create the connector */
> - ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
> - if (ret) {
> - DRM_ERROR("Failed to attach bridge to drm\n");
> -
> + if (dsi->bridge) {
> + ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
> + if (ret) {
> + DRM_ERROR("Failed to attach bridge to drm\n");
> + goto err_encoder_cleanup;
> + }
> + } else {
> /* Otherwise create our own connector and attach to a panel */
> ret = mtk_dsi_create_connector(drm, dsi);
> if (ret)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/mediatek: Only try to attach bridge if there is one
2018-11-26 4:07 ` [PATCH] drm/mediatek: Only try to attach bridge if there is one Nicolas Boichat
2018-11-26 5:30 ` CK Hu
@ 2018-11-26 6:58 ` Andrzej Hajda
1 sibling, 0 replies; 4+ messages in thread
From: Andrzej Hajda @ 2018-11-26 6:58 UTC (permalink / raw)
To: Nicolas Boichat, CK Hu
Cc: David Airlie, linux-kernel, dri-devel, linux-mediatek,
Matthias Brugger, linux-arm-kernel
On 26.11.2018 05:07, Nicolas Boichat wrote:
> Even if dsi->bridge is NULL, we still try to call drm_bridge_attach,
> and print out an error message, before creating the connector.
>
> When no bridge is provided, let's skip these 2 steps and directly
> create the connector.
>
> Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
--
Regards
Andrzej
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/mediatek: Only try to attach bridge if there is one
2018-11-26 5:30 ` CK Hu
@ 2018-12-03 3:27 ` CK Hu
0 siblings, 0 replies; 4+ messages in thread
From: CK Hu @ 2018-12-03 3:27 UTC (permalink / raw)
To: Nicolas Boichat
Cc: Philipp Zabel, David Airlie, Matthias Brugger, dri-devel,
linux-arm-kernel, linux-mediatek, linux-kernel
Hi, Nicolas:
On Mon, 2018-11-26 at 13:30 +0800, CK Hu wrote:
> Hi, Nicolas:
>
> On Mon, 2018-11-26 at 12:07 +0800, Nicolas Boichat wrote:
> > Even if dsi->bridge is NULL, we still try to call drm_bridge_attach,
> > and print out an error message, before creating the connector.
> >
> > When no bridge is provided, let's skip these 2 steps and directly
> > create the connector.
>
Applied to mediatek-drm-fixes-4.20 [1], thanks.
[1]
https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-fixes-4.20
Regards,
CK
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> >
> > Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +++++++----
> > 1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > index 66df1b17795921..27b507eb4a997d 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> > @@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi)
> > dsi->encoder.possible_crtcs = 1;
> >
> > /* If there's a bridge, attach to it and let it create the connector */
> > - ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
> > - if (ret) {
> > - DRM_ERROR("Failed to attach bridge to drm\n");
> > -
> > + if (dsi->bridge) {
> > + ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL);
> > + if (ret) {
> > + DRM_ERROR("Failed to attach bridge to drm\n");
> > + goto err_encoder_cleanup;
> > + }
> > + } else {
> > /* Otherwise create our own connector and attach to a panel */
> > ret = mtk_dsi_create_connector(drm, dsi);
> > if (ret)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-03 3:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20181126041445epcas4p1f0db29e800181de3971f08f6939eec51@epcas4p1.samsung.com>
2018-11-26 4:07 ` [PATCH] drm/mediatek: Only try to attach bridge if there is one Nicolas Boichat
2018-11-26 5:30 ` CK Hu
2018-12-03 3:27 ` CK Hu
2018-11-26 6:58 ` Andrzej Hajda
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).