Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1080036ybl; Wed, 14 Aug 2019 10:22:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwolhphBvC56BcFp/mYudWQjedRvq9YtfExG9AbOZuguvJs8GUAOf3pxZlSB6LZG5RMEirQ X-Received: by 2002:a62:f247:: with SMTP id y7mr1050195pfl.236.1565803333090; Wed, 14 Aug 2019 10:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803333; cv=none; d=google.com; s=arc-20160816; b=XztFHg8gdJbbuXmqFsg574809jNgfo1zGeoUNg/l43iksVGq2FpsfKWxr7NLTnxPZq MtJ4APzkAPNZn3IVBACnDxRrzIIxJfHbnQmE7NcHOEst/3SGod6lpwUOsB8SDihSPPTG Tr7++d1OW+cus8wzrc/85XHsjX2J7Vzcu1iyKhPamP+ymNyEOiOIFENPW8cOmIbz72Sy aL/p4QgwTyazbb4LTwToNSb3aGRgMpkzFHKNNMBdhIZDC4n+Nq3PrgieaD9UAGK1BzTg 7kHnDoN81ZMnG4RZ99+D9i8Skf1TpCb37WlasznbIXCIKawb+pqqTws+XMbOtJcOAVXE t/3Q== 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=b8wdxYXT2LaOv9a5euvioy/8IQVnP/yWUtQw0OM5xQk=; b=ylEQRg5vgfWEx2S6ixxGTkGlEVxSdJStDTh+p+kptczqsO1jzMl0aciWLyPW4Q0TYq 9o99LshNDE3KsHJwVOGzcRJaqRhcARVtXR6qXrPqHBPXW2cUaUVKnAR1m0lhMt4SDd0J KvgdYC4Or7kqD2tSvyl+1P88j52Crjq0GqNjJNobWclkf9cN35DYgx/KvuqS/IgXRJMt mJ00A8a5hOvlViVOIk0SOGCUnPJzq6owKND8hDIEN6Odw55UZG8qyj3e0tvVS7ZHcKUP zMSKAs6snCyW5mbx4Q6ikTC2XDiYIjg0rbp3yO+Lh5PmbQtNHZZKL9C3UEpOpyXRxUi1 QQ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WtBFL4CR; 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 f4si273476plb.38.2019.08.14.10.21.57; Wed, 14 Aug 2019 10:22:13 -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=WtBFL4CR; 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 S1730540AbfHNRK4 (ORCPT + 99 others); Wed, 14 Aug 2019 13:10:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730524AbfHNRKw (ORCPT ); Wed, 14 Aug 2019 13:10:52 -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 24EA9214DA; Wed, 14 Aug 2019 17:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802651; bh=3hcUrXBwLYEFvDHHf+GYMkiPTXNi7elwJUIL1TIduhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WtBFL4CRS1usCjgm8z7q1BGbkZ2Hcn5GyX2Pi5fKVtkXTrJ7wt2rNkmIMwvOvTzLq /hJfx1yF9jjI+vjJQiparFdQI5T78Nt1tIRNAXLE376bVuVuuKuJbE9qmedlwqx5/L nq+2fGalIxNb285hTb1YfMIrhInmmBaTsZGmdkvI= 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 4.19 39/91] drm/amd/display: Wait for backlight programming completion in set backlight level Date: Wed, 14 Aug 2019 19:01:02 +0200 Message-Id: <20190814165751.313309758@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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 070ab56a8aca7..da8b198538e5f 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c @@ -242,6 +242,10 @@ static void dmcu_set_backlight_level( s2 |= (level << 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