Commit 092c367a authored by Ville Syrjälä's avatar Ville Syrjälä

drm/edid: Fix DispID tile parsing for override EDID

Currently the DispID tile block gets parsed in drm_get_edid(), which
is an odd place for it considering we parse nothing else there. Also
this doesn't work for override EDIDs since
drm_connector_update_edid_property() refuses to do its job twice
in such cases. Thus we never update the tile property with results
of the DispID tile block parsing during drm_get_edid().

To fix this let's just move the tile block parsing to happen during
drm_connector_update_edid_property(), which is where we parse a bunch
of other stuff as well (and where we update both the EDID and tile
properties).
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-10-ville.syrjala@linux.intel.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bd1f64df
...@@ -1970,6 +1970,8 @@ int drm_connector_update_edid_property(struct drm_connector *connector, ...@@ -1970,6 +1970,8 @@ int drm_connector_update_edid_property(struct drm_connector *connector,
else else
drm_reset_display_info(connector); drm_reset_display_info(connector);
drm_update_tile_info(connector, edid);
drm_object_property_set_value(&connector->base, drm_object_property_set_value(&connector->base,
dev->mode_config.non_desktop_property, dev->mode_config.non_desktop_property,
connector->display_info.non_desktop); connector->display_info.non_desktop);
......
...@@ -278,3 +278,4 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, ...@@ -278,3 +278,4 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
void drm_mode_fixup_1366x768(struct drm_display_mode *mode); void drm_mode_fixup_1366x768(struct drm_display_mode *mode);
void drm_reset_display_info(struct drm_connector *connector); void drm_reset_display_info(struct drm_connector *connector);
u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid); u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
void drm_update_tile_info(struct drm_connector *connector, const struct edid *edid);
...@@ -1583,8 +1583,6 @@ module_param_named(edid_fixup, edid_fixup, int, 0400); ...@@ -1583,8 +1583,6 @@ module_param_named(edid_fixup, edid_fixup, int, 0400);
MODULE_PARM_DESC(edid_fixup, MODULE_PARM_DESC(edid_fixup,
"Minimum number of valid EDID header bytes (0-8, default 6)"); "Minimum number of valid EDID header bytes (0-8, default 6)");
static void drm_get_displayid(struct drm_connector *connector,
struct edid *edid);
static int validate_displayid(u8 *displayid, int length, int idx); static int validate_displayid(u8 *displayid, int length, int idx);
static int drm_edid_block_checksum(const u8 *raw_edid) static int drm_edid_block_checksum(const u8 *raw_edid)
...@@ -2018,18 +2016,13 @@ EXPORT_SYMBOL(drm_probe_ddc); ...@@ -2018,18 +2016,13 @@ EXPORT_SYMBOL(drm_probe_ddc);
struct edid *drm_get_edid(struct drm_connector *connector, struct edid *drm_get_edid(struct drm_connector *connector,
struct i2c_adapter *adapter) struct i2c_adapter *adapter)
{ {
struct edid *edid;
if (connector->force == DRM_FORCE_OFF) if (connector->force == DRM_FORCE_OFF)
return NULL; return NULL;
if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter))
return NULL; return NULL;
edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter); return drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter);
if (edid)
drm_get_displayid(connector, edid);
return edid;
} }
EXPORT_SYMBOL(drm_get_edid); EXPORT_SYMBOL(drm_get_edid);
...@@ -5792,9 +5785,9 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame, ...@@ -5792,9 +5785,9 @@ drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
EXPORT_SYMBOL(drm_hdmi_vendor_infoframe_from_display_mode); EXPORT_SYMBOL(drm_hdmi_vendor_infoframe_from_display_mode);
static int drm_parse_tiled_block(struct drm_connector *connector, static int drm_parse_tiled_block(struct drm_connector *connector,
struct displayid_block *block) const struct displayid_block *block)
{ {
struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block; const struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block;
u16 w, h; u16 w, h;
u8 tile_v_loc, tile_h_loc; u8 tile_v_loc, tile_h_loc;
u8 num_v_tile, num_h_tile; u8 num_v_tile, num_h_tile;
...@@ -5845,10 +5838,10 @@ static int drm_parse_tiled_block(struct drm_connector *connector, ...@@ -5845,10 +5838,10 @@ static int drm_parse_tiled_block(struct drm_connector *connector,
return 0; return 0;
} }
static int drm_parse_display_id(struct drm_connector *connector, static int drm_displayid_parse_tiled(struct drm_connector *connector,
u8 *displayid, int length, int idx) const u8 *displayid, int length, int idx)
{ {
struct displayid_block *block; const struct displayid_block *block;
int ret; int ret;
idx += sizeof(struct displayid_hdr); idx += sizeof(struct displayid_hdr);
...@@ -5862,12 +5855,6 @@ static int drm_parse_display_id(struct drm_connector *connector, ...@@ -5862,12 +5855,6 @@ static int drm_parse_display_id(struct drm_connector *connector,
if (ret) if (ret)
return ret; return ret;
break; break;
case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
/* handled in mode gathering code. */
break;
case DATA_BLOCK_CTA:
/* handled in the cea parser code. */
break;
default: default:
DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag); DRM_DEBUG_KMS("found DisplayID tag 0x%x, unhandled\n", block->tag);
break; break;
...@@ -5876,10 +5863,10 @@ static int drm_parse_display_id(struct drm_connector *connector, ...@@ -5876,10 +5863,10 @@ static int drm_parse_display_id(struct drm_connector *connector,
return 0; return 0;
} }
static void drm_get_displayid(struct drm_connector *connector, void drm_update_tile_info(struct drm_connector *connector,
struct edid *edid) const struct edid *edid)
{ {
void *displayid = NULL; const void *displayid = NULL;
int length, idx; int length, idx;
int ret; int ret;
...@@ -5890,7 +5877,7 @@ static void drm_get_displayid(struct drm_connector *connector, ...@@ -5890,7 +5877,7 @@ static void drm_get_displayid(struct drm_connector *connector,
goto out_drop_ref; goto out_drop_ref;
} }
ret = drm_parse_display_id(connector, displayid, length, idx); ret = drm_displayid_parse_tiled(connector, displayid, length, idx);
if (ret < 0) if (ret < 0)
goto out_drop_ref; goto out_drop_ref;
if (!connector->has_tile) if (!connector->has_tile)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment