From patchwork Tue Jan 31 15:05:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41652C38142 for ; Tue, 31 Jan 2023 15:05:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B7BA10E370; Tue, 31 Jan 2023 15:05:57 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id E123B10E36D; Tue, 31 Jan 2023 15:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177555; x=1706713555; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lS2v+SM4atbC/jWiaGmWZRAqi0GtjwWzmnZnhapusQE=; b=fcmlo/TogOQmUa2BSRymHRBxL4mDnmdYJs/+6w+/v7DWLGferBUg4SNe JLeLSJQ0CFayOu6ApnvuDTgsu2xsUAiJdIvQ3KKvitMUHO3HgGrnwqe5V aRCwpnTz0bGk6bf7de4+NkI6sEHWfWXVeNDZaUNglB4CWtRNK+7Y6UqNi rQnXkzJ6w23oQgAIPzQ3iH+srAMwBUwgm/HQ2LFeTH49pkG2xZseUKDbG Vqx9G/s+Wi9yZ4ZaXzsxMkTbzkLCkpBDWlweB6ppihTepymlYuBXCpd9k 2uVH73v7//Cu+5Kkek8CfetNsR1uMAlle5JMESuAhA0qETaX64Clqo7Ti w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205508" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205508" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:05:55 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155289" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155289" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:05:53 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 02/17] drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload() Date: Tue, 31 Jan 2023 17:05:33 +0200 Message-Id: <20230131150548.1614458-3-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Karol Herbst , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Ben Skeggs , Wayne Lin , Alex Deucher Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Atm, drm_dp_remove_payload() uses the same payload state to both get the vc_start_slot required for the payload removal DPCD message and to deduct time_slots from vc_start_slot of all payloads after the one being removed. The above isn't always correct, as vc_start_slot must be the up-to-date version contained in the new payload state, but time_slots must be the one used when the payload was previously added, contained in the old payload state. The new payload's time_slots can change vs. the old one if the current atomic commit changes the corresponding mode. This patch let's drivers pass the old and new payload states to drm_dp_remove_payload(), but keeps these the same for now in all drivers not to change the behavior. A follow-up i915 patch will pass in that driver the correct old and new states to the function. Cc: Lyude Paul Cc: Ville Syrjälä Cc: Ben Skeggs Cc: Karol Herbst Cc: Harry Wentland Cc: Alex Deucher Cc: Wayne Lin Cc: stable@vger.kernel.org # 6.1 Cc: dri-devel@lists.freedesktop.org Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Lyude Paul --- .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- drivers/gpu/drm/display/drm_dp_mst_topology.c | 26 ++++++++++--------- drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 ++- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- include/drm/display/drm_dp_mst_helper.h | 3 ++- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index a50319fc42b11..180d3893b68da 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -208,7 +208,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table( if (enable) drm_dp_add_payload_part1(mst_mgr, mst_state, payload); else - drm_dp_remove_payload(mst_mgr, mst_state, payload); + drm_dp_remove_payload(mst_mgr, mst_state, payload, payload); /* mst_mgr->->payloads are VC payload notify MST branch using DPCD or * AUX message. The sequence is slot 1-63 allocated sequence for each diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 847c10aa2098c..1990ff5dc7ddd 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3342,7 +3342,8 @@ EXPORT_SYMBOL(drm_dp_add_payload_part1); * drm_dp_remove_payload() - Remove an MST payload * @mgr: Manager to use. * @mst_state: The MST atomic state - * @payload: The payload to write + * @old_payload: The payload with its old state + * @new_payload: The payload to write * * Removes a payload from an MST topology if it was successfully assigned a start slot. Also updates * the starting time slots of all other payloads which would have been shifted towards the start of @@ -3350,36 +3351,37 @@ EXPORT_SYMBOL(drm_dp_add_payload_part1); */ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, - struct drm_dp_mst_atomic_payload *payload) + const struct drm_dp_mst_atomic_payload *old_payload, + struct drm_dp_mst_atomic_payload *new_payload) { struct drm_dp_mst_atomic_payload *pos; bool send_remove = false; /* We failed to make the payload, so nothing to do */ - if (payload->vc_start_slot == -1) + if (new_payload->vc_start_slot == -1) return; mutex_lock(&mgr->lock); - send_remove = drm_dp_mst_port_downstream_of_branch(payload->port, mgr->mst_primary); + send_remove = drm_dp_mst_port_downstream_of_branch(new_payload->port, mgr->mst_primary); mutex_unlock(&mgr->lock); if (send_remove) - drm_dp_destroy_payload_step1(mgr, mst_state, payload); + drm_dp_destroy_payload_step1(mgr, mst_state, new_payload); else drm_dbg_kms(mgr->dev, "Payload for VCPI %d not in topology, not sending remove\n", - payload->vcpi); + new_payload->vcpi); list_for_each_entry(pos, &mst_state->payloads, next) { - if (pos != payload && pos->vc_start_slot > payload->vc_start_slot) - pos->vc_start_slot -= payload->time_slots; + if (pos != new_payload && pos->vc_start_slot > new_payload->vc_start_slot) + pos->vc_start_slot -= old_payload->time_slots; } - payload->vc_start_slot = -1; + new_payload->vc_start_slot = -1; mgr->payload_count--; - mgr->next_start_slot -= payload->time_slots; + mgr->next_start_slot -= old_payload->time_slots; - if (payload->delete) - drm_dp_mst_put_port_malloc(payload->port); + if (new_payload->delete) + drm_dp_mst_put_port_malloc(new_payload->port); } EXPORT_SYMBOL(drm_dp_remove_payload); diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index f3cb12dcfe0a7..dc4e5ff1dbb31 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -526,6 +526,8 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state, to_intel_connector(old_conn_state->connector); struct drm_dp_mst_topology_state *mst_state = drm_atomic_get_mst_topology_state(&state->base, &intel_dp->mst_mgr); + struct drm_dp_mst_atomic_payload *payload = + drm_atomic_get_mst_payload_state(mst_state, connector->port); struct drm_i915_private *i915 = to_i915(connector->base.dev); drm_dbg_kms(&i915->drm, "active links %d\n", @@ -534,7 +536,7 @@ static void intel_mst_disable_dp(struct intel_atomic_state *state, intel_hdcp_disable(intel_mst->connector); drm_dp_remove_payload(&intel_dp->mst_mgr, mst_state, - drm_atomic_get_mst_payload_state(mst_state, connector->port)); + payload, payload); intel_audio_codec_disable(encoder, old_crtc_state, old_conn_state); } diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index edcb2529b4025..ed9d374147b8d 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -885,7 +885,7 @@ nv50_msto_prepare(struct drm_atomic_state *state, // TODO: Figure out if we want to do a better job of handling VCPI allocation failures here? if (msto->disabled) { - drm_dp_remove_payload(mgr, mst_state, payload); + drm_dp_remove_payload(mgr, mst_state, payload, payload); nvif_outp_dp_mst_vcpi(&mstm->outp->outp, msto->head->base.index, 0, 0, 0, 0); } else { diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index 41fd8352ab656..f5eb9aa152b14 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -841,7 +841,8 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_atomic_payload *payload); void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, - struct drm_dp_mst_atomic_payload *payload); + const struct drm_dp_mst_atomic_payload *old_payload, + struct drm_dp_mst_atomic_payload *new_payload); int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr); From patchwork Tue Jan 31 15:05:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7EA1C636D3 for ; Tue, 31 Jan 2023 15:06:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83DD210E372; Tue, 31 Jan 2023 15:06:00 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id A53B610E372; Tue, 31 Jan 2023 15:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177557; x=1706713557; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j8Y2LV0W5VcgqRvSCj3NHM2NvF5FUThc1MCS7fVqAcM=; b=UV14SDAPdEXG7eq9Y33GR8th//hgHoMIHI4OQ89B74iU0DJYgMfYleUC iNQjOrID9nF7By8ywvOegDyMpv8OqKHKh0Q8vU7+yIiI6rA0wSgt5iTrm LYdEj/C/NWb6iHIqjw3MFDWeyz0xGolVkAYY8Yx0DUSrnKtEqUJ4rJk17 vJ+dWozKKpQifl6y1JkSjyT21BeFvvrBbk2yG9AKcViQDOUOik1V12X0d tsLNRpCWMZ+5vcxtbdQtBN7Rehrgj/ETwAy5rYAmXikVjmURPC2LOMnqj zKW9OcpAverRc+v48zv2UurVIuqO26lp7RsozweRHvJg1qFoXY1joclkQ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205517" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205517" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:05:57 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155293" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155293" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:05:55 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 03/17] drm/display/dp_mst: Add drm_atomic_get_old_mst_topology_state() Date: Tue, 31 Jan 2023 17:05:34 +0200 Message-Id: <20230131150548.1614458-4-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, stable@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a function to get the old MST topology state, required by a follow-up i915 patch. While at it clarify the code comment of drm_atomic_get_new_mst_topology_state() and add _new prefix to the new state pointer to remind about its difference from the old state. v2: Use old_/new_ prefixes for the state pointers. (Ville) Cc: Lyude Paul Cc: Ville Syrjälä Cc: stable@vger.kernel.org # 6.1 Cc: dri-devel@lists.freedesktop.org Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 33 ++++++++++++++++--- include/drm/display/drm_dp_mst_helper.h | 3 ++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 1990ff5dc7ddd..38dab76ae69ea 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -5364,28 +5364,53 @@ struct drm_dp_mst_topology_state *drm_atomic_get_mst_topology_state(struct drm_a } EXPORT_SYMBOL(drm_atomic_get_mst_topology_state); +/** + * drm_atomic_get_old_mst_topology_state: get old MST topology state in atomic state, if any + * @state: global atomic state + * @mgr: MST topology manager, also the private object in this case + * + * This function wraps drm_atomic_get_old_private_obj_state() passing in the MST atomic + * state vtable so that the private object state returned is that of a MST + * topology object. + * + * Returns: + * + * The old MST topology state, or NULL if there's no topology state for this MST mgr + * in the global atomic state + */ +struct drm_dp_mst_topology_state * +drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state, + struct drm_dp_mst_topology_mgr *mgr) +{ + struct drm_private_state *old_priv_state = + drm_atomic_get_old_private_obj_state(state, &mgr->base); + + return old_priv_state ? to_dp_mst_topology_state(old_priv_state) : NULL; +} +EXPORT_SYMBOL(drm_atomic_get_old_mst_topology_state); + /** * drm_atomic_get_new_mst_topology_state: get new MST topology state in atomic state, if any * @state: global atomic state * @mgr: MST topology manager, also the private object in this case * - * This function wraps drm_atomic_get_priv_obj_state() passing in the MST atomic + * This function wraps drm_atomic_get_new_private_obj_state() passing in the MST atomic * state vtable so that the private object state returned is that of a MST * topology object. * * Returns: * - * The MST topology state, or NULL if there's no topology state for this MST mgr + * The new MST topology state, or NULL if there's no topology state for this MST mgr * in the global atomic state */ struct drm_dp_mst_topology_state * drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr) { - struct drm_private_state *priv_state = + struct drm_private_state *new_priv_state = drm_atomic_get_new_private_obj_state(state, &mgr->base); - return priv_state ? to_dp_mst_topology_state(priv_state) : NULL; + return new_priv_state ? to_dp_mst_topology_state(new_priv_state) : NULL; } EXPORT_SYMBOL(drm_atomic_get_new_mst_topology_state); diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index f5eb9aa152b14..32c764fb9cb56 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -868,6 +868,9 @@ struct drm_dp_mst_topology_state * drm_atomic_get_mst_topology_state(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr); struct drm_dp_mst_topology_state * +drm_atomic_get_old_mst_topology_state(struct drm_atomic_state *state, + struct drm_dp_mst_topology_mgr *mgr); +struct drm_dp_mst_topology_state * drm_atomic_get_new_mst_topology_state(struct drm_atomic_state *state, struct drm_dp_mst_topology_mgr *mgr); struct drm_dp_mst_atomic_payload * From patchwork Tue Jan 31 15:05:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C196C636CC for ; Tue, 31 Jan 2023 15:06:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 111A710E37E; Tue, 31 Jan 2023 15:06:08 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id B2AB210E377; Tue, 31 Jan 2023 15:06:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177560; x=1706713560; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9iONsZSO0H/piflOxLEnjnkoS6M6phYKofNGQ7BlAR4=; b=BUFSpkysHIEYLb6NHpYxhUprQ68ohvtCygZT9vNNsB7ff4h8aT1Iyv/g 3FOegxKftcM15dcuLm2OO0BIkj0WFbnVXJV0hVQjXu8c79LpwfwmQ27pO BCn6Eo7OM11ZxeLUk0PVP7uOs5i9sXnbxbuB9/o0erR1j5XNNOoZr+k5s Pmc8zwAShYlrE2ZiXg+ovRaBX7yBZkkj9GSYqsnYBBeah0bAUmLZhIXL/ AMYV+nWZ6slMBYoMgxw4nTGy8LJGRAZ3hP+RQ564e2l9rpgT3kq1rBDnY v0XdGAbWOvMfVgaDiuL+zry/FyJqmqhE93IQ5Hz1QHxRJHi+KH2G1gQlP A==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205536" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205536" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:00 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155296" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155296" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:05:59 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 05/17] drm/display/dp_mst: Fix the payload VCPI check in drm_dp_mst_dump_topology() Date: Tue, 31 Jan 2023 17:05:36 +0200 Message-Id: <20230131150548.1614458-6-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix an off-by-one error in the VCPI check in drm_dp_mst_dump_topology(). Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 38dab76ae69ea..8787df19f428b 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -4772,7 +4772,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m, list_for_each_entry(payload, &state->payloads, next) { char name[14]; - if (payload->vcpi != i || payload->delete) + if (payload->vcpi != i + 1 || payload->delete) continue; fetch_monitor_name(mgr, payload->port, name, sizeof(name)); From patchwork Tue Jan 31 15:05:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90001C38142 for ; Tue, 31 Jan 2023 15:06:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D20AD10E37B; Tue, 31 Jan 2023 15:06:08 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 588C410E37D; Tue, 31 Jan 2023 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177566; x=1706713566; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CzXPR9fbOjvOWoNDZCxlnpK9nAspI8MHULRhV517lHQ=; b=QQsXDwY5JjBiDVSr8HNtybnoTaUxYQIdR/NPGdMk1qkF763E/Id3njX6 XIWecCyO2BKv+D7Vnx7a3343X5q4usiPTMRG6ivAPPRiFdBGJqAQxxvuL qjyPHgRVFr/dbPODNeydjuqRgPJ29vbo7XqzNLbQocdz9zlVJ1hg18Xit u9OUacZI78CwEfndYXipuKFjmO16ZQX1cb3iM1vBcgBGD6W4/FA4Pt0kI b9A7+SBNK10TSmnGlzwR2wV6DyRCp8gqEjFW0TFmrRgnf9mDze2UHZiyW TPriXMRq2N7EyYDq6lDjpBiEnKCTZyL9EF8q3p03X43MH394cM0NHqRsu Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205566" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205566" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155322" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155322" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:04 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 09/17] drm/display/dp_mst: Add a helper to verify the MST payload state Date: Tue, 31 Jan 2023 17:05:40 +0200 Message-Id: <20230131150548.1614458-10-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a function drivers can use to verify the MST payload state tracking and compare this to the sink's payload table. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 169 ++++++++++++++++++ include/drm/display/drm_dp.h | 3 + include/drm/display/drm_dp_mst_helper.h | 3 + 3 files changed, 175 insertions(+) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 0c04b96ae614c..e57dd16955d52 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -4847,6 +4847,175 @@ void drm_dp_mst_dump_topology(struct seq_file *m, } EXPORT_SYMBOL(drm_dp_mst_dump_topology); +static bool verify_mst_payload_state(struct drm_dp_mst_topology_state *mst_state) +{ + struct drm_dp_mst_topology_mgr *mgr = mst_state->mgr; + struct drm_dp_mst_atomic_payload *payload; + int payload_count = 0; + u64 time_slot_mask = 0; + u32 vcpi_mask = 0; + int last_set; + + if (BITS_PER_TYPE(time_slot_mask) < mst_state->total_avail_slots) + return false; + + list_for_each_entry(payload, &mst_state->payloads, next) { + u64 mask; + + if (payload->vc_start_slot == -1) + continue; + + if (!payload->time_slots) + return false; + + if (payload->vc_start_slot < mst_state->start_slot) + return false; + + if (payload->vc_start_slot + payload->time_slots - mst_state->start_slot > + mst_state->total_avail_slots) + return false; + + mask = GENMASK_ULL(payload->vc_start_slot + payload->time_slots - 1, + payload->vc_start_slot); + + if (time_slot_mask & mask) + return false; + + time_slot_mask |= mask; + + if (payload->vcpi < 1 || + payload->vcpi & ~DP_PAYLOAD_ID_MASK || + payload->vcpi > BITS_PER_TYPE(vcpi_mask)) + return false; + if (BIT(payload->vcpi - 1) & vcpi_mask) + return false; + vcpi_mask |= BIT(payload->vcpi - 1); + + payload_count++; + } + + if (payload_count != mgr->payload_count) + return false; + + last_set = fls64(time_slot_mask); + + if (last_set && + GENMASK_ULL(last_set - 1, mst_state->start_slot) != time_slot_mask) + return false; + + if (max(mst_state->start_slot, mgr->next_start_slot) != + max_t(int, mst_state->start_slot, last_set)) + return false; + + return true; +} + +static int get_payload_table_vcpi(const u8 *table, int slot) +{ + if (slot == 0) + return FIELD_GET(DP_PAYLOAD_ID_SLOT0_5_0_MASK, table[0]) | + (FIELD_GET(DP_PAYLOAD_ID_SLOT0_6, table[1]) << 6); + else + return FIELD_GET(DP_PAYLOAD_ID_MASK, table[slot]); +} + +static bool verify_mst_payload_table(struct drm_dp_mst_topology_state *mst_state, + const u8 *payload_table) +{ + struct drm_dp_mst_topology_mgr *mgr = mst_state->mgr; + struct drm_dp_mst_atomic_payload *payload; + int i; + + list_for_each_entry(payload, &mst_state->payloads, next) { + if (payload->vc_start_slot == -1) + continue; + + if (payload->vc_start_slot + payload->time_slots > DP_PAYLOAD_TABLE_SIZE) + return false; + + for (i = 0; i < payload->time_slots; i++) + if (get_payload_table_vcpi(payload_table, + payload->vc_start_slot + i) != payload->vcpi) + return false; + } + + for (i = max(mgr->next_start_slot, mst_state->start_slot); + i < DP_PAYLOAD_TABLE_SIZE; + i++) { + if (get_payload_table_vcpi(payload_table, i) != 0) + return false; + } + + return true; +} + +static void print_mst_payload_state(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_topology_state *mst_state, + const u8 *payload_table) +{ + struct drm_dp_mst_atomic_payload *payload; + int i = 0; + + drm_dbg(mgr->dev, + "Payload state: start_slot %d total_avail_slots %d next_start_slot %d payload_count %d\n", + mst_state->start_slot, mst_state->total_avail_slots, + mgr->next_start_slot, mgr->payload_count); + + list_for_each_entry(payload, &mst_state->payloads, next) { + drm_dbg(mgr->dev, + " Payload#%d: port %p VCPI %d delete %d vc_start_slot %d time_slots %d\n", + i, payload->port, payload->vcpi, + payload->delete, payload->vc_start_slot, payload->time_slots); + i++; + } + + if (!payload_table) + return; + + drm_dbg(mgr->dev, "Payload table:\n"); + print_hex_dump(KERN_DEBUG, " Ptbl ", + DUMP_PREFIX_OFFSET, 16, 1, + payload_table, DP_PAYLOAD_TABLE_SIZE, false); +} + +/** + * drm_dp_mst_verify_payload_state - Verify the atomic state for payloads and the related sink payload table + * @state: atomic state + * @mgr: manager to verify the state for + * @verify_sink: %true if the sink payload table needs to be verified as well + * + * Verify @mgr's atomic state tracking all its payloads and optionally the + * related sink payload table. + */ +void drm_dp_mst_verify_payload_state(struct drm_atomic_state *state, + struct drm_dp_mst_topology_mgr *mgr, + bool verify_sink) +{ + struct drm_dp_mst_topology_state *mst_state; + u8 payload_table[DP_PAYLOAD_TABLE_SIZE]; + + mst_state = drm_atomic_get_new_mst_topology_state(state, mgr); + if (drm_WARN_ON(mgr->dev, !mst_state)) + return; + + if (drm_WARN_ON(mgr->dev, !verify_mst_payload_state(mst_state))) { + print_mst_payload_state(mgr, mst_state, NULL); + return; + } + + if (!verify_sink) + return; + + if (!dump_dp_payload_table(mgr, payload_table)) + return; + + if (!verify_mst_payload_table(mst_state, payload_table)) { + drm_err(mgr->dev, "MST payload state mismatches payload table\n"); + print_mst_payload_state(mgr, mst_state, payload_table); + } +} +EXPORT_SYMBOL(drm_dp_mst_verify_payload_state); + static void drm_dp_tx_work(struct work_struct *work) { struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work); diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index 632376c291db6..bcc5183188a68 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -925,9 +925,12 @@ #define DP_PAYLOAD_TABLE_UPDATE_STATUS 0x2c0 /* 1.2 MST */ # define DP_PAYLOAD_TABLE_UPDATED (1 << 0) # define DP_PAYLOAD_ACT_HANDLED (1 << 1) +# define DP_PAYLOAD_ID_SLOT0_5_0_MASK (0x3f << 2) #define DP_VC_PAYLOAD_ID_SLOT_1 0x2c1 /* 1.2 MST */ /* up to ID_SLOT_63 at 0x2ff */ +# define DP_PAYLOAD_ID_SLOT0_6 (1 << 7) +# define DP_PAYLOAD_ID_MASK 0x7f /* Source Device-specific */ #define DP_SOURCE_OUI 0x300 diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index 32c764fb9cb56..44c6710ebf315 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -848,6 +848,9 @@ int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr); void drm_dp_mst_dump_topology(struct seq_file *m, struct drm_dp_mst_topology_mgr *mgr); +void drm_dp_mst_verify_payload_state(struct drm_atomic_state *state, + struct drm_dp_mst_topology_mgr *mgr, + bool verify_sink); void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr); int __must_check From patchwork Tue Jan 31 15:05:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 529A2C38142 for ; Tue, 31 Jan 2023 15:06:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 69B8B10E387; Tue, 31 Jan 2023 15:06:25 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F75210E380; Tue, 31 Jan 2023 15:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177569; x=1706713569; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xb02vIQIgXwqReykZnFavPw9RCMa3+WLedoxNY6Xnwk=; b=h5NOeGxsH5OqWwquaBp0yrBBQdrSVJ/Ro4SG9uCOA2XX/VTAo0bYIudk Bha7w2v5H6zuMj/N1a6pDdP5oe7Ga+t4KO82uuEUE2TgdqpatRAv7Y5pm Agyt7MA5biKMEG9Qk+LoUbCzAGLPDqVOmphxYw29agCgT8gLSY72VYSgY HVZMzMbiUmK0HC86rMfRFd6QlH8Loersn5zt67YEfBC4SxefxyFVNbEvG aotAn+kRJfUkiQj9Hwx4D/Nss5YhiCwf1sK5HX3hX5Kh+pduAh25mTqSj I5rmcn6T6JhO6tdUSUSYrMkir0tlobRKzyTjZW/47ECbsZyJcpXUjt4nZ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205582" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205582" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:09 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155335" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155335" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:07 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 11/17] drm/display/dp_mst: Add helpers to query for payload allocation errors Date: Tue, 31 Jan 2023 17:05:42 +0200 Message-Id: <20230131150548.1614458-12-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a way for drivers to query if allocating time slots for any payloads in a given MST topology failed. This is needed by a follow-up i915 patch verifying the SW vs. HW state of the MST topology. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 35 ++++++++++++++++--- include/drm/display/drm_dp_mst_helper.h | 3 ++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index e57dd16955d52..f2081f3fad0da 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3306,15 +3306,14 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_atomic_payload *payload) { struct drm_dp_mst_port *port; - int ret; + int ret = 0; port = drm_dp_mst_topology_get_port_validated(mgr, payload->port); if (!port) { drm_dbg_kms(mgr->dev, "VCPI %d for port %p not in topology, not creating a payload\n", payload->vcpi, payload->port); - payload->vc_start_slot = -1; - return 0; + goto alloc_fail; } if (mgr->payload_count == 0) @@ -3327,14 +3326,21 @@ int drm_dp_add_payload_part1(struct drm_dp_mst_topology_mgr *mgr, if (ret < 0) { drm_warn(mgr->dev, "Failed to create MST payload for port %p: %d\n", payload->port, ret); - payload->vc_start_slot = -1; - return ret; + goto alloc_fail; } + payload->alloc_failed = false; + mgr->payload_count++; mgr->next_start_slot += payload->time_slots; return 0; + +alloc_fail: + payload->vc_start_slot = -1; + payload->alloc_failed = true; + + return ret; } EXPORT_SYMBOL(drm_dp_add_payload_part1); @@ -3423,6 +3429,25 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, } EXPORT_SYMBOL(drm_dp_add_payload_part2); +/** + * drm_dp_mst_has_payload_alloc_errors - Query for payload allocation errors + * @mst_state: The MST atomic state + * + * Returns %true if the allocation of any of the payloads in @mst_state + * failed, %false otherwise. + */ +bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state *mst_state) +{ + struct drm_dp_mst_atomic_payload *pos; + + list_for_each_entry(pos, &mst_state->payloads, next) + if (pos->alloc_failed) + return true; + + return false; +} +EXPORT_SYMBOL(drm_dp_mst_has_payload_alloc_errors); + static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes) diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index 44c6710ebf315..53b251b264e89 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -568,6 +568,8 @@ struct drm_dp_mst_atomic_payload { bool delete : 1; /** @dsc_enabled: Whether or not this payload has DSC enabled */ bool dsc_enabled : 1; + /** @alloc_failed: Whether or not allocating this payload failed */ + bool alloc_failed : 1; /** @next: The list node for this payload */ struct list_head next; @@ -843,6 +845,7 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, const struct drm_dp_mst_atomic_payload *old_payload, struct drm_dp_mst_atomic_payload *new_payload); +bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state *mst_state); int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr); From patchwork Tue Jan 31 15:05:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3CE8C38142 for ; Tue, 31 Jan 2023 15:06:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 942DD10E381; Tue, 31 Jan 2023 15:06:14 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id C70B010E37A; Tue, 31 Jan 2023 15:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177570; x=1706713570; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=70ncopoHGtYk9Twq8aYixnl0XY6kiVdLrV0O6I9A4KQ=; b=dvh1S4URalQnzs2c6/Hz32P7hYjRUiJELf5hOwBRxkLmHBYurwGrxk9R YtVn+fRsqykxuUDi2NVSc4MncCS63BFd7xJFVTeWBkTOrd/qkWAbaGNVa eGhKwSOpg0tFO4dPtcgoSvDnBG9Hfs8JA3Dan/hAZ7CnqcUFRfqbB1BiF SeDTXbuF2eiCOvuExBm80GP0JlmaLvE+CXzECBuVe0QIHHZgL5cQZNN3o qnECk1PEz16sVcbrlbp++qrymPLRCosc3dIiNc5hxULUOKfq69qYPQnva VmldJx4+0vtXVF4BN92Jtp1qrWSQi4EXDtHrpOX5PuG53bJW6IZBrsQZG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205590" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205590" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:10 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155340" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155340" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:09 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 12/17] drm/display/dp_mst: Add helpers to query payload allocation properties Date: Tue, 31 Jan 2023 17:05:43 +0200 Message-Id: <20230131150548.1614458-13-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add helper functions to query the virtual channel and time slots for a payload and the current payload count and total allocated time slots in an MST topology. These are needed by a follow-up i915 patch verifying the SW vs. HW state of the MST topology. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 36 +++++++++++++++++++ include/drm/display/drm_dp_mst_helper.h | 21 +++++++++++ 2 files changed, 57 insertions(+) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index f2081f3fad0da..47605f67578ad 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3448,6 +3448,42 @@ bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state } EXPORT_SYMBOL(drm_dp_mst_has_payload_alloc_errors); +/** + * drm_dp_mst_payload_vchannel - Return the DP virtual channel for a payload + * @mst_state: The MST atomic state containing @payload + * @payload: The payload to get the virtual channel for + * + * Return the DP virtual channel for @payload. The virtual channel is a + * contiguous range of MST Transmission Units on the DP main lanes between + * the source DPTX and the first downstream MST hub DPRX. Accordingly the + * channel is determined by the payload's position on the payload list + * ordered by VC start slot. + * + * Returns the 0-based virtual channel of @payload if it's in @mst_state with + * its time slots being allocated, or -1 otherwise. + */ +int drm_dp_mst_payload_vchannel(const struct drm_dp_mst_topology_state *mst_state, + const struct drm_dp_mst_atomic_payload *payload) +{ + struct drm_dp_mst_atomic_payload *pos; + int vc = 0; + bool found = false; + + list_for_each_entry(pos, &mst_state->payloads, next) { + if (pos->vc_start_slot == -1) + continue; + + if (pos == payload) + found = true; + + if (pos->vc_start_slot < payload->vc_start_slot) + vc++; + } + + return found ? vc : -1; +} +EXPORT_SYMBOL(drm_dp_mst_payload_vchannel); + static int drm_dp_send_dpcd_read(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int offset, int size, u8 *bytes) diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index 53b251b264e89..bb7c595096fed 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -846,6 +846,27 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, const struct drm_dp_mst_atomic_payload *old_payload, struct drm_dp_mst_atomic_payload *new_payload); bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state *mst_state); +int drm_dp_mst_payload_vchannel(const struct drm_dp_mst_topology_state *mst_state, + const struct drm_dp_mst_atomic_payload *payload); + +static inline int +drm_dp_mst_payload_count(const struct drm_dp_mst_topology_state *mst_state) +{ + return mst_state->mgr->payload_count; +} + +static inline int +drm_dp_mst_allocated_time_slots(const struct drm_dp_mst_topology_state *mst_state) +{ + return drm_dp_mst_payload_count(mst_state) ? + mst_state->mgr->next_start_slot - mst_state->start_slot : 0; +} + +static inline int +drm_dp_mst_payload_time_slots(const struct drm_dp_mst_atomic_payload *payload) +{ + return payload->time_slots; +} int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr); From patchwork Tue Jan 31 15:05:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123102 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D1B8C38142 for ; Tue, 31 Jan 2023 15:06:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A45610E37F; Tue, 31 Jan 2023 15:06:23 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56B0B10E37A; Tue, 31 Jan 2023 15:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177572; x=1706713572; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vHDge1yJK6lq3uXa5xb4BTQ1eopWsqz1tJIA+5zdtnM=; b=SRxBw8G7hHux6311b0onKo/uckEWs+VHQWvO4jkgBZcjVclIkhme0QMC e1c6vYNePzVyw1tUNxhzLIgOe/TSwJ7FXQQLMplGPErMqYExZeZSM/5wY BTuxP04eiv33bIPa2cBdjzS4mLzwn2D42VLUxy6/5AVpjmgzYk7dNPaeQ 3jrLXqfi80wnpgAvpODa2tPVzUbTZiP9dhFzeNY40CDlqvPTR5CD+/GIs OcyvJOUZJdDQryuORTdcA4xH1NgdxerPeiCr/WuT7tzwvzDCwnnJU11rn etDcSsftaMbeQiI2/4CK/xklbcobDuGTBvwFXpIWpYs21mpkHuOiYQ6iz w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205606" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205606" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:12 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155347" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155347" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:10 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 13/17] drm/display/dp_mst: Export the DP_PAYLOAD_TABLE_SIZE definition Date: Tue, 31 Jan 2023 17:05:44 +0200 Message-Id: <20230131150548.1614458-14-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In a follow-up workaround for a payload allocation problem the driver uses DP_PAYLOAD_TABLE_SIZE to determine when the workaround is needed, so export the definition. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 -- include/drm/display/drm_dp.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index 47605f67578ad..d0e929df7d088 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -4771,8 +4771,6 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m, } } -#define DP_PAYLOAD_TABLE_SIZE 64 - static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, char *buf) { diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index bcc5183188a68..8f18f66ff5bc3 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -932,6 +932,8 @@ # define DP_PAYLOAD_ID_SLOT0_6 (1 << 7) # define DP_PAYLOAD_ID_MASK 0x7f +#define DP_PAYLOAD_TABLE_SIZE 64 + /* Source Device-specific */ #define DP_SOURCE_OUI 0x300 From patchwork Tue Jan 31 15:05:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B2B8C38142 for ; Tue, 31 Jan 2023 15:06:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB53210E388; Tue, 31 Jan 2023 15:06:32 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F7F710E37F; Tue, 31 Jan 2023 15:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177579; x=1706713579; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sZeVA43J+5CB7NymmI6VapcJXfv3PPqLCgFFUfxb6ZQ=; b=WR6SBzjMvD4M2udHciP4FJ6HDaJ3IPpaB2A5OIsH8beVd0tstfGbmKKf F4PUrLuo35T8Pq7u4jvxXso9wrhPgJ8qitOwyD4OnZjMuw448CBPUnhHN OQ+eiZOGRR1SqhKorARIPjzUG6zYKAoaC8Z36jfqzje9CZM/kcKWX8vWX QMz59atxdyNM0zHePn/i6kFXskrZXpRqSUBxCpIBmyBajbnqb15rhwawX 3M2a6wKF7L4wtUHDF078bhPz0/FoO4l8m+nR+QOg9gzFJISi4BGBx6G+e VN1+4BqoxY6MwMmrFhjWJCjbo+RdFWXzpRdp/vEOqVBYoM0gV12osKsiJ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205632" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205632" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155348" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155348" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:12 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 14/17] drm/display/dp_mst: Factor out a helper to reset the payload table Date: Tue, 31 Jan 2023 17:05:45 +0200 Message-Id: <20230131150548.1614458-15-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A follow-up patch adds a workaround for a payload allocation problem in a DELL monitor. For this the driver needs to reset the payload table in the monitor's MST hub, factor out a helper to do this. While at it use DP_PAYLOAD_TABLE_SIZE in the reset command, instead of open coding it. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 8 +++++++- include/drm/display/drm_dp_mst_helper.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index d0e929df7d088..eb170389cf9bc 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3429,6 +3429,12 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, } EXPORT_SYMBOL(drm_dp_add_payload_part2); +int drm_dp_mst_reset_payload_table(struct drm_dp_mst_topology_mgr *mgr) +{ + return drm_dp_dpcd_write_payload(mgr, 0, 0, DP_PAYLOAD_TABLE_SIZE - 1); +} +EXPORT_SYMBOL(drm_dp_mst_reset_payload_table); + /** * drm_dp_mst_has_payload_alloc_errors - Query for payload allocation errors * @mst_state: The MST atomic state @@ -3699,7 +3705,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms goto out_unlock; /* Write reset payload */ - drm_dp_dpcd_write_payload(mgr, 0, 0, 0x3f); + drm_dp_mst_reset_payload_table(mgr); queue_work(system_long_wq, &mgr->work); diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index bb7c595096fed..2d15399df2950 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -845,6 +845,7 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, const struct drm_dp_mst_atomic_payload *old_payload, struct drm_dp_mst_atomic_payload *new_payload); +int drm_dp_mst_reset_payload_table(struct drm_dp_mst_topology_mgr *mgr); bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state *mst_state); int drm_dp_mst_payload_vchannel(const struct drm_dp_mst_topology_state *mst_state, const struct drm_dp_mst_atomic_payload *payload); From patchwork Tue Jan 31 15:05:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 13123103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FD44C636CC for ; Tue, 31 Jan 2023 15:06:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C478610E384; Tue, 31 Jan 2023 15:06:24 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB3BC10E387; Tue, 31 Jan 2023 15:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675177579; x=1706713579; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RbhmnjYzjP8lLP96u1p49FbiVsEues3mWvBt3I/H+m0=; b=jh8ffzvQnha+h82qLwGA7PWhzsRk9HWknxv7fK9Bj/wUqVwzvrR8TTKb 7PTGZOGCev7NIVYUZh8E8mmGT5re6XIrqeiNuZ2dNLU0TSbmGVVhv/7x4 xwpLX5Thzt59jF2/gduD8ZnOiWG8/nf4MyQmJaon+hU/u5DU86VeftMkT 4Avvbc1DeCW96kJTivOFEkDUXaeiqdPV+Hl4UI7jN/rBoPvO5IFvq9YMO fYVV9VOO6zlWBTWHBl9OMfFC8RwaUY3yNDsGk5sArAUcAATU7Vk01fNCQ rsci/SnsXWgWf9AZF7mNIilQ3oWK06dsjAVGs2WvzbVS/KRvXxHfBz7rv w==; X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="308205639" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="308205639" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:19 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10606"; a="807155353" X-IronPort-AV: E=Sophos;i="5.97,261,1669104000"; d="scan'208";a="807155353" Received: from ideak-desk.fi.intel.com ([10.237.72.58]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 07:06:14 -0800 From: Imre Deak To: intel-gfx@lists.freedesktop.org Subject: [PATCH v2 15/17] drm/dp: Add a quirk for a DELL P2715Q MST payload allocation problem Date: Tue, 31 Jan 2023 17:05:46 +0200 Message-Id: <20230131150548.1614458-16-imre.deak@intel.com> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230131150548.1614458-1-imre.deak@intel.com> References: <20230131150548.1614458-1-imre.deak@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The DELL P2715Q monitor's MST hub has a payload allocation problem, where the VCPI used to reserve the last two time slots (at position 0x3e, 0x3f) in the hub's payload table, this VCPI can't be reused for later payload configurations. To work around the problem in a follow-up patch the driver needs to reset the payload table after all payloads have been freed; add a quirk the driver can use to detect the monitor and apply the WA if needed. Cc: Lyude Paul Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak --- drivers/gpu/drm/display/drm_dp_helper.c | 2 ++ include/drm/display/drm_dp_helper.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index 16565a0a5da6d..e2cf4b4fe11ea 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2244,6 +2244,8 @@ static const struct dpcd_quirk dpcd_quirk_list[] = { { OUI(0x90, 0xCC, 0x24), DEVICE_ID_ANY, true, BIT(DP_DPCD_QUIRK_DSC_WITHOUT_VIRTUAL_DPCD) }, /* Apple MacBookPro 2017 15 inch eDP Retina panel reports too low DP_MAX_LINK_RATE */ { OUI(0x00, 0x10, 0xfa), DEVICE_ID(101, 68, 21, 101, 98, 97), false, BIT(DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS) }, + /* DELL P2715Q MST payload table must be reset after the two last payload slots get allocated. */ + { OUI(0x00, 0xe0, 0x4c), DEVICE_ID('D', 'p', '1', '.', '2', 0), true, BIT(DP_DPCD_QUIRK_MST_PAYLOAD_TABLE_RESET_WA) }, }; #undef OUI diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h index ab55453f2d2cd..fcd445921ec9d 100644 --- a/include/drm/display/drm_dp_helper.h +++ b/include/drm/display/drm_dp_helper.h @@ -620,6 +620,14 @@ enum drm_dp_quirk { * the DP_MAX_LINK_RATE register reporting a lower max multiplier. */ DP_DPCD_QUIRK_CAN_DO_MAX_LINK_RATE_3_24_GBPS, + /** + * @DP_DPCD_QUIRK_MST_PAYLOAD_TABLE_RESET_WA: + * + * An bug in the MST branch device's payload allocation logic requires + * the payload table to be reset after its last two payload slots get + * allocated. + */ + DP_DPCD_QUIRK_MST_PAYLOAD_TABLE_RESET_WA, }; /**