Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2304932pxb; Fri, 5 Feb 2021 14:29:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEfvWwf5OFHwiLW8QRSVOSogW/4hW/pP5TJ2xciDfVLqj680fHWWpPE2cfpSSbOjQL9vZw X-Received: by 2002:aa7:cb8a:: with SMTP id r10mr5682982edt.152.1612564163453; Fri, 05 Feb 2021 14:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612564163; cv=none; d=google.com; s=arc-20160816; b=aUapYUMhjskNBgktj4Bpxbl5fak4jdwER47AEduL93MgdxcJTNFy6PCro72+hiO7mn qqdfGY315kqYLdR+lqUF1HnxTbflFd5lF9XoLK8fMziSlqDhLuRny3ud86GIsqUljgov tstibo635BoX0wBOyUApygL2TvLjD4Q90GS8XYxaBnEOLVGoUM56jCsGSxYZcYCvuCdb nDd9RuBr4Ag6g4LXDwrHZ+raQ+0g1IysCX1AXWLqzISDJ07mqBIwgaIlSeP8p34+7k1B NbkZF3Ru+Z+de3mOLRyODWVTLQrLXoJzSkqKhCdqtzwl2DIaJveaRRQD+DcfL/CuVLcf ZdfQ== 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=D2IY0ci2HtV9b1Gl8Ljmy3vUYwQfEjcPf8sMSF4XhEI=; b=vFcjblcg2JAGYxf616IaLxncVhePUGfrZTokjP37IjzTzXZeiZrUqZLp19bOEHs8fj xpQh0L1fmMqSu0uQnabIXWLuz7w7PnV5tj+kFMJqQwBSgpLbTxFO7vW0fsh9awCE4OEr 9leOtIhnqcXO18zVXhuq/1ROjEiB+JxwqvVeBrDzlG14w+AsgCUTV0rs7CryRws/d3wc Nm+XeeLWTOwWakQcJ71xHVroYRkeDUxZxDYKWkzCTn4lntECyxT1pftNt70sCGn6ptX0 4yHVH9Hr6WJ0m/bHQWf2SnmxWBeCqM7OzsYgyZPp4urQmQKZRlIsDqZChht4Bhqgpuuv DAKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KlEMS4/g"; 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 t15si6045267ejj.506.2021.02.05.14.28.59; Fri, 05 Feb 2021 14:29:23 -0800 (PST) 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="KlEMS4/g"; 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 S232076AbhBEW1z (ORCPT + 99 others); Fri, 5 Feb 2021 17:27:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:44976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232849AbhBEOyw (ORCPT ); Fri, 5 Feb 2021 09:54:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F4BB65020; Fri, 5 Feb 2021 14:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534270; bh=D/tlQgjXAB4nMKA/FtiIDvM7nFaD0RUkXeM/gFAlG8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KlEMS4/gnnlIqMk8f6fYFWCz4u81AV+IJGXT4AKMdPMqYilxYX8EZgjuzsF/lRPLH phdw2dC3nDJGVFtISUWB86K/zj5dcnB8Dgx+01+EPpXcNPQGL6IN+4pqYsP2SwSZ7B sMgT+kSOxZkttK082chXftqbTlDfDeanUEeC91jI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Nicholas Kazlauskas , Eric Yang , Anson Jacob , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 49/57] drm/amd/display: Use hardware sequencer functions for PG control Date: Fri, 5 Feb 2021 15:07:15 +0100 Message-Id: <20210205140658.082559773@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140655.982616732@linuxfoundation.org> References: <20210205140655.982616732@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: Nicholas Kazlauskas [ Upstream commit c74f865f14318217350aa33363577cb95b06eb82 ] [Why & How] These can differ per ASIC or not be present. Don't call the dcn20 ones directly but rather the ones defined by the ASIC init table. Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Reviewed-by: Eric Yang Acked-by: Anson Jacob Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 18 ++++++++++++++---- .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 9 +++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index d0f3bf953d027..0d1e7b56fb395 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -646,8 +646,13 @@ static void power_on_plane( if (REG(DC_IP_REQUEST_CNTL)) { REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1); - hws->funcs.dpp_pg_control(hws, plane_id, true); - hws->funcs.hubp_pg_control(hws, plane_id, true); + + if (hws->funcs.dpp_pg_control) + hws->funcs.dpp_pg_control(hws, plane_id, true); + + if (hws->funcs.hubp_pg_control) + hws->funcs.hubp_pg_control(hws, plane_id, true); + REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 0); DC_LOG_DEBUG( @@ -1079,8 +1084,13 @@ void dcn10_plane_atomic_power_down(struct dc *dc, if (REG(DC_IP_REQUEST_CNTL)) { REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1); - hws->funcs.dpp_pg_control(hws, dpp->inst, false); - hws->funcs.hubp_pg_control(hws, hubp->inst, false); + + if (hws->funcs.dpp_pg_control) + hws->funcs.dpp_pg_control(hws, dpp->inst, false); + + if (hws->funcs.hubp_pg_control) + hws->funcs.hubp_pg_control(hws, hubp->inst, false); + dpp->funcs->dpp_reset(dpp); REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 0); 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 01530e686f437..f1e9b3b06b924 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1069,8 +1069,13 @@ static void dcn20_power_on_plane( if (REG(DC_IP_REQUEST_CNTL)) { REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 1); - dcn20_dpp_pg_control(hws, pipe_ctx->plane_res.dpp->inst, true); - dcn20_hubp_pg_control(hws, pipe_ctx->plane_res.hubp->inst, true); + + if (hws->funcs.dpp_pg_control) + hws->funcs.dpp_pg_control(hws, pipe_ctx->plane_res.dpp->inst, true); + + if (hws->funcs.hubp_pg_control) + hws->funcs.hubp_pg_control(hws, pipe_ctx->plane_res.hubp->inst, true); + REG_SET(DC_IP_REQUEST_CNTL, 0, IP_REQUEST_EN, 0); DC_LOG_DEBUG( -- 2.27.0