summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/imx/parallel-display.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2020-08-12 20:17:18 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2020-08-12 21:42:08 +0300
commit534b1f9071d95325044c21d47d9f63a45cdf425e (patch)
tree5c2aa3cd65bfb6b9e73d9ad22c021d800380f0f6 /drivers/gpu/drm/imx/parallel-display.c
parent82dd18096c718962379e61cd8a7a0dc219db174f (diff)
parent62975d27d647a40c58d3b96c29b911fc4f33c310 (diff)
downloadlinux-534b1f9071d95325044c21d47d9f63a45cdf425e.tar.xz
Merge drm/drm-next into drm-misc-next
Backmerging drm-next into drm-misc-next for nouveau and panel updates. Resolves a conflict between ttm and nouveau, where struct ttm_mem_res got renamed to struct ttm_resource. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'drivers/gpu/drm/imx/parallel-display.c')
-rw-r--r--drivers/gpu/drm/imx/parallel-display.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index cba2abbb420d..8232f512b9ed 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -88,14 +88,6 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
return num_modes;
}
-static struct drm_encoder *imx_pd_connector_best_encoder(
- struct drm_connector *connector)
-{
- struct imx_parallel_display *imxpd = con_to_imxpd(connector);
-
- return &imxpd->encoder;
-}
-
static void imx_pd_bridge_enable(struct drm_bridge *bridge)
{
struct imx_parallel_display *imxpd = bridge_to_imxpd(bridge);
@@ -217,7 +209,7 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
if (next_bridge_state)
bus_flags = next_bridge_state->input_bus_cfg.flags;
- else if (!imxpd->bus_format && di->num_bus_formats)
+ else if (di->num_bus_formats)
bus_flags = di->bus_flags;
else
bus_flags = imxpd->bus_flags;
@@ -254,7 +246,6 @@ static const struct drm_connector_funcs imx_pd_connector_funcs = {
static const struct drm_connector_helper_funcs imx_pd_connector_helper_funcs = {
.get_modes = imx_pd_connector_get_modes,
- .best_encoder = imx_pd_connector_best_encoder,
};
static const struct drm_bridge_funcs imx_pd_bridge_funcs = {
@@ -323,9 +314,14 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
u32 bus_format = 0;
const char *fmt;
- imxpd = devm_kzalloc(dev, sizeof(*imxpd), GFP_KERNEL);
- if (!imxpd)
- return -ENOMEM;
+ imxpd = dev_get_drvdata(dev);
+ memset(imxpd, 0, sizeof(*imxpd));
+
+ /* port@1 is the output port */
+ ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
+ &imxpd->next_bridge);
+ if (ret && ret != -ENODEV)
+ return ret;
edidp = of_get_property(np, "edid", &imxpd->edid_len);
if (edidp)
@@ -344,20 +340,12 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data)
}
imxpd->bus_format = bus_format;
- /* port@1 is the output port */
- ret = drm_of_find_panel_or_bridge(np, 1, 0, &imxpd->panel,
- &imxpd->next_bridge);
- if (ret && ret != -ENODEV)
- return ret;
-
imxpd->dev = dev;
ret = imx_pd_register(drm, imxpd);
if (ret)
return ret;
- dev_set_drvdata(dev, imxpd);
-
return 0;
}
@@ -376,6 +364,14 @@ static const struct component_ops imx_pd_ops = {
static int imx_pd_probe(struct platform_device *pdev)
{
+ struct imx_parallel_display *imxpd;
+
+ imxpd = devm_kzalloc(&pdev->dev, sizeof(*imxpd), GFP_KERNEL);
+ if (!imxpd)
+ return -ENOMEM;
+
+ platform_set_drvdata(pdev, imxpd);
+
return component_add(&pdev->dev, &imx_pd_ops);
}