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>
This commit is contained in:
parent
3ec8bfc9bb
commit
5b678cb82f
1 changed files with 8 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue