From: Boris Brezillon <hidden> Date: 2016-06-07 12:02:25
Hello,
This patch series aims at replacing all dummy ->best_encoder()
implementations where we have a 1:1 relationship between encoders
and connectors.
The core already provides the drm_atomic_helper_best_encoder()
function which is taking the first encoder attached to the
connector (after making sure only one encoder was attached to the
connector), but it's not automatically used, and drivers wanting
to rely on this default behavior have to explicitly assign their
->best_encoder() hook to drm_atomic_helper_best_encoder().
The first patch fixes remaining places where
drm_atomic_helper_best_encoder() should be called when ->best_encoder()
is NULL, so that drivers using the atomic helpers can get rid of the
explicit ->best_encoder assignment if they need to rely on the default
drm_atomic_helper_best_encoder() implementation.
The following patches are killing all open coded ->best_encoder()
implementations that could be replaced by
drm_atomic_helper_best_encoder().
All modifications have been compile tested except for the changed on
the intel driver.
I've also tested on an atmel board, but I recommend waiting for DRM
driver maintainers feedback before applying the associated changes.
Note that once patch 1 is applied, the other patches can be applied
independently.
Best Regards,
Boris
Changes since v1:
- remove useless ->encoder backpointers in some implementations
- documented the default behavior in the vtable doc
- added R-b/A-b tags
Boris Brezillon (20):
drm/atomic: Fix remaining places where !funcs->best_encoder is valid
drm: arc: Rely on the default ->best_encoder() behavior
drm: atmel-hlcdc: Rely on the default ->best_encoder() behavior
drm: exynos: Rely on the default ->best_encoder() behavior
drm: fsl-dcu: Rely on the default ->best_encoder() behavior
drm: i915: Rely on the default ->best_encoder() behavior where
appropriate
drm: mediatek: Rely on the default ->best_encoder() behavior
drm: msm: Rely on the default ->best_encoder() behavior where
appropriate
drm: rcar-du: Rely on the default ->best_encoder() behavior
drm: rockchip: Rely on the default ->best_encoder() behavior
drm: sti: Rely on the default ->best_encoder() behavior
drm: sun4i: Rely on the default ->best_encoder() behavior
drm: tegra: Rely on the default ->best_encoder() behavior
drm: vc4: Rely on the default ->best_encoder() behavior
drm: virtgpu: Rely on the default ->best_encoder() behavior
drm: omap: Rely on the default ->best_encoder() behavior
drm/bridge: anx78xx: Rely on the default ->best_encoder() behavior
drm/bridge: ptn3460: Rely on the default ->best_encoder() behavior
drm/bridge: ps8622: Rely on the default ->best_encoder() behavior
drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder()
drivers/gpu/drm/arc/arcpgu_hdmi.c | 18 ------------------
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 12 ------------
drivers/gpu/drm/bridge/analogix-anx78xx.c | 8 --------
drivers/gpu/drm/bridge/dw-hdmi.c | 11 +----------
drivers/gpu/drm/bridge/nxp-ptn3460.c | 8 --------
drivers/gpu/drm/bridge/parade-ps8622.c | 10 ----------
drivers/gpu/drm/drm_atomic_helper.c | 4 +++-
drivers/gpu/drm/drm_fb_helper.c | 13 ++++++++++++-
drivers/gpu/drm/exynos/exynos_drm_dpi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 --------
drivers/gpu/drm/exynos/exynos_hdmi.c | 8 --------
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 9 ---------
drivers/gpu/drm/i915/intel_crt.c | 1 -
drivers/gpu/drm/i915/intel_display.c | 8 --------
drivers/gpu/drm/i915/intel_dp.c | 1 -
drivers/gpu/drm/i915/intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_dsi.c | 1 -
drivers/gpu/drm/i915/intel_dvo.c | 1 -
drivers/gpu/drm/i915/intel_hdmi.c | 1 -
drivers/gpu/drm/i915/intel_lvds.c | 1 -
drivers/gpu/drm/i915/intel_sdvo.c | 1 -
drivers/gpu/drm/i915/intel_tv.c | 1 -
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 ---------
drivers/gpu/drm/msm/edp/edp_connector.c | 10 ----------
drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 8 --------
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c | 9 ---------
drivers/gpu/drm/omapdrm/omap_connector.c | 10 ----------
drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 12 ------------
drivers/gpu/drm/rcar-du/rcar_du_encoder.h | 3 ---
drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_vgacon.c | 3 ---
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 9 ---------
drivers/gpu/drm/rockchip/inno_hdmi.c | 9 ---------
drivers/gpu/drm/sti/sti_dvo.c | 10 ----------
drivers/gpu/drm/sti/sti_hda.c | 10 ----------
drivers/gpu/drm/sti/sti_hdmi.c | 10 ----------
drivers/gpu/drm/sun4i/sun4i_rgb.c | 10 ----------
drivers/gpu/drm/sun4i/sun4i_tv.c | 9 ---------
drivers/gpu/drm/tegra/drm.h | 2 --
drivers/gpu/drm/tegra/dsi.c | 1 -
drivers/gpu/drm/tegra/hdmi.c | 1 -
drivers/gpu/drm/tegra/output.c | 8 --------
drivers/gpu/drm/tegra/rgb.c | 1 -
drivers/gpu/drm/tegra/sor.c | 1 -
drivers/gpu/drm/vc4/vc4_dpi.c | 9 ---------
drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ---------
drivers/gpu/drm/virtio/virtgpu_display.c | 10 ----------
include/drm/drm_modeset_helper_vtables.h | 10 ++++++++--
50 files changed, 24 insertions(+), 305 deletions(-)
--
2.7.4
From: Boris Brezillon <hidden> Date: 2016-06-07 11:48:28
We have 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 <redacted>
---
drivers/gpu/drm/exynos/exynos_drm_dpi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 --------
drivers/gpu/drm/exynos/exynos_hdmi.c | 8 --------
4 files changed, 34 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:48:32
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 <redacted>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 12 ------------
drivers/gpu/drm/rcar-du/rcar_du_encoder.h | 3 ---
drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_vgacon.c | 3 ---
5 files changed, 20 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:48:39
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 <redacted>
---
drivers/gpu/drm/vc4/vc4_dpi.c | 9 ---------
drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ---------
2 files changed, 18 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:48:43
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() implementation and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/tegra/drm.h | 2 --
drivers/gpu/drm/tegra/dsi.c | 1 -
drivers/gpu/drm/tegra/hdmi.c | 1 -
drivers/gpu/drm/tegra/output.c | 8 --------
drivers/gpu/drm/tegra/rgb.c | 1 -
drivers/gpu/drm/tegra/sor.c | 1 -
6 files changed, 14 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:48:45
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 <redacted>
Acked-by: Mark Yao <redacted>
---
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 9 ---------
drivers/gpu/drm/rockchip/inno_hdmi.c | 9 ---------
2 files changed, 18 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:49:17
We have a 1:1 relationship between connectors and encoders, which means
we can rely on the drm_atomic_helper_best_encoder() behavior.
We still have to explicitly assign ->best_encoder() to
drm_atomic_helper_best_encoder(), because the automated fallback to
drm_atomic_helper_best_encoder() when ->best_encoder() is NULL is only
available when the DRM device is using the atomic helpers, and this bridge
is compatible with non-atomic and atomic devices.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/bridge/dw-hdmi.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:49:40
We 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(),
and let the core call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/bridge/parade-ps8622.c | 10 ----------
1 file changed, 10 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:49:42
We 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(),
and let the core call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/bridge/nxp-ptn3460.c | 8 --------
1 file changed, 8 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:51:18
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 <redacted>
---
drivers/gpu/drm/sun4i/sun4i_rgb.c | 10 ----------
drivers/gpu/drm/sun4i/sun4i_tv.c | 9 ---------
2 files changed, 19 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:51:52
We 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(),
and let the core call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/bridge/analogix-anx78xx.c | 8 --------
1 file changed, 8 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:51:54
We 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() implementation and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/omapdrm/omap_connector.c | 10 ----------
1 file changed, 10 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:52:47
The virtgpu output exposes a 1:1 relationship between connectors and
encoders and the driver is relying on the atomic helpers: we can drop
the custom ->best_encoder() implementation and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/virtio/virtgpu_display.c | 10 ----------
1 file changed, 10 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:53:33
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 <redacted>
---
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(-)
@@ -384,20 +384,10 @@ static int sti_dvo_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_dvo_best_encoder(structdrm_connector*connector)-{-structsti_dvo_connector*dvo_connector-=to_sti_dvo_connector(connector);--/* Best encoder is the one associated during connector creation */-returndvo_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_dvo_connector_helper_funcs={.get_modes=sti_dvo_connector_get_modes,.mode_valid=sti_dvo_connector_mode_valid,-.best_encoder=sti_dvo_best_encoder,};staticenumdrm_connector_status
@@ -676,20 +676,10 @@ static int sti_hda_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_hda_best_encoder(structdrm_connector*connector)-{-structsti_hda_connector*hda_connector-=to_sti_hda_connector(connector);--/* Best encoder is the one associated during connector creation */-returnhda_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_hda_connector_helper_funcs={.get_modes=sti_hda_connector_get_modes,.mode_valid=sti_hda_connector_mode_valid,-.best_encoder=sti_hda_best_encoder,};staticenumdrm_connector_status
@@ -897,20 +897,10 @@ static int sti_hdmi_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_hdmi_best_encoder(structdrm_connector*connector)-{-structsti_hdmi_connector*hdmi_connector-=to_sti_hdmi_connector(connector);--/* Best encoder is the one associated during connector creation */-returnhdmi_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_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 */
From: Boris Brezillon <hidden> Date: 2016-06-07 11:56:23
For all outputs except DSI we 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() and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/msm/edp/edp_connector.c | 10 ----------
drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 8 --------
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c | 9 ---------
3 files changed, 27 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:56:46
We 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() implementation and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 ---------
1 file changed, 9 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:56:48
For all outputs except dp_mst, we 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() implementation and let the core
call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/i915/intel_crt.c | 1 -
drivers/gpu/drm/i915/intel_display.c | 8 --------
drivers/gpu/drm/i915/intel_dp.c | 1 -
drivers/gpu/drm/i915/intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_dsi.c | 1 -
drivers/gpu/drm/i915/intel_dvo.c | 1 -
drivers/gpu/drm/i915/intel_hdmi.c | 1 -
drivers/gpu/drm/i915/intel_lvds.c | 1 -
drivers/gpu/drm/i915/intel_sdvo.c | 1 -
drivers/gpu/drm/i915/intel_tv.c | 1 -
10 files changed, 17 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:57:43
We 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() and let the core call drm_atomic_helper_best_encoder()
for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 9 ---------
1 file changed, 9 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:57:47
We 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() and let the core call drm_atomic_helper_best_encoder()
for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 12 ------------
1 file changed, 12 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:59:49
We 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(), and let the core call drm_atomic_helper_best_encoder()
for us.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/arc/arcpgu_hdmi.c | 18 ------------------
1 file changed, 18 deletions(-)
From: Boris Brezillon <hidden> Date: 2016-06-07 11:59:51
Adapt drm_pick_crtcs() and update_connector_routing() to fallback to
drm_atomic_helper_best_encoder() if funcs->best_encoder() is NULL so
that DRM drivers can leave this hook unassigned if they know they want
to use drm_atomic_helper_best_encoder().
Update the vtables documentation accordingly.
Signed-off-by: Boris Brezillon <redacted>
---
drivers/gpu/drm/drm_atomic_helper.c | 4 +++-
drivers/gpu/drm/drm_fb_helper.c | 13 ++++++++++++-
include/drm/drm_modeset_helper_vtables.h | 10 ++++++++--
3 files changed, 23 insertions(+), 4 deletions(-)
From: Daniel Vetter <hidden> Date: 2016-06-07 14:39:55
On Tue, Jun 07, 2016 at 01:47:56PM +0200, Boris Brezillon wrote:
Adapt drm_pick_crtcs() and update_connector_routing() to fallback to
drm_atomic_helper_best_encoder() if funcs->best_encoder() is NULL so
that DRM drivers can leave this hook unassigned if they know they want
to use drm_atomic_helper_best_encoder().
Update the vtables documentation accordingly.
Signed-off-by: Boris Brezillon <redacted>
Applied to drm-misc, thanks. I think I'll wait with the driver patches
until next week or so.
-Daniel
From: Vincent ABRIOU <hidden> Date: 2016-06-08 09:37:05
Hi Boris,
Thanks for the patch.
Acked-by: Vincent Abriou <redacted>
Vincent
On 06/07/2016 01:48 PM, Boris Brezillon wrote:
quoted hunk
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 <redacted>
---
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(-)
@@ -384,20 +384,10 @@ static int sti_dvo_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_dvo_best_encoder(structdrm_connector*connector)-{-structsti_dvo_connector*dvo_connector-=to_sti_dvo_connector(connector);--/* Best encoder is the one associated during connector creation */-returndvo_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_dvo_connector_helper_funcs={.get_modes=sti_dvo_connector_get_modes,.mode_valid=sti_dvo_connector_mode_valid,-.best_encoder=sti_dvo_best_encoder,};staticenumdrm_connector_status
@@ -676,20 +676,10 @@ static int sti_hda_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_hda_best_encoder(structdrm_connector*connector)-{-structsti_hda_connector*hda_connector-=to_sti_hda_connector(connector);--/* Best encoder is the one associated during connector creation */-returnhda_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_hda_connector_helper_funcs={.get_modes=sti_hda_connector_get_modes,.mode_valid=sti_hda_connector_mode_valid,-.best_encoder=sti_hda_best_encoder,};staticenumdrm_connector_status
@@ -897,20 +897,10 @@ static int sti_hdmi_connector_mode_valid(struct drm_connector *connector,returnMODE_OK;}-structdrm_encoder*sti_hdmi_best_encoder(structdrm_connector*connector)-{-structsti_hdmi_connector*hdmi_connector-=to_sti_hdmi_connector(connector);--/* Best encoder is the one associated during connector creation */-returnhdmi_connector->encoder;-}-staticconststructdrm_connector_helper_funcssti_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 */
Hi,
On 06/07/2016 05:18 PM, Boris Brezillon wrote:
For all outputs except DSI we 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() and let the core call
drm_atomic_helper_best_encoder() for us.
Works fine with msm.
Tested-by: Archit Taneja <redacted>
Thanks,
Archit
We 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() implementation and let the core call
drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
From: Daniel Vetter <hidden> Date: 2016-06-10 15:24:23
On Tue, Jun 07, 2016 at 01:48:01PM +0200, Boris Brezillon wrote:
For all outputs except dp_mst, we 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() implementation and let the core
call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
You can also drop the best_encoder from intel_dp_mst, we only need the
atomic_best_encoder. The best_encoder there was needed to help out the
fbdev emulation. Care to respin?
-Daniel
From: Daniel Vetter <hidden> Date: 2016-06-10 15:26:10
On Tue, Jun 07, 2016 at 01:47:55PM +0200, Boris Brezillon wrote:
Hello,
This patch series aims at replacing all dummy ->best_encoder()
implementations where we have a 1:1 relationship between encoders
and connectors.
The core already provides the drm_atomic_helper_best_encoder()
function which is taking the first encoder attached to the
connector (after making sure only one encoder was attached to the
connector), but it's not automatically used, and drivers wanting
to rely on this default behavior have to explicitly assign their
->best_encoder() hook to drm_atomic_helper_best_encoder().
The first patch fixes remaining places where
drm_atomic_helper_best_encoder() should be called when ->best_encoder()
is NULL, so that drivers using the atomic helpers can get rid of the
explicit ->best_encoder assignment if they need to rely on the default
drm_atomic_helper_best_encoder() implementation.
The following patches are killing all open coded ->best_encoder()
implementations that could be replaced by
drm_atomic_helper_best_encoder().
All modifications have been compile tested except for the changed on
the intel driver.
I've also tested on an atmel board, but I recommend waiting for DRM
driver maintainers feedback before applying the associated changes.
Note that once patch 1 is applied, the other patches can be applied
independently.
One comment on the i915 patch, all others should now be in drm-misc.
Thanks a lot for doing this.
-Daniel
Best Regards,
Boris
Changes since v1:
- remove useless ->encoder backpointers in some implementations
- documented the default behavior in the vtable doc
- added R-b/A-b tags
Boris Brezillon (20):
drm/atomic: Fix remaining places where !funcs->best_encoder is valid
drm: arc: Rely on the default ->best_encoder() behavior
drm: atmel-hlcdc: Rely on the default ->best_encoder() behavior
drm: exynos: Rely on the default ->best_encoder() behavior
drm: fsl-dcu: Rely on the default ->best_encoder() behavior
drm: i915: Rely on the default ->best_encoder() behavior where
appropriate
drm: mediatek: Rely on the default ->best_encoder() behavior
drm: msm: Rely on the default ->best_encoder() behavior where
appropriate
drm: rcar-du: Rely on the default ->best_encoder() behavior
drm: rockchip: Rely on the default ->best_encoder() behavior
drm: sti: Rely on the default ->best_encoder() behavior
drm: sun4i: Rely on the default ->best_encoder() behavior
drm: tegra: Rely on the default ->best_encoder() behavior
drm: vc4: Rely on the default ->best_encoder() behavior
drm: virtgpu: Rely on the default ->best_encoder() behavior
drm: omap: Rely on the default ->best_encoder() behavior
drm/bridge: anx78xx: Rely on the default ->best_encoder() behavior
drm/bridge: ptn3460: Rely on the default ->best_encoder() behavior
drm/bridge: ps8622: Rely on the default ->best_encoder() behavior
drm/bridge: dw-hdmi: Use drm_atomic_helper_best_encoder()
drivers/gpu/drm/arc/arcpgu_hdmi.c | 18 ------------------
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 12 ------------
drivers/gpu/drm/bridge/analogix-anx78xx.c | 8 --------
drivers/gpu/drm/bridge/dw-hdmi.c | 11 +----------
drivers/gpu/drm/bridge/nxp-ptn3460.c | 8 --------
drivers/gpu/drm/bridge/parade-ps8622.c | 10 ----------
drivers/gpu/drm/drm_atomic_helper.c | 4 +++-
drivers/gpu/drm/drm_fb_helper.c | 13 ++++++++++++-
drivers/gpu/drm/exynos/exynos_drm_dpi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 9 ---------
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 --------
drivers/gpu/drm/exynos/exynos_hdmi.c | 8 --------
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c | 9 ---------
drivers/gpu/drm/i915/intel_crt.c | 1 -
drivers/gpu/drm/i915/intel_display.c | 8 --------
drivers/gpu/drm/i915/intel_dp.c | 1 -
drivers/gpu/drm/i915/intel_drv.h | 1 -
drivers/gpu/drm/i915/intel_dsi.c | 1 -
drivers/gpu/drm/i915/intel_dvo.c | 1 -
drivers/gpu/drm/i915/intel_hdmi.c | 1 -
drivers/gpu/drm/i915/intel_lvds.c | 1 -
drivers/gpu/drm/i915/intel_sdvo.c | 1 -
drivers/gpu/drm/i915/intel_tv.c | 1 -
drivers/gpu/drm/mediatek/mtk_dsi.c | 9 ---------
drivers/gpu/drm/msm/edp/edp_connector.c | 10 ----------
drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 8 --------
drivers/gpu/drm/msm/mdp/mdp4/mdp4_lvds_connector.c | 9 ---------
drivers/gpu/drm/omapdrm/omap_connector.c | 10 ----------
drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 12 ------------
drivers/gpu/drm/rcar-du/rcar_du_encoder.h | 3 ---
drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c | 1 -
drivers/gpu/drm/rcar-du/rcar_du_vgacon.c | 3 ---
drivers/gpu/drm/rockchip/dw-mipi-dsi.c | 9 ---------
drivers/gpu/drm/rockchip/inno_hdmi.c | 9 ---------
drivers/gpu/drm/sti/sti_dvo.c | 10 ----------
drivers/gpu/drm/sti/sti_hda.c | 10 ----------
drivers/gpu/drm/sti/sti_hdmi.c | 10 ----------
drivers/gpu/drm/sun4i/sun4i_rgb.c | 10 ----------
drivers/gpu/drm/sun4i/sun4i_tv.c | 9 ---------
drivers/gpu/drm/tegra/drm.h | 2 --
drivers/gpu/drm/tegra/dsi.c | 1 -
drivers/gpu/drm/tegra/hdmi.c | 1 -
drivers/gpu/drm/tegra/output.c | 8 --------
drivers/gpu/drm/tegra/rgb.c | 1 -
drivers/gpu/drm/tegra/sor.c | 1 -
drivers/gpu/drm/vc4/vc4_dpi.c | 9 ---------
drivers/gpu/drm/vc4/vc4_hdmi.c | 9 ---------
drivers/gpu/drm/virtio/virtgpu_display.c | 10 ----------
include/drm/drm_modeset_helper_vtables.h | 10 ++++++++--
50 files changed, 24 insertions(+), 305 deletions(-)
--
2.7.4
From: Daniel Vetter <hidden> Date: 2016-06-10 16:42:01
On Fri, Jun 10, 2016 at 05:24:12PM +0200, Daniel Vetter wrote:
On Tue, Jun 07, 2016 at 01:48:01PM +0200, Boris Brezillon wrote:
quoted
For all outputs except dp_mst, we 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() implementation and let the core
call drm_atomic_helper_best_encoder() for us.
Signed-off-by: Boris Brezillon <redacted>
You can also drop the best_encoder from intel_dp_mst, we only need the
atomic_best_encoder. The best_encoder there was needed to help out the
fbdev emulation. Care to respin?
Boris pointed out on irc that this won't work for the fbdev stuff since
that has a WARN_ON if theres more than 1 possible encoder. Applied this
one here instead.
Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch