Skip to content

Commit

Permalink
drm/client: Restrict the rotation check to the rotation itself
Browse files Browse the repository at this point in the history
The drm_client_rotation has a check on the rotation value, but the
reflections are also stored in the same variable, and the check doesn't
take this into account.

Therefore, even though we might have a valid rotation, if we're also using
a reflection parameter, the test will fail for no particular reason.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/cf4de0cdef20aac6c654b7b73c2ab3e317c46803.1560783090.git-series.maxime.ripard@bootlin.com
  • Loading branch information
Maxime Ripard committed Jun 19, 2019
1 parent 46cc2d7 commit 307696d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_client_modeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@ bool drm_client_panel_rotation(struct drm_mode_set *modeset, unsigned int *rotat
* depending on the hardware this may require the framebuffer
* to be in a specific tiling format.
*/
if (*rotation != DRM_MODE_ROTATE_180 || !plane->rotation_property)
if ((*rotation & DRM_MODE_ROTATE_MASK) != DRM_MODE_ROTATE_180 ||
!plane->rotation_property)
return false;

for (i = 0; i < plane->rotation_property->num_values; i++)
Expand Down

0 comments on commit 307696d

Please sign in to comment.