dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] drm/modes: Apply video parameters with only reflect option
@ 2020-01-17 15:34 Stephan Gerhold
  2020-01-17 15:34 ` [PATCH v3 1/2] drm/modes: Make sure to parse valid rotation value from cmdline Stephan Gerhold
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stephan Gerhold @ 2020-01-17 15:34 UTC (permalink / raw)
  To: Maxime Ripard, Maarten Lankhorst; +Cc: David Airlie, Stephan Gerhold, dri-devel

At the moment, video mode parameters like video=540x960,reflect_x,
(without rotation set) are not taken into account when applying the
mode in drm_client_modeset.c.

One of the reasons for this is that the calculation that
combines the panel_orientation with cmdline->rotation_reflection
does not handle the case when cmdline->rotation_reflection does
not have any rotation set.
(i.e. cmdline->rotation_reflection & DRM_MODE_ROTATE_MASK == 0)

However, we really should not generate such a value in the first place.
Rotation values should have exactly one rotation angle set
(DRM_MODE_ROTATE_0 for "no rotation").

This patch set changes the command line parser to make sure that we generate
only valid rotation values (defaulting to DRM_MODE_ROTATE_0).

Finally it allows DRM_MODE_ROTATE_0 when applying the rotation from
the video mode parameters to make parameters without rotation work correctly.


Changes in v3:
  - Fix the cmdline parser to generate only valid rotation values instead.
    (There should be exactly one rotation angle in a rotation value.)
  - Removed most of the original patch - combining the rotations works correctly
    if we only have valid rotation values

v2: https://lore.kernel.org/dri-devel/20191216171017.173326-1-stephan@gerhold.net/
  - Clarified commit message - parameters are parsed correctly,
    but not taken into account when applying the mode.
v1: https://lore.kernel.org/dri-devel/20191209183254.211428-1-stephan@gerhold.net/


Stephan Gerhold (2):
  drm/modes: Make sure to parse valid rotation value from cmdline
  drm/modes: Allow DRM_MODE_ROTATE_0 when applying video mode parameters

 drivers/gpu/drm/drm_client_modeset.c              |  3 ++-
 drivers/gpu/drm/drm_modes.c                       |  7 +++++++
 drivers/gpu/drm/selftests/drm_cmdline_selftests.h |  1 +
 .../gpu/drm/selftests/test-drm_cmdline_parser.c   | 15 +++++++++++++--
 4 files changed, 23 insertions(+), 3 deletions(-)

-- 
2.25.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-13  8:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-17 15:34 [PATCH v3 0/2] drm/modes: Apply video parameters with only reflect option Stephan Gerhold
2020-01-17 15:34 ` [PATCH v3 1/2] drm/modes: Make sure to parse valid rotation value from cmdline Stephan Gerhold
2020-01-17 15:34 ` [PATCH v3 2/2] drm/modes: Allow DRM_MODE_ROTATE_0 when applying video mode parameters Stephan Gerhold
2020-01-17 18:51 ` [PATCH v3 0/2] drm/modes: Apply video parameters with only reflect option Maxime Ripard
2020-02-12 15:29   ` Stephan Gerhold
2020-02-12 17:33     ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox