diff options
author | Abhinav Kumar <abhinavk@codeaurora.org> | 2017-07-09 10:51:11 -0700 |
---|---|---|
committer | Abhinav Kumar <abhinavk@codeaurora.org> | 2017-07-09 10:59:31 -0700 |
commit | 5b678cb82f1479bc1710c7ff1c2c7389b98b9ee9 (patch) | |
tree | d8c1a67f7ff63744491b4de89af11ce30f420a1e /drivers | |
parent | 3ec8bfc9bb3a1f1a8584074f914c1d92f052b7f1 (diff) |
drm/msm: add input validation before setting HDR infoframe
Move the input validation for the connector's HDR support
before calling the API to set the infoframe rather than within
the API itself.
This helps to avoid redundant checks and logging.
Change-Id: If21562920edb1613a73b5e18ab258a57e46c1d7b
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c index 2ee75a2c1039..b30e894ebc4d 100644 --- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c +++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c @@ -1893,11 +1893,6 @@ struct drm_msm_ext_panel_hdr_metadata *hdr_meta) return; } - if (!connector->hdr_supported) { - SDE_ERROR("Sink does not support HDR\n"); - return; - } - /* Setup Packet header and payload */ packet_header = type_code | (version << 8) | (length << 16); hdmi_write(hdmi, HDMI_GENERIC0_HDR, packet_header); @@ -2308,8 +2303,14 @@ int sde_hdmi_pre_kickoff(struct drm_connector *connector, struct msm_display_kickoff_params *params) { - sde_hdmi_panel_set_hdr_infoframe(display, - params->hdr_metadata); + if (!connector || !display || !params) { + pr_err("Invalid params\n"); + return -EINVAL; + } + + if (connector->hdr_supported) + sde_hdmi_panel_set_hdr_infoframe(display, + params->hdr_metadata); return 0; } |