Re: [PATCH 5/8] drm: Nuke drm_atomic_helper_plane_set_property
On 07/25/2017 10:01 AM, Daniel Vetter wrote: > It's dead code, the core handles all this directly now. This also > allows us to unexport drm_atomic_helper_plane_set_property. > > Signed-off-by: Daniel Vetter <daniel.vet...@intel.com> [...] > drivers/gpu/drm/sti/sti_cursor.c| 1 - > drivers/gpu/drm/sti/sti_gdp.c | 1 - > drivers/gpu/drm/sti/sti_hqvdp.c | 1 - Acked-by: Vincent Abriou <vincent.abr...@st.com> BR Vincent
Re: [PATCH v3 03/13] drm: bridge: Link encoder and bridge in core code
On 11/29/2016 10:04 AM, Laurent Pinchart wrote: > Instead of linking encoders and bridges in every driver (and getting it > wrong half of the time, as many drivers forget to set the drm_bridge > encoder pointer), do so in core code. The drm_bridge_attach() function > needs the encoder and optional previous bridge to perform that task, > update all the callers. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com> > --- > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 4 +- > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 +- > drivers/gpu/drm/bridge/dw-hdmi.c | 3 +- > drivers/gpu/drm/drm_bridge.c | 46 > -- > drivers/gpu/drm/drm_simple_kms_helper.c| 4 +- > drivers/gpu/drm/exynos/exynos_dp.c | 5 +-- > drivers/gpu/drm/exynos/exynos_drm_dsi.c| 6 +-- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 5 +-- > drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 5 +-- > drivers/gpu/drm/imx/imx-ldb.c | 6 +-- > drivers/gpu/drm/imx/parallel-display.c | 4 +- > drivers/gpu/drm/mediatek/mtk_dpi.c | 8 ++-- > drivers/gpu/drm/mediatek/mtk_dsi.c | 24 ++- > drivers/gpu/drm/mediatek/mtk_hdmi.c| 11 +++--- > drivers/gpu/drm/msm/dsi/dsi_manager.c | 17 +--- > drivers/gpu/drm/msm/edp/edp_bridge.c | 2 +- > drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 2 +- > drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c | 5 +-- > drivers/gpu/drm/sti/sti_dvo.c | 3 +- > drivers/gpu/drm/sti/sti_hda.c | 3 +- > drivers/gpu/drm/sti/sti_hdmi.c | 3 +- Hi Laurent, For sti dvo, hda and hdmi: Acked-by: Vincent Abriou <vincent.abr...@st.com> Vincent > drivers/gpu/drm/sun4i/sun4i_rgb.c | 13 +++--- > include/drm/drm_bridge.h | 3 +- > 23 files changed, 83 insertions(+), 103 deletions(-) > > diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c > b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c > index 6119b5085501..e7799b6ee829 100644 > --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c > +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c > @@ -230,9 +230,7 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device > *dev, > of_node_put(np); > > if (bridge) { > - output->encoder.bridge = bridge; > - bridge->encoder = >encoder; > - ret = drm_bridge_attach(dev, bridge); > + ret = drm_bridge_attach(>encoder, bridge, NULL); > if (!ret) > return 0; > } > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index 6e0447f329a2..1835f1fdad19 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -1227,12 +1227,10 @@ static int analogix_dp_create_bridge(struct > drm_device *drm_dev, > > dp->bridge = bridge; > > - dp->encoder->bridge = bridge; > bridge->driver_private = dp; > - bridge->encoder = dp->encoder; > bridge->funcs = _dp_bridge_funcs; > > - ret = drm_bridge_attach(drm_dev, bridge); > + ret = drm_bridge_attach(dp->encoder, bridge, NULL); > if (ret) { > DRM_ERROR("failed to attach drm bridge\n"); > return -EINVAL; > diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c > b/drivers/gpu/drm/bridge/dw-hdmi.c > index b71088dab268..432e0e3fff72 100644 > --- a/drivers/gpu/drm/bridge/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/dw-hdmi.c > @@ -1841,13 +1841,12 @@ static int dw_hdmi_register(struct drm_device *drm, > struct dw_hdmi *hdmi) > hdmi->bridge = bridge; > bridge->driver_private = hdmi; > bridge->funcs = _hdmi_bridge_funcs; > - ret = drm_bridge_attach(drm, bridge); > + ret = drm_bridge_attach(encoder, bridge, NULL); > if (ret) { > DRM_ERROR("Failed to initialize bridge with drm\n"); > return -EINVAL; > } > > - encoder->bridge = bridge; > hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD; > > drm_connector_helper_add(>connector, > diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c > index 0ee052b7c21a..850bd6509ef1 100644 > --- a/drivers/gpu/drm/drm_bridge.c > +++ b/drivers/gpu/drm/drm_brid
Re: [PATCH v3 11/13] drm: Set on-chip bridges' encoder type
On 11/29/2016 10:04 AM, Laurent Pinchart wrote: > Initialize the new drm_bridge::encoder_type field to the right value for > all bridges that model on-SoC IP cores. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com> > --- > drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 ++ > drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 ++ > drivers/gpu/drm/sti/sti_dvo.c | 2 ++ > 3 files changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c > b/drivers/gpu/drm/exynos/exynos_drm_mic.c > index a0def0be6d65..7175ecda36e8 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c > @@ -390,6 +390,8 @@ static int exynos_mic_bind(struct device *dev, struct > device *master, > mic->bridge.funcs = _bridge_funcs; > mic->bridge.of_node = dev->of_node; > mic->bridge.driver_private = mic; > + mic->bridge.encoder_type = DRM_MODE_ENCODER_DSI; > + > ret = drm_bridge_add(>bridge); > if (ret) > DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c > b/drivers/gpu/drm/mediatek/mtk_hdmi.c > index 5ca1b0fbf937..bb5cf594c721 100644 > --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c > @@ -1712,6 +1712,8 @@ static int mtk_drm_hdmi_probe(struct platform_device > *pdev) > > hdmi->bridge.funcs = _hdmi_bridge_funcs; > hdmi->bridge.of_node = pdev->dev.of_node; > + hdmi->bridge.encoder_type = DRM_MODE_ENCODER_TMDS; > + > ret = drm_bridge_add(>bridge); > if (ret) { > dev_err(dev, "failed to add bridge, ret = %d\n", ret); > diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c > index 411dc6ec976e..8912c932078f 100644 > --- a/drivers/gpu/drm/sti/sti_dvo.c > +++ b/drivers/gpu/drm/sti/sti_dvo.c > @@ -472,6 +472,8 @@ static int sti_dvo_bind(struct device *dev, struct device > *master, void *data) > bridge->driver_private = dvo; > bridge->funcs = _dvo_bridge_funcs; > bridge->of_node = dvo->dev.of_node; > + bridge->encoder_type = DRM_MODE_ENCODER_LVDS; > + > err = drm_bridge_add(bridge); > if (err) { > DRM_ERROR("Failed to add bridge\n"); For the sti dvo part: Acked-by: Vincent Abriou <vincent.abr...@st.com> Vincent >
Re: [PATCH v2 11/20] drm: sti: Rely on the default ->best_encoder() behavior
Hi Boris, Thanks for the patch. Acked-by: Vincent Abriou <vincent.abr...@st.com> Vincent On 06/07/2016 01:48 PM, Boris Brezillon wrote: > All outputs have a 1:1 relationship between connectors and encoders > and the driver is relying on the atomic helpers: we can drop the custom > ->best_encoder() implementations and let the core call > drm_atomic_helper_best_encoder() for us. > > Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> > --- > drivers/gpu/drm/sti/sti_dvo.c | 10 -- > drivers/gpu/drm/sti/sti_hda.c | 10 -- > drivers/gpu/drm/sti/sti_hdmi.c | 10 -- > 3 files changed, 30 deletions(-) > > diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c > index 25f7663..d5627d1 100644 > --- a/drivers/gpu/drm/sti/sti_dvo.c > +++ b/drivers/gpu/drm/sti/sti_dvo.c > @@ -384,20 +384,10 @@ static int sti_dvo_connector_mode_valid(struct > drm_connector *connector, > return MODE_OK; > } > > -struct drm_encoder *sti_dvo_best_encoder(struct drm_connector *connector) > -{ > - struct sti_dvo_connector *dvo_connector > - = to_sti_dvo_connector(connector); > - > - /* Best encoder is the one associated during connector creation */ > - return dvo_connector->encoder; > -} > - > static const > struct drm_connector_helper_funcs sti_dvo_connector_helper_funcs = { > .get_modes = sti_dvo_connector_get_modes, > .mode_valid = sti_dvo_connector_mode_valid, > - .best_encoder = sti_dvo_best_encoder, > }; > > static enum drm_connector_status > diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c > index f7d3464..c4649f5 100644 > --- a/drivers/gpu/drm/sti/sti_hda.c > +++ b/drivers/gpu/drm/sti/sti_hda.c > @@ -676,20 +676,10 @@ static int sti_hda_connector_mode_valid(struct > drm_connector *connector, > return MODE_OK; > } > > -struct drm_encoder *sti_hda_best_encoder(struct drm_connector *connector) > -{ > - struct sti_hda_connector *hda_connector > - = to_sti_hda_connector(connector); > - > - /* Best encoder is the one associated during connector creation */ > - return hda_connector->encoder; > -} > - > static const > struct drm_connector_helper_funcs sti_hda_connector_helper_funcs = { > .get_modes = sti_hda_connector_get_modes, > .mode_valid = sti_hda_connector_mode_valid, > - .best_encoder = sti_hda_best_encoder, > }; > > static enum drm_connector_status > diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c > index 6ef0715..dc9ab6e 100644 > --- a/drivers/gpu/drm/sti/sti_hdmi.c > +++ b/drivers/gpu/drm/sti/sti_hdmi.c > @@ -897,20 +897,10 @@ static int sti_hdmi_connector_mode_valid(struct > drm_connector *connector, > return MODE_OK; > } > > -struct drm_encoder *sti_hdmi_best_encoder(struct drm_connector *connector) > -{ > - struct sti_hdmi_connector *hdmi_connector > - = to_sti_hdmi_connector(connector); > - > - /* Best encoder is the one associated during connector creation */ > - return hdmi_connector->encoder; > -} > - > static const > struct drm_connector_helper_funcs sti_hdmi_connector_helper_funcs = { > .get_modes = sti_hdmi_connector_get_modes, > .mode_valid = sti_hdmi_connector_mode_valid, > - .best_encoder = sti_hdmi_best_encoder, > }; > > /* get detection status of display device */ >