mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
drm: Validate connector rotation has one bit set in the rotation property
Copy the same validation logic as from the plane rotation property.
Fixes: 8fec3ff870 ("drm: Add a rotation parameter to connectors.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
e941bbe30b
commit
be6b313f1f
@@ -794,6 +794,12 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
|
||||
} else if (property == connector->broadcast_rgb_property) {
|
||||
state->hdmi.broadcast_rgb = 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,
|
||||
|
||||
Reference in New Issue
Block a user