Skip to content

Commit 7fb208f

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.10.y' into v6.10+
2 parents 6b63bfe + 7ba498d commit 7fb208f

29 files changed

Lines changed: 486 additions & 355 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 10
4-
SUBLEVEL = 5
4+
SUBLEVEL = 6
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

arch/loongarch/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+
#define __ARCH_WANT_NEW_STAT
23
#define __ARCH_WANT_SYS_CLONE
34
#define __ARCH_WANT_SYS_CLONE3
45

drivers/ata/libata-scsi.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,19 @@ static void ata_gen_passthru_sense(struct ata_queued_cmd *qc)
941941
&sense_key, &asc, &ascq);
942942
ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
943943
} else {
944-
/* ATA PASS-THROUGH INFORMATION AVAILABLE */
945-
ata_scsi_set_sense(qc->dev, cmd, RECOVERED_ERROR, 0, 0x1D);
944+
/*
945+
* ATA PASS-THROUGH INFORMATION AVAILABLE
946+
*
947+
* Note: we are supposed to call ata_scsi_set_sense(), which
948+
* respects the D_SENSE bit, instead of unconditionally
949+
* generating the sense data in descriptor format. However,
950+
* because hdparm, hddtemp, and udisks incorrectly assume sense
951+
* data in descriptor format, without even looking at the
952+
* RESPONSE CODE field in the returned sense data (to see which
953+
* format the returned sense data is in), we are stuck with
954+
* being bug compatible with older kernels.
955+
*/
956+
scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
946957
}
947958
}
948959

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2944,6 +2944,7 @@ static int dm_resume(void *handle)
29442944

29452945
commit_params.streams = dc_state->streams;
29462946
commit_params.stream_count = dc_state->stream_count;
2947+
dc_exit_ips_for_hw_access(dm->dc);
29472948
WARN_ON(!dc_commit_streams(dm->dc, &commit_params));
29482949

29492950
dm_gpureset_commit_state(dm->cached_dc_state, dm);
@@ -3016,7 +3017,8 @@ static int dm_resume(void *handle)
30163017
emulated_link_detect(aconnector->dc_link);
30173018
} else {
30183019
mutex_lock(&dm->dc_lock);
3019-
dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
3020+
dc_exit_ips_for_hw_access(dm->dc);
3021+
dc_link_detect(aconnector->dc_link, DETECT_REASON_RESUMEFROMS3S4);
30203022
mutex_unlock(&dm->dc_lock);
30213023
}
30223024

@@ -3352,6 +3354,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)
33523354
enum dc_connection_type new_connection_type = dc_connection_none;
33533355
struct amdgpu_device *adev = drm_to_adev(dev);
33543356
struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state);
3357+
struct dc *dc = aconnector->dc_link->ctx->dc;
33553358
bool ret = false;
33563359

