Skip to content

Commit

Permalink
drm: Validate connector rotation has one bit set in the rotation prop…
Browse files Browse the repository at this point in the history
…erty

Copy the same validation logic as from the plane rotation property.

Fixes: 8fec3ff ("drm: Add a rotation parameter to connectors.")
Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Dec 12, 2024
1 parent 962c3f2 commit 9eab5ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/drm_atomic_uapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,12 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
} else if (property == connector->privacy_screen_sw_state_property) {
state->privacy_screen_sw_state = val;
} else if (property == connector->rotation_property) {
if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK)) {
drm_dbg_atomic(connector->dev,
"[CONNECTOR:%d:%s] bad rotation bitmask: 0x%llx\n",
connector->base.id, connector->name, val);
return -EINVAL;
}
state->rotation = val;
} else if (connector->funcs->atomic_set_property) {
return connector->funcs->atomic_set_property(connector,
Expand Down

0 comments on commit 9eab5ea

Please sign in to comment.