Lines Matching +full:video +full:- +full:encoder

1 // SPDX-License-Identifier: GPL-2.0-only
19 #include <video/of_videomode.h>
20 #include <video/videomode.h>
25 struct drm_encoder encoder; member
39 return container_of(e, struct exynos_dpi, encoder); in encoder_to_dpi()
68 if (ctx->vm) { in exynos_dpi_get_modes()
71 mode = drm_mode_create(connector->dev); in exynos_dpi_get_modes()
73 DRM_DEV_ERROR(ctx->dev, in exynos_dpi_get_modes()
77 drm_display_mode_from_videomode(ctx->vm, mode); in exynos_dpi_get_modes()
78 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in exynos_dpi_get_modes()
83 if (ctx->panel) in exynos_dpi_get_modes()
84 return drm_panel_get_modes(ctx->panel, connector); in exynos_dpi_get_modes()
93 static int exynos_dpi_create_connector(struct drm_encoder *encoder) in exynos_dpi_create_connector() argument
95 struct exynos_dpi *ctx = encoder_to_dpi(encoder); in exynos_dpi_create_connector()
96 struct drm_connector *connector = &ctx->connector; in exynos_dpi_create_connector()
99 connector->polled = DRM_CONNECTOR_POLL_HPD; in exynos_dpi_create_connector()
101 ret = drm_connector_init(encoder->dev, connector, in exynos_dpi_create_connector()
105 DRM_DEV_ERROR(ctx->dev, in exynos_dpi_create_connector()
111 drm_connector_attach_encoder(connector, encoder); in exynos_dpi_create_connector()
116 static void exynos_dpi_mode_set(struct drm_encoder *encoder, in exynos_dpi_mode_set() argument
122 static void exynos_dpi_enable(struct drm_encoder *encoder) in exynos_dpi_enable() argument
124 struct exynos_dpi *ctx = encoder_to_dpi(encoder); in exynos_dpi_enable()
126 if (ctx->panel) { in exynos_dpi_enable()
127 drm_panel_prepare(ctx->panel); in exynos_dpi_enable()
128 drm_panel_enable(ctx->panel); in exynos_dpi_enable()
132 static void exynos_dpi_disable(struct drm_encoder *encoder) in exynos_dpi_disable() argument
134 struct exynos_dpi *ctx = encoder_to_dpi(encoder); in exynos_dpi_disable()
136 if (ctx->panel) { in exynos_dpi_disable()
137 drm_panel_disable(ctx->panel); in exynos_dpi_disable()
138 drm_panel_unprepare(ctx->panel); in exynos_dpi_disable()
158 struct device *dev = ctx->dev; in exynos_dpi_parse_dt()
159 struct device_node *dn = dev->of_node; in exynos_dpi_parse_dt()
162 ctx->panel_node = of_graph_get_remote_node(dn, FIMD_PORT_RGB, 0); in exynos_dpi_parse_dt()
164 np = of_get_child_by_name(dn, "display-timings"); in exynos_dpi_parse_dt()
171 vm = devm_kzalloc(dev, sizeof(*ctx->vm), GFP_KERNEL); in exynos_dpi_parse_dt()
173 return -ENOMEM; in exynos_dpi_parse_dt()
181 ctx->vm = vm; in exynos_dpi_parse_dt()
186 if (!ctx->panel_node) in exynos_dpi_parse_dt()
187 return -EINVAL; in exynos_dpi_parse_dt()
192 int exynos_dpi_bind(struct drm_device *dev, struct drm_encoder *encoder) in exynos_dpi_bind() argument
196 drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_TMDS); in exynos_dpi_bind()
198 drm_encoder_helper_add(encoder, &exynos_dpi_encoder_helper_funcs); in exynos_dpi_bind()
200 ret = exynos_drm_set_possible_crtcs(encoder, EXYNOS_DISPLAY_TYPE_LCD); in exynos_dpi_bind()
204 ret = exynos_dpi_create_connector(encoder); in exynos_dpi_bind()
206 DRM_DEV_ERROR(encoder_to_dpi(encoder)->dev, in exynos_dpi_bind()
208 drm_encoder_cleanup(encoder); in exynos_dpi_bind()
222 return ERR_PTR(-ENOMEM); in exynos_dpi_probe()
224 ctx->dev = dev; in exynos_dpi_probe()
232 if (ctx->panel_node) { in exynos_dpi_probe()
233 ctx->panel = of_drm_find_panel(ctx->panel_node); in exynos_dpi_probe()
234 if (IS_ERR(ctx->panel)) in exynos_dpi_probe()
235 return ERR_CAST(ctx->panel); in exynos_dpi_probe()
238 return &ctx->encoder; in exynos_dpi_probe()
241 int exynos_dpi_remove(struct drm_encoder *encoder) in exynos_dpi_remove() argument
243 struct exynos_dpi *ctx = encoder_to_dpi(encoder); in exynos_dpi_remove()
245 exynos_dpi_disable(&ctx->encoder); in exynos_dpi_remove()