mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/bridge: synopsys: dw-hdmi-qp: Use new edid api
Kernel-6.1 add new api drm_edid_connector_update can parse hdmi2.1 edid information. Kernel-5.10 old drm_add_edid_modes in kernel-6.1 is limited to parse hdmi2.0 edid information. So we must use drm_edid_connector_update instead of drm_add_edid_modes. Change-Id: I421049f38ffdec1cb136a02d9100eafd92c1f0a6 Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
@@ -2687,7 +2687,8 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
container_of(connector, struct dw_hdmi_qp, connector);
|
||||
struct hdr_static_metadata *metedata =
|
||||
&connector->hdr_sink_metadata.hdmi_type1;
|
||||
struct edid *edid;
|
||||
const struct edid *edid = NULL;
|
||||
const struct drm_edid *drm_edid;
|
||||
struct drm_display_mode *mode;
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
void *data = hdmi->plat_data->phy_data;
|
||||
@@ -2731,14 +2732,13 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
memset(metedata, 0, sizeof(*metedata));
|
||||
memset(hdmi->vendor_info, 0, VENDOR_INFO_LEN);
|
||||
|
||||
if (edid_blob_ptr && edid_blob_ptr->length) {
|
||||
edid = kmalloc(edid_blob_ptr->length, GFP_KERNEL);
|
||||
if (!edid)
|
||||
return -ENOMEM;
|
||||
memcpy(edid, edid_blob_ptr->data, edid_blob_ptr->length);
|
||||
} else {
|
||||
edid = drm_get_edid(connector, hdmi->ddc);
|
||||
}
|
||||
if (edid_blob_ptr && edid_blob_ptr->length)
|
||||
drm_edid = drm_edid_alloc(edid_blob_ptr->data, edid_blob_ptr->length);
|
||||
else
|
||||
drm_edid = drm_edid_read_ddc(connector, hdmi->ddc);
|
||||
|
||||
if (drm_edid)
|
||||
edid = drm_edid_raw(drm_edid);
|
||||
|
||||
if (edid) {
|
||||
u8 *raw_edid = (u8 *)edid;
|
||||
@@ -2748,13 +2748,12 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
|
||||
hdmi->support_hdmi = drm_detect_hdmi_monitor(edid);
|
||||
hdmi->sink_has_audio = drm_detect_monitor_audio(edid);
|
||||
drm_connector_update_edid_property(connector, edid);
|
||||
if (hdmi->cec_notifier)
|
||||
cec_notifier_set_phys_addr_from_edid(hdmi->cec_notifier, edid);
|
||||
if (hdmi->plat_data->get_edid_dsc_info)
|
||||
hdmi->plat_data->get_edid_dsc_info(data, edid);
|
||||
memcpy(hdmi->vendor_info, &raw_edid[8], VENDOR_INFO_LEN);
|
||||
ret = drm_add_edid_modes(connector, edid);
|
||||
ret = drm_edid_connector_update(connector, drm_edid);
|
||||
if (hdmi->plat_data->get_colorimetry)
|
||||
hdmi->plat_data->get_colorimetry(data, edid);
|
||||
if (hdmi->plat_data->get_yuv422_format)
|
||||
@@ -2771,6 +2770,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
|
||||
if (!secondary) {
|
||||
kfree(edid);
|
||||
kfree(drm_edid);
|
||||
return -ENOMEM;
|
||||
}
|
||||
secondary_data = secondary->plat_data->phy_data;
|
||||
@@ -2784,6 +2784,7 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
secondary->plat_data->get_edid_dsc_info(secondary_data, edid);
|
||||
}
|
||||
kfree(edid);
|
||||
kfree(drm_edid);
|
||||
} else {
|
||||
hdmi->support_hdmi = true;
|
||||
hdmi->sink_has_audio = true;
|
||||
|
||||
@@ -2820,7 +2820,7 @@ dw_hdmi_rockchip_get_color_changed(void *data)
|
||||
|
||||
static int
|
||||
dw_hdmi_rockchip_get_yuv422_format(struct drm_connector *connector,
|
||||
struct edid *edid)
|
||||
const struct edid *edid)
|
||||
{
|
||||
if (!connector || !edid)
|
||||
return -EINVAL;
|
||||
@@ -2829,7 +2829,7 @@ dw_hdmi_rockchip_get_yuv422_format(struct drm_connector *connector,
|
||||
}
|
||||
|
||||
static int
|
||||
dw_hdmi_rockchip_get_edid_dsc_info(void *data, struct edid *edid)
|
||||
dw_hdmi_rockchip_get_edid_dsc_info(void *data, const struct edid *edid)
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
|
||||
@@ -2868,7 +2868,7 @@ dw_hdmi_rockchip_get_next_hdr_data(void *data, struct edid *edid,
|
||||
return ret;
|
||||
};
|
||||
|
||||
static int dw_hdmi_rockchip_get_colorimetry(void *data, struct edid *edid)
|
||||
static int dw_hdmi_rockchip_get_colorimetry(void *data, const struct edid *edid)
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
|
||||
|
||||
@@ -741,7 +741,7 @@ static u8 *find_cea_extension(const struct edid *edid)
|
||||
#define EDID_CEA_YCRCB422 (1 << 4)
|
||||
|
||||
int rockchip_drm_get_yuv422_format(struct drm_connector *connector,
|
||||
struct edid *edid)
|
||||
const struct edid *edid)
|
||||
{
|
||||
struct drm_display_info *info;
|
||||
const u8 *edid_ext;
|
||||
|
||||
@@ -633,7 +633,7 @@ uint32_t rockchip_drm_of_find_possible_crtcs(struct drm_device *dev,
|
||||
uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info);
|
||||
uint32_t rockchip_drm_get_cycles_per_pixel(uint32_t bus_format);
|
||||
int rockchip_drm_get_yuv422_format(struct drm_connector *connector,
|
||||
struct edid *edid);
|
||||
const struct edid *edid);
|
||||
int rockchip_drm_parse_cea_ext(struct rockchip_drm_dsc_cap *dsc_cap,
|
||||
u8 *max_frl_rate_per_lane, u8 *max_lanes, u8 *add_func,
|
||||
const struct edid *edid);
|
||||
|
||||
@@ -250,8 +250,8 @@ struct dw_hdmi_plat_data {
|
||||
struct drm_property_blob *(*get_hdr_blob)(void *data);
|
||||
bool (*get_color_changed)(void *data);
|
||||
int (*get_yuv422_format)(struct drm_connector *connector,
|
||||
struct edid *edid);
|
||||
int (*get_edid_dsc_info)(void *data, struct edid *edid);
|
||||
const struct edid *edid);
|
||||
int (*get_edid_dsc_info)(void *data, const struct edid *edid);
|
||||
int (*get_next_hdr_data)(void *data, struct edid *edid,
|
||||
struct drm_connector *connector);
|
||||
struct dw_hdmi_link_config *(*get_link_cfg)(void *data);
|
||||
@@ -267,7 +267,7 @@ struct dw_hdmi_plat_data {
|
||||
void (*update_color_format)(struct drm_connector_state *conn_state, void *data);
|
||||
bool (*check_hdr_color_change)(struct drm_connector_state *conn_state, void *data);
|
||||
void (*set_prev_bus_format)(void *data, unsigned long bus_format);
|
||||
int (*get_colorimetry)(void *data, struct edid *edid);
|
||||
int (*get_colorimetry)(void *data, const struct edid *edid);
|
||||
void (*set_ddc_io)(void *data, bool enable);
|
||||
void (*set_hdcp14_mem)(void *data, bool enable);
|
||||
struct drm_display_mode *(*get_force_timing)(void *data);
|
||||
|
||||
Reference in New Issue
Block a user