diff options
| -rw-r--r-- | drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.c | 22 | ||||
| -rw-r--r-- | drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h | 7 | ||||
| -rw-r--r-- | include/uapi/drm/msm_drm.h | 9 |
3 files changed, 30 insertions, 8 deletions
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.c b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.c index 8ce90b9bc162..5c3b3ec45e76 100644 --- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.c +++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -73,6 +73,7 @@ static const char *sde_hdmi_hdr_sname(enum sde_hdmi_hdr_state hdr_state) switch (hdr_state) { case HDR_DISABLE: return "HDR_DISABLE"; case HDR_ENABLE: return "HDR_ENABLE"; + case HDR_RESET: return "HDR_RESET"; default: return "HDR_INVALID_STATE"; } } @@ -984,18 +985,23 @@ u8 sde_hdmi_hdr_get_ops(u8 curr_state, u8 new_state) { - /** There could be 3 valid state transitions: + /** There could be 4 valid state transitions: * 1. HDR_DISABLE -> HDR_ENABLE * * In this transition, we shall start sending * HDR metadata with metadata from the HDR clip * - * 2. HDR_ENABLE -> HDR_ENABLE + * 2. HDR_ENABLE -> HDR_RESET * * In this transition, we will keep sending * HDR metadata but with EOTF and metadata as 0 * - * 3. HDR_ENABLE -> HDR_DISABLE + * 3. HDR_RESET -> HDR_ENABLE + * + * In this transition, we will start sending + * HDR metadata with metadata from the HDR clip + * + * 4. HDR_RESET -> HDR_DISABLE * * In this transition, we will stop sending * metadata to the sink and clear PKT_CTRL register @@ -1009,12 +1015,18 @@ u8 sde_hdmi_hdr_get_ops(u8 curr_state, sde_hdmi_hdr_sname(new_state)); return HDR_SEND_INFO; } else if ((curr_state == HDR_ENABLE) + && (new_state == HDR_RESET)) { + HDMI_UTIL_DEBUG("State changed %s ---> %s\n", + sde_hdmi_hdr_sname(curr_state), + sde_hdmi_hdr_sname(new_state)); + return HDR_SEND_INFO; + } else if ((curr_state == HDR_RESET) && (new_state == HDR_ENABLE)) { HDMI_UTIL_DEBUG("State changed %s ---> %s\n", sde_hdmi_hdr_sname(curr_state), sde_hdmi_hdr_sname(new_state)); return HDR_SEND_INFO; - } else if ((curr_state == HDR_ENABLE) + } else if ((curr_state == HDR_RESET) && (new_state == HDR_DISABLE)) { HDMI_UTIL_DEBUG("State changed %s ---> %s\n", sde_hdmi_hdr_sname(curr_state), diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h index 340e665f2c28..8a79c361b718 100644 --- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h +++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -141,8 +141,9 @@ enum sde_hdmi_tx_hdcp2p2_rxstatus_intr_mask { }; enum sde_hdmi_hdr_state { - HDR_DISABLE, - HDR_ENABLE + HDR_DISABLE = DRM_MSM_HDR_DISABLE, + HDR_ENABLE = DRM_MSM_HDR_ENABLE, + HDR_RESET = DRM_MSM_HDR_RESET }; enum sde_hdmi_hdr_op { diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h index 30dbd1c34335..583ebc4616e9 100644 --- a/include/uapi/drm/msm_drm.h +++ b/include/uapi/drm/msm_drm.h @@ -62,6 +62,15 @@ struct drm_msm_timespec { __s64 tv_nsec; /* nanoseconds */ }; +/* From CEA.861.3 */ +#define HDR_EOTF_SMTPE_ST2084 0x2 +#define HDR_EOTF_HLG 0x3 + +/* hdr hdmi state takes possible values of 0, 1 and 2 respectively */ +#define DRM_MSM_HDR_DISABLE 0 +#define DRM_MSM_HDR_ENABLE 1 +#define DRM_MSM_HDR_RESET 2 + /* * HDR Metadata * These are defined as per EDID spec and shall be used by the sink |
