Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3134653ybi; Thu, 18 Jul 2019 21:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxH/RRO4CAZnTGai2NoWJFDK6AxkeG/P44ULBWDFRTP+SXG+0Wnd9HSV64oMIyTCKcIM/YX X-Received: by 2002:a17:902:8203:: with SMTP id x3mr54952585pln.304.1563511353343; Thu, 18 Jul 2019 21:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511353; cv=none; d=google.com; s=arc-20160816; b=u742wn+x7ZPZbHbNH79P65mvuxMgAvC3H4yrdlQtQz+mX46vRAKcaOBggOlcUCI34m PhqhKR7kpKq8OUdXPUEl5hZEe6YsFjCeK5fdonrjjJyNlaYS4MOZYg9Yq+8Y/gKweKHQ 1gKV1dh4RyI1Wxb88ktgftkYODLY7MwVMiMgz0rNVqPbAXqO0OVHTYD/C8TjjMPgqGLE 2v3sINWXK+lP0Y/lhz/QdJgBCQ50QQQJCqJ4WVy2D9W50TGhRtEd3SX+BCA6VoJMnl8+ SrZ1eNGHOkty21K+T98bEszmJ/kwq8a8jd+MvcLIm+oQE0PEbGp5AdQTsoQGVxx00BoT NnNA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DyCK+VgUu1VyiISoYAmxsX/14+9xJJIRDIc6dJnimHQ=; b=t8DP9oggSNDWNIujepggDEwmWLON328xm1H135lnW0XunBgu8eg8m2Vo9yWEI+VyhK Ur4oXH0AvKe+0Z1GXz0BmJLzxofp4ZuMlzrRoU+EFgkHLSuxTf0/00sOSWlSO3yoq2mK SM/1Dm2qRHjLnu2cuGh2t3lN4SVblOTKmQhf62EkKP2AFYA6rWLkDtbzIatrI6oyJQPC 11UrDqk77Wsluhj1TTptMRXBguLN5jm+tvCmE9SNsm12XgUjTCkpfXFHG+4gIzXwKlZR 8rFjcGoah0ivZQHm+h8JGJm43zJVOYxwRJoN+M5tcriwV3zyrwk+6v75v8ZpNQUXSsEM zMSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FPhgJ1SY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y192si4985960pfg.172.2019.07.18.21.42.17; Thu, 18 Jul 2019 21:42:33 -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=FPhgJ1SY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbfGSD6O (ORCPT + 99 others); Thu, 18 Jul 2019 23:58:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:57458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727811AbfGSD6M (ORCPT ); Thu, 18 Jul 2019 23:58:12 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 188A12184E; Fri, 19 Jul 2019 03:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508691; bh=qM2zHBibiBBO03fWCDDQyTr6ziwHDkUz0cX/k5QHERA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FPhgJ1SYmS/Hn5MmOhfD5/eSUN9IJr6ZZhQp1LrYUbKN72DbK6hHl16325pX8VLSe MJx3NiqECbyw1Wj5okGhYLC8xVPEDUcYPPiyuZ7TXzgGkx4iGXGNU+24a6Ef3nQLVC IGw+pR7MzatuD+HrS7Avms4Cxm2ziQxBM/Ncq1r8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Harry Wentland , Leo Li , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 035/171] drm/amd/display: Reset planes for color management changes Date: Thu, 18 Jul 2019 23:54:26 -0400 Message-Id: <20190719035643.14300-35-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Kazlauskas [ Upstream commit 7316c4ad299663a16ca9ce13e5e817b4ca760809 ] [Why] For commits with allow_modeset=false and CRTC degamma changes the planes aren't reset. This results in incorrect rendering. [How] Reset the planes when color management has changed on the CRTC. Technically this will include regamma changes as well, but it doesn't really after legacy userspace since those commit with allow_modeset=true. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 31530bfd002a..0e482349a5cb 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6331,6 +6331,10 @@ static bool should_reset_plane(struct drm_atomic_state *state, if (!new_crtc_state) return true; + /* CRTC Degamma changes currently require us to recreate planes. */ + if (new_crtc_state->color_mgmt_changed) + return true; + if (drm_atomic_crtc_needs_modeset(new_crtc_state)) return true; -- 2.20.1