drm/bridge: synopsys: dw-hdmi: fixed an error in setting the avi quantization range
According CEA-861 and HDMI2.0 spec, if EDID indicate the sink support hdmi2.0 or support quantization range, setting the avi quantization range to non-zero value. Change-Id: I866d2e5c3c8e1e3eb73b7a8ebddd5a86aa477e63 Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
@ -361,6 +361,7 @@ struct dw_hdmi {
|
|||||||
hdmi_codec_plugged_cb plugged_cb;
|
hdmi_codec_plugged_cb plugged_cb;
|
||||||
struct device *codec_dev;
|
struct device *codec_dev;
|
||||||
enum drm_connector_status last_connector_result;
|
enum drm_connector_status last_connector_result;
|
||||||
|
bool rgb_quant_range_selectable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HDMI_IH_PHY_STAT0_RX_SENSE \
|
#define HDMI_IH_PHY_STAT0_RX_SENSE \
|
||||||
@ -1896,12 +1897,10 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
|
|||||||
/* Initialise info frame from DRM mode */
|
/* Initialise info frame from DRM mode */
|
||||||
drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, is_hdmi2);
|
drm_hdmi_avi_infoframe_from_display_mode(&frame, mode, is_hdmi2);
|
||||||
|
|
||||||
/*
|
|
||||||
* Ignore monitor selectable quantization, use quantization set
|
|
||||||
* by the user
|
|
||||||
*/
|
|
||||||
drm_hdmi_avi_infoframe_quant_range(&frame, mode, rgb_quant_range,
|
drm_hdmi_avi_infoframe_quant_range(&frame, mode, rgb_quant_range,
|
||||||
true, is_hdmi2);
|
hdmi->rgb_quant_range_selectable || is_hdmi2,
|
||||||
|
is_hdmi2);
|
||||||
|
|
||||||
if (hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format))
|
if (hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format))
|
||||||
frame.colorspace = HDMI_COLORSPACE_YUV444;
|
frame.colorspace = HDMI_COLORSPACE_YUV444;
|
||||||
else if (hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format))
|
else if (hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format))
|
||||||
@ -2799,6 +2798,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
|||||||
|
|
||||||
hdmi->support_hdmi = drm_detect_hdmi_monitor(edid);
|
hdmi->support_hdmi = drm_detect_hdmi_monitor(edid);
|
||||||
hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
|
hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
|
||||||
|
hdmi->rgb_quant_range_selectable = drm_rgb_quant_range_selectable(edid);
|
||||||
drm_connector_update_edid_property(connector, edid);
|
drm_connector_update_edid_property(connector, edid);
|
||||||
cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid);
|
cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid);
|
||||||
ret = drm_add_edid_modes(connector, edid);
|
ret = drm_add_edid_modes(connector, edid);
|
||||||
@ -2807,6 +2807,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
|||||||
} else {
|
} else {
|
||||||
hdmi->support_hdmi = true;
|
hdmi->support_hdmi = true;
|
||||||
hdmi->sink_has_audio = true;
|
hdmi->sink_has_audio = true;
|
||||||
|
hdmi->rgb_quant_range_selectable = false;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(dw_hdmi_default_modes); i++) {
|
for (i = 0; i < ARRAY_SIZE(dw_hdmi_default_modes); i++) {
|
||||||
const struct drm_display_mode *ptr =
|
const struct drm_display_mode *ptr =
|
||||||
|
|||||||
Reference in New Issue
Block a user