Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1062772ybl; Wed, 14 Aug 2019 10:06:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxomqa6VN6lJRknZ7qS5UXXwopGSAqno7A6iY4hKN2RdKWB+XHtY5z1PUyPRmWv4EpcPvvW X-Received: by 2002:a63:f926:: with SMTP id h38mr213258pgi.80.1565802414616; Wed, 14 Aug 2019 10:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802414; cv=none; d=google.com; s=arc-20160816; b=SVcX86h5TE4PymoZtOtRCz1Q6WrKPXVqftOgjE4WN/JPu2aWb8GGUMXsp+HdxctJac XX23r8KhISfku8wxf2LD59MRTJy5ECN7CgUdn58khobT5EoQy9wGHUbc9Ifqz/ZhSatD zq4/7fyCAO4daTsegus8+QtUIpkuSWwUi2YHXKhQa1XWoYcUMTgGmHiH59/gCRgDhcy5 v934uUe9iNMT2LdHRrH9I+Po6TfnmxGM4hm0iPdNW/vMO4taEf6n7BRq2gAVjPML9lIe zgRKejj5cspB6oNFl63zi2M6RC1Jcl1ZFOyuByIGsx12JSgERJFVcAvlMnMCOqrVrVif HlUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6Ox/px1w++1aXt0jXCYSHWRXzKFjV34ROhGwZ1ATPsA=; b=zJTtIAqc6z1sX1FNwOv3lVvgPGn49JzeTDz4TMhm+DGTGxzmKDPleJrqDhkngo5Gd+ FO5rIX/ECnyPMHH1E7lDYiko4A8dHnLu/Q9JRjj/zBOEEATIiC25WAKIUXXcWZkopJDG if/E++ySczMgssWKBxcvFrtkPGGjVGuXY9lsiqtn259VbQQfRLd58XrlynP2x0mQUI3V YOTQ71ZVc5EQ9a5WCKg+aVUKwE41wv9wK7MrifpqbAQJgrS3mvfAJVqyJXhfoMTN8ygI g3+b4m2vSSyQcq6U2cAZC3o0BvZPX7Wm1nJL+CJWLu88K9sub33aVnu78n40ke+6OKju YTQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jezazGSM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si231340plj.194.2019.08.14.10.06.38; Wed, 14 Aug 2019 10:06:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jezazGSM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729297AbfHNREq (ORCPT + 99 others); Wed, 14 Aug 2019 13:04:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:53590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbfHNREp (ORCPT ); Wed, 14 Aug 2019 13:04:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CD6E2084D; Wed, 14 Aug 2019 17:04:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802284; bh=wJr2imQIhqz78PABkJl03BKNNEItmgv7L8ODU/LnUmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jezazGSMgR947ioeCVoWOC0F7n/9VNU8FiBDeND/D6qz6xzDjwUQB7vSL1b+NtMb8 tqhkTFnisMaTH+ivUjCcDPVDbf8lg3s9Zax3lvO2T2k95w1Ko0eTvY9+a0385PalhY 00E/kdvVLMffUZgPbFfc5cmhviXYBp0ymp8Xm86I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, SivapiriyanKumarasamy , Anthony Koo , Leo Li , Alex Deucher , Sasha Levin Subject: [PATCH 5.2 066/144] drm/amd/display: Wait for backlight programming completion in set backlight level Date: Wed, 14 Aug 2019 19:00:22 +0200 Message-Id: <20190814165802.599863968@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c7990daebe71d11a9e360b5c3b0ecd1846a3a4bb ] [WHY] Currently we don't wait for blacklight programming completion in DMCU when setting backlight level. Some sequences such as PSR static screen event trigger reprogramming requires it to be complete. [How] Add generic wait for dmcu command completion in set backlight level. Signed-off-by: SivapiriyanKumarasamy Reviewed-by: Anthony Koo Acked-by: Leo Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c index 2959c3c9390b9..da30ae04e82bb 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c @@ -234,6 +234,10 @@ static void dmcu_set_backlight_level( s2 |= (backlight_8_bit << ATOM_S2_CURRENT_BL_LEVEL_SHIFT); REG_WRITE(BIOS_SCRATCH_2, s2); + + /* waitDMCUReadyForCmd */ + REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, + 0, 1, 80000); } static void dce_abm_init(struct abm *abm) -- 2.20.1