diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-06-20 17:26:37 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-06-24 18:08:55 +0300 |
commit | 9f396ab4de152408c7007fce255a7144ae7d70a0 (patch) | |
tree | eda30d09240da3f8beb81ebea75ef7a42a0e82a1 /drivers/gpu/drm/drm_modes.c | |
parent | 993a80671ed9a149d5136965d04d0a71f7b21c48 (diff) | |
download | linux-9f396ab4de152408c7007fce255a7144ae7d70a0.tar.gz linux-9f396ab4de152408c7007fce255a7144ae7d70a0.tar.bz2 linux-9f396ab4de152408c7007fce255a7144ae7d70a0.zip |
drm: WARN on illegal aspect ratio when converting a mode to umode
WARN if the incoming drm_display_mode has an illegal aspect ratio
when converting it to a user mode. This should never happen unless
the driver made a mistake and put an invalid value into the aspect
ratio.
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-4-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 847048dee048..be2ccd8eccfd 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1906,8 +1906,11 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, case HDMI_PICTURE_ASPECT_256_135: out->flags |= DRM_MODE_FLAG_PIC_AR_256_135; break; - case HDMI_PICTURE_ASPECT_RESERVED: default: + WARN(1, "Invalid aspect ratio (0%x) on mode\n", + in->picture_aspect_ratio); + /* fall through */ + case HDMI_PICTURE_ASPECT_NONE: out->flags |= DRM_MODE_FLAG_PIC_AR_NONE; break; } |