summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2021-05-04 13:27:42 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2021-05-05 21:22:30 +0300
commit1c4f39b04202595a599d7449fe38a9550001d9d9 (patch)
tree5e0dd2d6da45839d0f8a0537fb0b8b7abb141631 /drivers/gpu/drm/drm_modes.c
parent660729e494b6ee64feb97b41f3092c32a41c7dae (diff)
drm: Use drm_mode_is_420_only() instead of open coding it
Replace the open coded drm_mode_is_420_only() with the real thing. No functional changes. Cc: Werner Sembach <wse@tuxedocomputers.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210504102742.7005-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 33a93fa24eb1..12fcbb7ce179 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1176,16 +1176,11 @@ enum drm_mode_status
drm_mode_validate_ycbcr420(const struct drm_display_mode *mode,
struct drm_connector *connector)
{
- u8 vic = drm_match_cea_mode(mode);
- enum drm_mode_status status = MODE_OK;
- struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
-
- if (test_bit(vic, hdmi->y420_vdb_modes)) {
- if (!connector->ycbcr_420_allowed)
- status = MODE_NO_420;
- }
+ if (!connector->ycbcr_420_allowed &&
+ drm_mode_is_420_only(&connector->display_info, mode))
+ return MODE_NO_420;
- return status;
+ return MODE_OK;
}
EXPORT_SYMBOL(drm_mode_validate_ycbcr420);