From patchwork Tue Oct 4 20:24:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 12998667 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 DC5C8C433FE for ; Tue, 4 Oct 2022 20:24:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6264010E0F9; Tue, 4 Oct 2022 20:24:47 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D77010E0FF for ; Tue, 4 Oct 2022 20:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664915082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=68Cjk2krWuLCLqwuVkKp32QKy4UuNZQ+DBLOl7qONe0=; b=KEyWcWHGJKIOr/3DOxjqYmYW8EacpZA7PHNqvNgKbtLFHNMbCoHa1tIUnC1mw9svW0LV8J V+lwhQN4HVuJEaiWotP8YydprE0tpRiAA8k1v9E/Dk+yyw9B6V1RPcBq6yNG2j5XZx6R+U X/BBKA1rz3NH8B/jY9++AKoFeHvQ/GU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-599-6nYTxoTBMSiDvqWHTmPTnA-1; Tue, 04 Oct 2022 16:24:37 -0400 X-MC-Unique: 6nYTxoTBMSiDvqWHTmPTnA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 385D01C0758C; Tue, 4 Oct 2022 20:24:36 +0000 (UTC) Received: from emerald.stthomas.edu (unknown [10.22.18.134]) by smtp.corp.redhat.com (Postfix) with ESMTP id 855191121314; Tue, 4 Oct 2022 20:24:34 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/amdgpu/dm/mst: Fix incorrect usage of drm_dp_add_payload_part2() Date: Tue, 4 Oct 2022 15:24:28 -0500 Message-Id: <20221004202429.124422-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: Ian Chen , Leo Li , "Pan, Xinhui" , Rodrigo Siqueira , open list , Jani Nikula , Fangzhi Zuo , Claudio Suarez , Hamza Mahfooz , Wayne Lin , Alex Deucher , Mikita Lipski , =?utf-8?q?Christian_K=C3=B6nig?= , Colin Ian King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Yikes, it appears somehow I totally made a mistake here. We're currently checking to see if drm_dp_add_payload_part2() returns a non-zero value to indicate success. That's totally wrong though, as this function only returns a zero value on success - not the other way around. So, fix that. Signed-off-by: Lyude Paul Issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Fixes: 4d07b0bc4034 ("drm/display/dp_mst: Move all payload info into the atomic state") --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b8077fcd4651..00598def5b39 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 @@ -297,7 +297,7 @@ bool dm_helpers_dp_mst_send_payload_allocation( clr_flag = MST_ALLOCATE_NEW_PAYLOAD; } - if (enable && drm_dp_add_payload_part2(mst_mgr, mst_state->base.state, payload)) { + if (enable && drm_dp_add_payload_part2(mst_mgr, mst_state->base.state, payload) == 0) { amdgpu_dm_set_mst_status(&aconnector->mst_status, set_flag, false); } else {