33573360
if (adev->dm.disable_hpd_irq)
@@ -3386,6 +3389,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)
33863389
drm_kms_helper_connector_hotplug_event(connector);
33873390
} else {
33883391
mutex_lock(&adev->dm.dc_lock);
3392+
dc_exit_ips_for_hw_access(dc);
33893393
ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
33903394
mutex_unlock(&adev->dm.dc_lock);
33913395
if (ret) {
@@ -3445,6 +3449,7 @@ static void handle_hpd_rx_irq(void *param)
34453449
bool has_left_work = false;
34463450
int idx = dc_link->link_index;
34473451
struct hpd_rx_irq_offload_work_queue *offload_wq = &adev->dm.hpd_rx_offload_wq[idx];
3452+
struct dc *dc = aconnector->dc_link->ctx->dc;
34483453

34493454
memset(&hpd_irq_data, 0, sizeof(hpd_irq_data));
34503455

@@ -3534,6 +3539,7 @@ static void handle_hpd_rx_irq(void *param)
35343539
bool ret = false;
35353540

35363541
mutex_lock(&adev->dm.dc_lock);
3542+
dc_exit_ips_for_hw_access(dc);
35373543
ret = dc_link_detect(dc_link, DETECT_REASON_HPDRX);
35383544
mutex_unlock(&adev->dm.dc_lock);
35393545

@@ -4640,6 +4646,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
46404646
bool ret = false;
46414647

46424648
mutex_lock(&dm->dc_lock);
4649+
dc_exit_ips_for_hw_access(dm->dc);
46434650
ret = dc_link_detect(link, DETECT_REASON_BOOT);
46444651
mutex_unlock(&dm->dc_lock);
46454652

@@ -8948,7 +8955,8 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
89488955

89498956
memset(&position, 0, sizeof(position));
89508957
mutex_lock(&dm->dc_lock);
8951-
dc_stream_set_cursor_position(dm_old_crtc_state->stream, &position);
8958+
dc_exit_ips_for_hw_access(dm->dc);
8959+
dc_stream_program_cursor_position(dm_old_crtc_state->stream, &position);
89528960
mutex_unlock(&dm->dc_lock);
89538961
}
89548962

@@ -9017,6 +9025,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
90179025

90189026
dm_enable_per_frame_crtc_master_sync(dc_state);
90199027
mutex_lock(&dm->dc_lock);
9028+
dc_exit_ips_for_hw_access(dm->dc);
90209029
WARN_ON(!dc_commit_streams(dm->dc, &params));
90219030

90229031
/* Allow idle optimization when vblank count is 0 for display off */
@@ -9382,6 +9391,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
93829391

93839392

93849393
mutex_lock(&dm->dc_lock);
9394+
dc_exit_ips_for_hw_access(dm->dc);
93859395
dc_update_planes_and_stream(dm->dc,
93869396
dummy_updates,
93879397
status->plane_count,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 85 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,171 +1594,109 @@ static bool is_dsc_common_config_possible(struct dc_stream_state *stream,
15941594
return bw_range->max_target_bpp_x16 && bw_range->min_target_bpp_x16;
15951595
}
15961596

1597-
#if defined(CONFIG_DRM_AMD_DC_FP)
1598-
static bool dp_get_link_current_set_bw(struct drm_dp_aux *aux, uint32_t *cur_link_bw)
1599-
{
1600-
uint32_t total_data_bw_efficiency_x10000 = 0;
1601-
uint32_t link_rate_per_lane_kbps = 0;
1602-
enum dc_link_rate link_rate;
1603-
union lane_count_set lane_count;
1604-
u8 dp_link_encoding;
1605-
u8 link_bw_set = 0;
1606-
1607-
*cur_link_bw = 0;
1608-
1609-
if (drm_dp_dpcd_read(aux, DP_MAIN_LINK_CHANNEL_CODING_SET, &dp_link_encoding, 1) != 1 ||
1610-
drm_dp_dpcd_read(aux, DP_LANE_COUNT_SET, &lane_count.raw, 1) != 1 ||
1611-
drm_dp_dpcd_read(aux, DP_LINK_BW_SET, &link_bw_set, 1) != 1)
1612-
return false;
1613-
1614-
switch (dp_link_encoding) {
1615-
case DP_8b_10b_ENCODING:
1616-
link_rate = link_bw_set;
1617-
link_rate_per_lane_kbps = link_rate * LINK_RATE_REF_FREQ_IN_KHZ * BITS_PER_DP_BYTE;
1618-
total_data_bw_efficiency_x10000 = DATA_EFFICIENCY_8b_10b_x10000;
1619-
total_data_bw_efficiency_x10000 /= 100;
1620-
total_data_bw_efficiency_x10000 *= DATA_EFFICIENCY_8b_10b_FEC_EFFICIENCY_x100;
1621-
break;
1622-
case DP_128b_132b_ENCODING:
1623-
switch (link_bw_set) {
1624-
case DP_LINK_BW_10:
1625-
link_rate = LINK_RATE_UHBR10;
1626-
break;
1627-
case DP_LINK_BW_13_5:
1628-
link_rate = LINK_RATE_UHBR13_5;
1629-
break;
1630-
case DP_LINK_BW_20:
1631-
link_rate = LINK_RATE_UHBR20;
1632-
break;
1633-
default:
1634-
return false;
1635-
}
1636-
1637-
link_rate_per_lane_kbps = link_rate * 10000;
1638-
total_data_bw_efficiency_x10000 = DATA_EFFICIENCY_128b_132b_x10000;
1639-
break;
1640-
default:
1641-
return false;
1642-
}
1643-
1644-
*cur_link_bw = link_rate_per_lane_kbps * lane_count.bits.LANE_COUNT_SET / 10000 * total_data_bw_efficiency_x10000;
1645-
return true;
1646-
}
1647-
#endif
1648-
16491597
enum dc_status dm_dp_mst_is_port_support_mode(
16501598
struct amdgpu_dm_connector *aconnector,
16511599
struct dc_stream_state *stream)
16521600
{
1653-
#if defined(CONFIG_DRM_AMD_DC_FP)
1654-
int branch_max_throughput_mps = 0;
1601+
int pbn, branch_max_throughput_mps = 0;
16551602
struct dc_link_settings cur_link_settings;
1656-
uint32_t end_to_end_bw_in_kbps = 0;
1657-
uint32_t root_link_bw_in_kbps = 0;
1658-
uint32_t virtual_channel_bw_in_kbps = 0;
1603+
unsigned int end_to_end_bw_in_kbps = 0;
1604+
unsigned int upper_link_bw_in_kbps = 0, down_link_bw_in_kbps = 0;
16591605
struct dc_dsc_bw_range bw_range = {0};
16601606
struct dc_dsc_config_options dsc_options = {0};
1661-
uint32_t stream_kbps;
16621607

1663-
/* DSC unnecessary case
1664-
* Check if timing could be supported within end-to-end BW
1608+
/*
1609+
* Consider the case with the depth of the mst topology tree is equal or less than 2
1610+
* A. When dsc bitstream can be transmitted along the entire path
1611+
* 1. dsc is possible between source and branch/leaf device (common dsc params is possible), AND
1612+
* 2. dsc passthrough supported at MST branch, or
1613+
* 3. dsc decoding supported at leaf MST device
1614+
* Use maximum dsc compression as bw constraint
1615+
* B. When dsc bitstream cannot be transmitted along the entire path
1616+
* Use native bw as bw constraint
16651617
*/
1666-
stream_kbps =
1667-
dc_bandwidth_in_kbps_from_timing(&stream->timing,
1668-
dc_link_get_highest_encoding_format(stream->link));
1669-
cur_link_settings = stream->link->verified_link_cap;
1670-
root_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, &cur_link_settings);
1671-
virtual_channel_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn);
1672-
1673-
/* pick the end to end bw bottleneck */
1674-
end_to_end_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps);
1675-
1676-
if (stream_kbps <= end_to_end_bw_in_kbps) {
1677-
DRM_DEBUG_DRIVER("No DSC needed. End-to-end bw sufficient.");
1678-
return DC_OK;
1679-
}
1680-
1681-
/*DSC necessary case*/
1682-
if (!aconnector->dsc_aux)
1683-
return DC_FAIL_BANDWIDTH_VALIDATE;
1684-
1685-
if (is_dsc_common_config_possible(stream, &bw_range)) {
1686-
1687-
/*capable of dsc passthough. dsc bitstream along the entire path*/
1688-
if (aconnector->mst_output_port->passthrough_aux) {
1689-
if (bw_range.min_kbps > end_to_end_bw_in_kbps) {
1690-
DRM_DEBUG_DRIVER("DSC passthrough. Max dsc compression can't fit into end-to-end bw\n");
1618+
if (is_dsc_common_config_possible(stream, &bw_range) &&
1619+
(aconnector->mst_output_port->passthrough_aux ||
1620+
aconnector->dsc_aux == &aconnector->mst_output_port->aux)) {
1621+
cur_link_settings = stream->link->verified_link_cap;
1622+
upper_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, &cur_link_settings);
1623+
down_link_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn);
1624+
1625+
/* pick the end to end bw bottleneck */
1626+
end_to_end_bw_in_kbps = min(upper_link_bw_in_kbps, down_link_bw_in_kbps);
1627+
1628+
if (end_to_end_bw_in_kbps < bw_range.min_kbps) {
1629+
DRM_DEBUG_DRIVER("maximum dsc compression cannot fit into end-to-end bandwidth\n");
16911630
return DC_FAIL_BANDWIDTH_VALIDATE;
1692-
}
1693-
} else {
1694-
/*dsc bitstream decoded at the dp last link*/
1695-
struct drm_dp_mst_port *immediate_upstream_port = NULL;
1696-
uint32_t end_link_bw = 0;
1697-
1698-
/*Get last DP link BW capability*/
1699-
if (dp_get_link_current_set_bw(&aconnector->mst_output_port->aux, &end_link_bw)) {
1700-
if (stream_kbps > end_link_bw) {
1701-
DRM_DEBUG_DRIVER("DSC decode at last link. Mode required bw can't fit into available bw\n");
1702-
return DC_FAIL_BANDWIDTH_VALIDATE;
1703-
}
1704-
}
1705-
1706-
/*Get virtual channel bandwidth between source and the link before the last link*/
1707-
if (aconnector->mst_output_port->parent->port_parent)
1708-
immediate_upstream_port = aconnector->mst_output_port->parent->port_parent;
1631+
}
17091632

1710-
if (immediate_upstream_port) {
1711-
virtual_channel_bw_in_kbps = kbps_from_pbn(immediate_upstream_port->full_pbn);
1712-
virtual_channel_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps);
1713-
if (bw_range.min_kbps > virtual_channel_bw_in_kbps) {
1714-
DRM_DEBUG_DRIVER("DSC decode at last link. Max dsc compression can't fit into MST available bw\n");
1715-
return DC_FAIL_BANDWIDTH_VALIDATE;
1716-
}
1633+
if (end_to_end_bw_in_kbps < bw_range.stream_kbps) {
1634+
dc_dsc_get_default_config_option(stream->link->dc, &dsc_options);
1635+
dsc_options.max_target_bpp_limit_override_x16 = aconnector->base.display_info.max_dsc_bpp * 16;
1636+
if (dc_dsc_compute_config(stream->sink->ctx->dc->res_pool->dscs[0],
1637+
&stream->sink->dsc_caps.dsc_dec_caps,
1638+
&dsc_options,
1639+
end_to_end_bw_in_kbps,
1640+
&stream->timing,
1641+
dc_link_get_highest_encoding_format(stream->link),
1642+
&stream->timing.dsc_cfg)) {
1643+
stream->timing.flags.DSC = 1;
1644+
DRM_DEBUG_DRIVER("end-to-end bandwidth require dsc and dsc config found\n");
1645+
} else {
1646+
DRM_DEBUG_DRIVER("end-to-end bandwidth require dsc but dsc config not found\n");
1647+
return DC_FAIL_BANDWIDTH_VALIDATE;
17171648
}
17181649
}
1719-
1720-
/*Confirm if we can obtain dsc config*/
1721-
dc_dsc_get_default_config_option(stream->link->dc, &dsc_options);
1722-
dsc_options.max_target_bpp_limit_override_x16 = aconnector->base.display_info.max_dsc_bpp * 16;
1723-
if (dc_dsc_compute_config(stream->sink->ctx->dc->res_pool->dscs[0],
1724-
&stream->sink->dsc_caps.dsc_dec_caps,
1725-
&dsc_options,
1726-
end_to_end_bw_in_kbps,
1727-
&stream->timing,
1728-
dc_link_get_highest_encoding_format(stream->link),
1729-
&stream->timing.dsc_cfg)) {
1730-
stream->timing.flags.DSC = 1;
1731-
DRM_DEBUG_DRIVER("Require dsc and dsc config found\n");
1732-
} else {
1733-
DRM_DEBUG_DRIVER("Require dsc but can't find appropriate dsc config\n");
1650+
} else {
1651+
/* Check if mode could be supported within max slot
1652+
* number of current mst link and full_pbn of mst links.
1653+
*/
1654+
int pbn_div, slot_num, max_slot_num;
1655+
enum dc_link_encoding_format link_encoding;
1656+
uint32_t stream_kbps =
1657+
dc_bandwidth_in_kbps_from_timing(&stream->timing,
1658+
dc_link_get_highest_encoding_format(stream->link));
1659+
1660+
pbn = kbps_to_peak_pbn(stream_kbps);
1661+
pbn_div = dm_mst_get_pbn_divider(stream->link);
1662+
slot_num = DIV_ROUND_UP(pbn, pbn_div);
1663+
1664+
link_encoding = dc_link_get_highest_encoding_format(stream->link);
1665+
if (link_encoding == DC_LINK_ENCODING_DP_8b_10b)
1666+
max_slot_num = 63;
1667+
else if (link_encoding == DC_LINK_ENCODING_DP_128b_132b)
1668+
max_slot_num = 64;
1669+
else {
1670+
DRM_DEBUG_DRIVER("Invalid link encoding format\n");
17341671
return DC_FAIL_BANDWIDTH_VALIDATE;
17351672
}
17361673

1737-
/* check is mst dsc output bandwidth branch_overall_throughput_0_mps */
1738-
switch (stream->timing.pixel_encoding) {
1739-
case PIXEL_ENCODING_RGB:
1740-
case PIXEL_ENCODING_YCBCR444:
1741-
branch_max_throughput_mps =
1742-
aconnector->dc_sink->dsc_caps.dsc_dec_caps.branch_overall_throughput_0_mps;
1743-
break;
1744-
case PIXEL_ENCODING_YCBCR422:
1745-
case PIXEL_ENCODING_YCBCR420:
1746-
branch_max_throughput_mps =
1747-
aconnector->dc_sink->dsc_caps.dsc_dec_caps.branch_overall_throughput_1_mps;
1748-
break;
1749-
default:
1750-
break;
1674+
if (slot_num > max_slot_num ||
1675+
pbn > aconnector->mst_output_port->full_pbn) {
1676+
DRM_DEBUG_DRIVER("Mode can not be supported within mst links!");
1677+
return DC_FAIL_BANDWIDTH_VALIDATE;
17511678
}
1679+
}
17521680

1753-
if (branch_max_throughput_mps != 0 &&
1754-
((stream->timing.pix_clk_100hz / 10) > branch_max_throughput_mps * 1000)) {
1755-
DRM_DEBUG_DRIVER("DSC is required but max throughput mps fails");
1756-
return DC_FAIL_BANDWIDTH_VALIDATE;
1757-
}
1758-
} else {
1759-
DRM_DEBUG_DRIVER("DSC is required but can't find common dsc config.");
1760-
return DC_FAIL_BANDWIDTH_VALIDATE;
1681+
/* check is mst dsc output bandwidth branch_overall_throughput_0_mps */
1682+
switch (stream->timing.pixel_encoding) {
1683+
case PIXEL_ENCODING_RGB:
1684+
case PIXEL_ENCODING_YCBCR444:
1685+
branch_max_throughput_mps =
1686+
aconnector->dc_sink->dsc_caps.dsc_dec_caps.branch_overall_throughput_0_mps;
1687+
break;
1688+
case PIXEL_ENCODING_YCBCR422:
1689+
case PIXEL_ENCODING_YCBCR420:
1690+
branch_max_throughput_mps =
1691+
aconnector->dc_sink->dsc_caps.dsc_dec_caps.branch_overall_throughput_1_mps;
1692+
break;
1693+
default:
1694+
break;
17611695
}
1762-
#endif
1696+
1697+
if (branch_max_throughput_mps != 0 &&
1698+
((stream->timing.pix_clk_100hz / 10) > branch_max_throughput_mps * 1000))
1699+
return DC_FAIL_BANDWIDTH_VALIDATE;
1700+
17631701
return DC_OK;
17641702
}

0 commit comments

Comments
 (0)