drm/bridge: tc358767: read display_props in get_modes() [Linux 4.9.187]

This Linux kernel change "drm/bridge: tc358767: read display_props in get_modes()" is included in the Linux 4.9.187 release. This change is authored by Tomi Valkeinen <tomi.valkeinen [at] ti.com> on Tue May 28 11:27:44 2019 +0300. The commit for this change in Linux stable tree is 7892109 (patch) which is from upstream commit 3231573. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream 3231573.

drm/bridge: tc358767: read display_props in get_modes()

[ Upstream commit 3231573065ad4f4ecc5c9147b24f29f846dc0c2f ]

We need to know the link bandwidth to filter out modes we cannot
support, so we need to have read the display props before doing the

To ensure we have up to date display props, call tc_get_display_props()
in the beginning of tc_connector_get_modes().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528082747.3631-22-tomi.valkeinen@ti.com
Signed-off-by: Sasha Levin <sashal@kernel.org>

There are 7 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/gpu/drm/bridge/tc358767.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index fa3f2f0..80993a8 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1153,6 +1153,13 @@ static int tc_connector_get_modes(struct drm_connector *connector)
    struct tc_data *tc = connector_to_tc(connector);
    struct edid *edid;
    unsigned int count;
+   int ret;
+   ret = tc_get_display_props(tc);
+   if (ret < 0) {
+       dev_err(tc->dev, "failed to read display props: %d\n", ret);
+       return 0;
+   }

    if (tc->panel && tc->panel->funcs && tc->panel->funcs->get_modes) {
        count = tc->panel->funcs->get_modes(tc->panel);

Leave a Reply

Your email address will not be published. Required fields are marked *