linux_dsm_epyc7002/drivers/gpu/drm/vc4
Laurent Pinchart a25b988ff8 drm/bridge: Extend bridge API to disable connector creation
Most bridge drivers create a DRM connector to model the connector at the
output of the bridge. This model is historical and has worked pretty
well so far, but causes several issues:

- It prevents supporting more complex display pipelines where DRM
connector operations are split over multiple components. For instance a
pipeline with a bridge connected to the DDC signals to read EDID data,
and another one connected to the HPD signal to detect connection and
disconnection, will not be possible to support through this model.

- It requires every bridge driver to implement similar connector
handling code, resulting in code duplication.

- It assumes that a bridge will either be wired to a connector or to
another bridge, but doesn't support bridges that can be used in both
positions very well (although there is some ad-hoc support for this in
the analogix_dp bridge driver).

In order to solve these issues, ownership of the connector should be
moved to the display controller driver (where it can be implemented
using helpers provided by the core).

Extend the bridge API to allow disabling connector creation in bridge
drivers as a first step towards the new model. The new flags argument to
the bridge .attach() operation allows instructing the bridge driver to
skip creating a connector. Unconditionally set the new flags argument to
0 for now to keep the existing behaviour, and modify all existing bridge
drivers to return an error when connector creation is not requested as
they don't support this feature yet.

The change is based on the following semantic patch, with manual review
and edits.

@ rule1 @
identifier funcs;
identifier fn;
@@
 struct drm_bridge_funcs funcs = {
 	...,
 	.attach = fn
 };

@ depends on rule1 @
identifier rule1.fn;
identifier bridge;
statement S, S1;
@@
 int fn(
 	struct drm_bridge *bridge
+	, enum drm_bridge_attach_flags flags
 )
 {
 	... when != S
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+		DRM_ERROR("Fix bridge driver to make connector optional!");
+		return -EINVAL;
+	}
+
 	S1
 	...
 }

@ depends on rule1 @
identifier rule1.fn;
identifier bridge, flags;
expression E1, E2, E3;
@@
 int fn(
 	struct drm_bridge *bridge,
 	enum drm_bridge_attach_flags flags
 ) {
 <...
 drm_bridge_attach(E1, E2, E3
+	, flags
 )
 ...>
 }

@@
expression E1, E2, E3;
@@
 drm_bridge_attach(E1, E2, E3
+	, 0
 )

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-10-laurent.pinchart@ideasonboard.com
2020-02-26 13:31:23 +02:00
..
Kconfig drm/vc4: Fix Kconfig indentation 2019-11-25 10:04:41 +01:00
Makefile drm/vc4: Add support for the transposer block 2018-07-07 07:54:46 +02:00
vc4_bo.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_crtc.c drm/vc4: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vc4_debugfs.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_dpi.c drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
vc4_drv.c drm/vc4: Convert to CRTC VBLANK callbacks 2020-02-13 13:10:10 +01:00
vc4_drv.h drm/vc4: Convert to struct drm_crtc_helper_funcs.get_scanout_position() 2020-02-13 13:10:10 +01:00
vc4_dsi.c drm/bridge: Extend bridge API to disable connector creation 2020-02-26 13:31:23 +02:00
vc4_fence.c drm/vc4: Remove unecessary dma_fence_ops 2018-07-03 13:14:10 +02:00
vc4_gem.c drm/vc4: Use dma_resv locking wrappers 2019-12-17 17:26:08 +01:00
vc4_hdmi.c drm/vc4: Provide ddc symlink in connector sysfs directory 2020-01-07 20:25:43 +01:00
vc4_hvs.c drm/mm: Use helpers for drm_mm_node booleans 2019-10-04 13:42:33 +01:00
vc4_irq.c drm/vc4: Allocate binner bo when starting to use the V3D 2019-05-23 17:32:21 +02:00
vc4_kms.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_packet.h
vc4_perfmon.c drm/vc4: Disable V3D interactions if the v3d component didn't probe. 2019-04-03 12:49:18 -07:00
vc4_plane.c drm/vc4: plane_state->fb iff plane_state->crtc 2020-01-28 15:42:43 +01:00
vc4_qpu_defines.h
vc4_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_render_cl.c drm/vc4: Make sure to emit a tile coordinates between two MSAA loads. 2019-04-01 09:33:38 -07:00
vc4_trace_points.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_trace.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vc4_txp.c Merge drm/drm-fixes into drm-misc-fixes 2019-10-03 09:59:29 +02:00
vc4_v3d.c Linus 5.3-rc1 2019-07-22 21:24:10 +02:00
vc4_validate_shaders.c
vc4_validate.c
vc4_vec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00