mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
drm/amd/display: Prune per-tile Timing from Apple Studio Display Primary Tile
[why]
The Apple Studio Display primary tile advertises both the full 5120x2880
mode and the per-tile 2560x2880 timing. With the secondary tile already
hidden from userspace, the stray 2560x2880 mode on the primary connector
can still be picked by compositors, defeating the single 5K stream goal.
[how]
Prune the per-tile timing from the primary connector during get_modes:
when the sink carries the disable_second_tile quirk and the connector is
the primary tile (tile_h_loc == 0 && tile_v_loc == 0), drop any probed
mode matching the advertised tile size (tile_h_size x tile_v_size) so
userspace only sees the full 5120x2880 mode.
Fixes: 49521be480 ("drm/amd/display: hide Apple Studio Display secondary tile")
Reviewed-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1c5e6cd829
commit
7a4dd08c3f
|
|
@ -2804,6 +2804,47 @@ void amdgpu_set_panel_orientation(struct drm_connector *connector)
|
|||
native_mode->vdisplay);
|
||||
}
|
||||
|
||||
/*
|
||||
* The Apple Studio Display primary tile advertises both the full 5120x2880
|
||||
* mode and the per-tile 2560x2880 timing. As the secondary tile is hidden from
|
||||
* userspace (see amdgpu_dm_hide_secondary_tile_from_userspace()), drop the
|
||||
* per-tile timing from the primary connector so compositors only pick the full
|
||||
* 5K mode.
|
||||
*/
|
||||
static void amdgpu_dm_prune_primary_tile_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
|
||||
struct drm_display_mode *mode, *t;
|
||||
|
||||
if (!aconnector->dc_sink)
|
||||
return;
|
||||
|
||||
if (!aconnector->dc_sink->edid_caps.panel_patch.disable_second_tile)
|
||||
return;
|
||||
|
||||
if (!connector->has_tile)
|
||||
return;
|
||||
|
||||
/* Only prune the per-tile timing from the primary tile. */
|
||||
if (connector->tile_h_loc || connector->tile_v_loc)
|
||||
return;
|
||||
|
||||
list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
|
||||
if (mode->hdisplay != connector->tile_h_size ||
|
||||
mode->vdisplay != connector->tile_v_size)
|
||||
continue;
|
||||
|
||||
drm_dbg_kms(connector->dev,
|
||||
"[CONNECTOR:%d:%s] pruning per-tile %dx%d timing from primary Apple Studio Display tile\n",
|
||||
connector->base.id, connector->name,
|
||||
mode->hdisplay, mode->vdisplay);
|
||||
|
||||
list_del(&mode->head);
|
||||
drm_mode_destroy(connector->dev, mode);
|
||||
aconnector->num_modes--;
|
||||
}
|
||||
}
|
||||
|
||||
STATIC_IFN_KUNIT void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,
|
||||
const struct drm_edid *drm_edid)
|
||||
{
|
||||
|
|
@ -2816,6 +2857,8 @@ STATIC_IFN_KUNIT void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *co
|
|||
amdgpu_dm_connector->num_modes =
|
||||
drm_edid_connector_add_modes(connector);
|
||||
|
||||
amdgpu_dm_prune_primary_tile_modes(connector);
|
||||
|
||||
/* sorting the probed modes before calling function
|
||||
* amdgpu_dm_get_native_mode() since EDID can have
|
||||
* more than one preferred mode. The modes that are
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user