Skip to content

Commit ca9d615

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 20e5ed8 commit ca9d615

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
@@ -1060,6 +1060,7 @@ extern struct platform_driver vc4_vec_driver;
10601060

10611061
/* vc4_txp.c */
10621062
extern struct platform_driver vc4_txp_driver;
1063+
void vc4_txp_connector_reset(struct drm_connector *connector);
10631064

10641065
/* vc4_irq.c */
10651066
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
@@ -391,11 +391,27 @@ vc4_txp_connector_detect(struct drm_connector *connector, bool force)
391391
return connector_status_connected;
392392
}
393393

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

0 commit comments

Comments
 (0)