Skip to content

Commit dad82ea

Browse files
Jyri Sarhaairlied
authored andcommitted
drm/i2c: tda998x: Choose between atomic or non atomic dpms helper
Choose between atomic or non atomic connector dpms helper. If tda998x is connected to a drm driver that does not support atomic modeset calling drm_atomic_helper_connector_dpms() causes a crash when the connectors atomic state is not initialized. The patch implements a driver specific connector dpms helper that calls drm_atomic_helper_connector_dpms() if driver supports DRIVER_ATOMIC and otherwise it calls the legacy drm_helper_connector_dpms(). Fixes commit 9736e98 ("drm/i2c: tda998x: Add support for atomic modesetting"). Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent d17e67d commit dad82ea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpu/drm/i2c/tda998x_drv.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,16 @@ static void tda998x_connector_destroy(struct drm_connector *connector)
13821382
drm_connector_cleanup(connector);
13831383
}
13841384

1385+
static int tda998x_connector_dpms(struct drm_connector *connector, int mode)
1386+
{
1387+
if (drm_core_check_feature(connector->dev, DRIVER_ATOMIC))
1388+
return drm_atomic_helper_connector_dpms(connector, mode);
1389+
else
1390+
return drm_helper_connector_dpms(connector, mode);
1391+
}
1392+
13851393
static const struct drm_connector_funcs tda998x_connector_funcs = {
1386-
.dpms = drm_atomic_helper_connector_dpms,
1394+
.dpms = tda998x_connector_dpms,
13871395
.reset = drm_atomic_helper_connector_reset,
13881396
.fill_modes = drm_helper_probe_single_connector_modes,
13891397
.detect = tda998x_connector_detect,

0 commit comments

Comments
 (0)