Merge tag 'drm-misc-fixes-2025-03-13' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
A null pointer check for gma500, two clippy fixes for panic, a fix for an interaction between DPMS and atomic leading to dropped frames, and a locking fix for dp_mst Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250313-holistic-clay-moose-fead28@houat
This commit is contained in:
@@ -4025,6 +4025,22 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool primary_mstb_probing_is_done(struct drm_dp_mst_topology_mgr *mgr)
|
||||
{
|
||||
bool probing_done = false;
|
||||
|
||||
mutex_lock(&mgr->lock);
|
||||
|
||||
if (mgr->mst_primary && drm_dp_mst_topology_try_get_mstb(mgr->mst_primary)) {
|
||||
probing_done = mgr->mst_primary->link_address_sent;
|
||||
drm_dp_mst_topology_put_mstb(mgr->mst_primary);
|
||||
}
|
||||
|
||||
mutex_unlock(&mgr->lock);
|
||||
|
||||
return probing_done;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
drm_dp_mst_process_up_req(struct drm_dp_mst_topology_mgr *mgr,
|
||||
struct drm_dp_pending_up_req *up_req)
|
||||
@@ -4055,8 +4071,12 @@ drm_dp_mst_process_up_req(struct drm_dp_mst_topology_mgr *mgr,
|
||||
|
||||
/* TODO: Add missing handler for DP_RESOURCE_STATUS_NOTIFY events */
|
||||
if (msg->req_type == DP_CONNECTION_STATUS_NOTIFY) {
|
||||
dowork = drm_dp_mst_handle_conn_stat(mstb, &msg->u.conn_stat);
|
||||
hotplug = true;
|
||||
if (!primary_mstb_probing_is_done(mgr)) {
|
||||
drm_dbg_kms(mgr->dev, "Got CSN before finish topology probing. Skip it.\n");
|
||||
} else {
|
||||
dowork = drm_dp_mst_handle_conn_stat(mstb, &msg->u.conn_stat);
|
||||
hotplug = true;
|
||||
}
|
||||
}
|
||||
|
||||
drm_dp_mst_topology_put_mstb(mstb);
|
||||
@@ -4138,10 +4158,11 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
|
||||
drm_dp_send_up_ack_reply(mgr, mst_primary, up_req->msg.req_type,
|
||||
false);
|
||||
|
||||
drm_dp_mst_topology_put_mstb(mst_primary);
|
||||
|
||||
if (up_req->msg.req_type == DP_CONNECTION_STATUS_NOTIFY) {
|
||||
const struct drm_dp_connection_status_notify *conn_stat =
|
||||
&up_req->msg.u.conn_stat;
|
||||
bool handle_csn;
|
||||
|
||||
drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n",
|
||||
conn_stat->port_number,
|
||||
@@ -4150,16 +4171,6 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
|
||||
conn_stat->message_capability_status,
|
||||
conn_stat->input_port,
|
||||
conn_stat->peer_device_type);
|
||||
|
||||
mutex_lock(&mgr->probe_lock);
|
||||
handle_csn = mst_primary->link_address_sent;
|
||||
mutex_unlock(&mgr->probe_lock);
|
||||
|
||||
if (!handle_csn) {
|
||||
drm_dbg_kms(mgr->dev, "Got CSN before finish topology probing. Skip it.");
|
||||
kfree(up_req);
|
||||
goto out_put_primary;
|
||||
}
|
||||
} else if (up_req->msg.req_type == DP_RESOURCE_STATUS_NOTIFY) {
|
||||
const struct drm_dp_resource_status_notify *res_stat =
|
||||
&up_req->msg.u.resource_stat;
|
||||
@@ -4174,9 +4185,6 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
|
||||
list_add_tail(&up_req->next, &mgr->up_req_list);
|
||||
mutex_unlock(&mgr->up_req_lock);
|
||||
queue_work(system_long_wq, &mgr->up_req_work);
|
||||
|
||||
out_put_primary:
|
||||
drm_dp_mst_topology_put_mstb(mst_primary);
|
||||
out_clear_reply:
|
||||
reset_msg_rx_state(&mgr->up_req_recv);
|
||||
return ret;
|
||||
|
||||
@@ -956,6 +956,10 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
|
||||
|
||||
if (mode != DRM_MODE_DPMS_ON)
|
||||
mode = DRM_MODE_DPMS_OFF;
|
||||
|
||||
if (connector->dpms == mode)
|
||||
goto out;
|
||||
|
||||
connector->dpms = mode;
|
||||
|
||||
crtc = connector->state->crtc;
|
||||
|
||||
@@ -1427,6 +1427,10 @@ EXPORT_SYMBOL(drm_hdmi_connector_get_output_format_name);
|
||||
* callback. For atomic drivers the remapping to the "ACTIVE" property is
|
||||
* implemented in the DRM core.
|
||||
*
|
||||
* On atomic drivers any DPMS setproperty ioctl where the value does not
|
||||
* change is completely skipped, otherwise a full atomic commit will occur.
|
||||
* On legacy drivers the exact behavior is driver specific.
|
||||
*
|
||||
* Note that this property cannot be set through the MODE_ATOMIC ioctl,
|
||||
* userspace must use "ACTIVE" on the CRTC instead.
|
||||
*
|
||||
|
||||
@@ -545,7 +545,7 @@ impl EncodedMsg<'_> {
|
||||
}
|
||||
self.push(&mut offset, (MODE_STOP, 4));
|
||||
|
||||
let pad_offset = (offset + 7) / 8;
|
||||
let pad_offset = offset.div_ceil(8);
|
||||
for i in pad_offset..self.version.max_data() {
|
||||
self.data[i] = PADDING[(i & 1) ^ (pad_offset & 1)];
|
||||
}
|
||||
@@ -659,7 +659,7 @@ struct QrImage<'a> {
|
||||
impl QrImage<'_> {
|
||||
fn new<'a, 'b>(em: &'b EncodedMsg<'b>, qrdata: &'a mut [u8]) -> QrImage<'a> {
|
||||
let width = em.version.width();
|
||||
let stride = (width + 7) / 8;
|
||||
let stride = width.div_ceil(8);
|
||||
let data = qrdata;
|
||||
|
||||
let mut qr_image = QrImage {
|
||||
@@ -911,16 +911,16 @@ impl QrImage<'_> {
|
||||
///
|
||||
/// * `url`: The base URL of the QR code. It will be encoded as Binary segment.
|
||||
/// * `data`: A pointer to the binary data, to be encoded. if URL is NULL, it
|
||||
/// will be encoded as binary segment, otherwise it will be encoded
|
||||
/// efficiently as a numeric segment, and appended to the URL.
|
||||
/// will be encoded as binary segment, otherwise it will be encoded
|
||||
/// efficiently as a numeric segment, and appended to the URL.
|
||||
/// * `data_len`: Length of the data, that needs to be encoded, must be less
|
||||
/// than data_size.
|
||||
/// than data_size.
|
||||
/// * `data_size`: Size of data buffer, it should be at least 4071 bytes to hold
|
||||
/// a V40 QR code. It will then be overwritten with the QR code image.
|
||||
/// a V40 QR code. It will then be overwritten with the QR code image.
|
||||
/// * `tmp`: A temporary buffer that the QR code encoder will use, to write the
|
||||
/// segments and ECC.
|
||||
/// segments and ECC.
|
||||
/// * `tmp_size`: Size of the temporary buffer, it must be at least 3706 bytes
|
||||
/// long for V40.
|
||||
/// long for V40.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
|
||||
@@ -279,6 +279,11 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
|
||||
0, PCI_DEVFN(2, 0));
|
||||
int ret = -1;
|
||||
|
||||
if (pci_gfx_root == NULL) {
|
||||
WARN_ON(1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the address of the platform config vbt */
|
||||
pci_read_config_dword(pci_gfx_root, 0xFC, &addr);
|
||||
pci_dev_put(pci_gfx_root);
|
||||
|
||||
Reference in New Issue
Block a user