Skip to content

Commit 49b3f94

Browse files
name2965pelwell
authored andcommitted
drm/vc4: txp: add implementation of the missing connector reset custom function
In the previous commit, we added a rotation parameter to be used in the connector, but because we are still using the default reset function without implementing a custom reset function to properly initialize it, the rotation variable remains NULL until it is initialized directly in userspace. To prevent this, we must implement a custom reset function that properly initializes the rotation parameter. Fixes: 30c7044 ("drm: Add a rotation parameter to connectors.") Signed-off-by: Jeongjun Park <aha310510@gmail.com>
1 parent 02d86d3 commit 49b3f94

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

drivers/gpu/drm/vc4/vc4_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ extern struct platform_driver vc4_vec_driver;
10871087

10881088
/* vc4_txp.c */
10891089
extern struct platform_driver vc4_txp_driver;
1090+
void vc4_txp_connector_reset(struct drm_connector *connector);
10901091

10911092
/* vc4_irq.c */
10921093
void vc4_irq_enable(struct drm_device *dev);

drivers/gpu/drm/vc4/vc4_txp.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,27 @@ vc4_txp_connector_detect(struct drm_connector *connector, bool force)
390390
return connector_status_connected;
391391
}
392392

393+
void vc4_txp_connector_reset(struct drm_connector *connector)
394+
{
395+
uint64_t rotation = DRM_MODE_ROTATE_0;
396+
397+
drm_atomic_helper_connector_reset(connector);
398+
399+
if (connector->state) {
400+
if (connector->rotation_property)
401+
drm_object_property_get_default_value(&connector->base,
402+
connector->rotation_property,
403+
&rotation);
404+
405+
connector->state->rotation = rotation;
406+
}
407+
}
408+
393409
static const struct drm_connector_funcs vc4_txp_connector_funcs = {
394410
.detect = vc4_txp_connector_detect,
395411
.fill_modes = drm_helper_probe_single_connector_modes,
396412
.destroy = drm_connector_cleanup,
397-
.reset = drm_atomic_helper_connector_reset,
413+
.reset = vc4_txp_connector_reset,
398414
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
399415
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
400416
};

0 commit comments

Comments
 (0)