Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1536397pxb; Thu, 16 Sep 2021 09:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztt/HQOEpQnGhsZVIUucz5gFiufdjJ2/8iZQAwkFcT/iVIZOLQT/bhw2idpJMTQFj0e13V X-Received: by 2002:aa7:df8b:: with SMTP id b11mr7441415edy.61.1631809604983; Thu, 16 Sep 2021 09:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809604; cv=none; d=google.com; s=arc-20160816; b=W+XADw3J/Kioe1IWeGOz7jAXYWiXBlUcmRGsB8FgT60ZYzFgRv8rmVP/OWhyu9E+Y5 FKWjzPp/xUX/p7wCLVoQE0p3YLbPvDRAMYBEFvHek7JvGiheJcQkSUR9TyLX4WGFABTR yKMq9S0gOtGYriKZmKkAWC/eALngVebNI7mpVk27nFtG8hUfoTtZOlhyEJSQN/R81DlR kDQyCbriUtMoHKjJJbTVMyschvjiy97l5fG84XM/CQa44ztilfzt/XqOThsSQD9U4OW2 PjroMskd4NxXOXc+djVXRecy27qRBoxSJetZrtM5NHuXm3a9hkr9t+1nf1E8EfeHL5De N9Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ly2tIeKnouqcKfEYlJGVkPnUTJnqJxHV35YpoMOEmDU=; b=MN66ok1rGMuChhdHuo4OwDc8kS4TNVYF6VlDNA0qXwi3fICMut3yhby+cxMHEgsTdu ATG1YjLApxVGJC37/HGz/ey3GFc/1+MMlFXEj8Btyi7eu0oFUH26Sm4OAQ2zE8DGKxDm gBj7MAbNbkjLXTpEpscCo80myCrPDBCkjsD8FUSrVZdXOqe6FC5ti93prF8fkElTtlAQ B/LlyxbiGRn9qdT0YJyC9Q14Pwa21q47l+NPA+FRDdD4f/95eSZWa93b7LlXmIvyF6o1 sv8RgsyArAkLIvUhlaND7wPb4XTUNsTw6yYcz9SuYz5ZLtOEcohompudLeV1qKPHuJ6t EVrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mEWCFU6n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si4283112edb.407.2021.09.16.09.26.16; Thu, 16 Sep 2021 09:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mEWCFU6n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241375AbhIPQZd (ORCPT + 99 others); Thu, 16 Sep 2021 12:25:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240818AbhIPQRW (ORCPT ); Thu, 16 Sep 2021 12:17:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 010EE60F92; Thu, 16 Sep 2021 16:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808737; bh=VhGEEEhCadpoX8sJ7wF6ti6HEh/hkg6HaHOAQWnfBjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mEWCFU6n+KfJGWMaEAWJ7TixF9QjWpUc5+/fIn84JAWamGH2acUgKcJ5Djq7eiiL7 t2+7yyYCjIyeR5xhlO5oec+CW4TDIaltafD7E8tFW8R1fNq9Xi2IalDN3XDmoPwLDl HOLB/1J+FkF/lVhREtyHukwmOGaxbSA/8o6Cjcoo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anson Jacob , Roy Chan , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 203/306] drm/amd/display: fix missing writeback disablement if plane is removed Date: Thu, 16 Sep 2021 17:59:08 +0200 Message-Id: <20210916155800.972003906@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roy Chan [ Upstream commit 82367e7f22d085092728f45fd5fbb15e3fb997c0 ] [Why] If the plane has been removed, the writeback disablement logic doesn't run [How] fix the logic order Acked-by: Anson Jacob Signed-off-by: Roy Chan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 14 ++++++++------ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 12 +++++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c index 9d3ccdd35582..79a2b9c785f0 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1704,13 +1704,15 @@ void dcn20_program_front_end_for_ctx( dcn20_program_pipe(dc, pipe, context); pipe = pipe->bottom_pipe; } - /* Program secondary blending tree and writeback pipes */ - pipe = &context->res_ctx.pipe_ctx[i]; - if (!pipe->prev_odm_pipe && pipe->stream->num_wb_info > 0 - && (pipe->update_flags.raw || pipe->plane_state->update_flags.raw || pipe->stream->update_flags.raw) - && hws->funcs.program_all_writeback_pipes_in_tree) - hws->funcs.program_all_writeback_pipes_in_tree(dc, pipe->stream, context); } + /* Program secondary blending tree and writeback pipes */ + pipe = &context->res_ctx.pipe_ctx[i]; + if (!pipe->top_pipe && !pipe->prev_odm_pipe + && pipe->stream && pipe->stream->num_wb_info > 0 + && (pipe->update_flags.raw || (pipe->plane_state && pipe->plane_state->update_flags.raw) + || pipe->stream->update_flags.raw) + && hws->funcs.program_all_writeback_pipes_in_tree) + hws->funcs.program_all_writeback_pipes_in_tree(dc, pipe->stream, context); } } diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c index 97909d5aab34..22c77e96f6a5 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c @@ -396,12 +396,22 @@ void dcn30_program_all_writeback_pipes_in_tree( for (i_pipe = 0; i_pipe < dc->res_pool->pipe_count; i_pipe++) { struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i_pipe]; + if (!pipe_ctx->plane_state) + continue; + if (pipe_ctx->plane_state == wb_info.writeback_source_plane) { wb_info.mpcc_inst = pipe_ctx->plane_res.mpcc_inst; break; } } - ASSERT(wb_info.mpcc_inst != -1); + + if (wb_info.mpcc_inst == -1) { + /* Disable writeback pipe and disconnect from MPCC + * if source plane has been removed + */ + dc->hwss.disable_writeback(dc, wb_info.dwb_pipe_inst); + continue; + } ASSERT(wb_info.dwb_pipe_inst < dc->res_pool->res_cap->num_dwb); dwb = dc->res_pool->dwbc[wb_info.dwb_pipe_inst]; -- 2.30.2