Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2658144pxa; Mon, 17 Aug 2020 15:44:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYMY3IGlAfJo19waGgd9QeXy+p64yUtBR7cnkayvlBjUajkE8ZE9a/Zo0No/3cYElI5I1P X-Received: by 2002:a05:6402:22ab:: with SMTP id cx11mr17698790edb.102.1597704290405; Mon, 17 Aug 2020 15:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704290; cv=none; d=google.com; s=arc-20160816; b=CnOtA7yODNYKltvz2we3ZYUc1OeMe0hpSqmcc7bUrtnwecVrVywHV3KiUbkpUZPPzR kp/kMAj2RgesKTKeXfPmqocIBZHGf1TmMm+SyQF0eovMVlBsAJEYkkbnIA3a2ZUEK1e5 AruRCVcamOc3RgTj7AO1oUftU9JISwuXQ5fnZhHcKkWKHxQcH6tuFVBEygCP4Ks9ey38 uyJw3422DG15ZNEZGf/Hse2xProykwgp9N40BGR0AkweHn2K0s8xMGfzjPpXgPVmjAYf c/BlkadbickR6uFrrT0NQNfon2+jZJP9BIPXpbMpJn/xE2laqE9hbxh1NPO7+4aqnd/u XSRQ== 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=plXQHgk2Eqe3QhBPWVhWCLiKp1cd1pVIhLr9fRwJGXI=; b=nwdmoe0Z+1bnDRNSJqG+cyGQsydj3I4cKWlsRi87dtfmzdU0h0axaOS916EGWN+Zc+ Rsgsdi61VxSYlumW8l/Ou2668+i91GdaU6VCqTg2Ol35HIAI3lKzbsMuUQGNEGsRhsoW +jfKj1byU/xWa2eQfj8D2L6WN/jEaPgjCJFbjld47rS0HSTb0AH9TU2QaSNu/43Pz+iG 1+Ck05LO8eosu1vfzpK3vU0VOgciC2/dq294NxzOVAvKPaqaA6OJQd9BX2pIrM4+MRKU t+Rr9R8nqN0JFnL5T5A+CkfJZWWGo02BuVwff9CNKVqVz1lt/dHH8KZURywe94YDXyZo xO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O9S2HUW+; 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=fail (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 i4si11341635ejz.318.2020.08.17.15.44.27; Mon, 17 Aug 2020 15:44:50 -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=@kernel.org header.s=default header.b=O9S2HUW+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404045AbgHQTGf (ORCPT + 99 others); Mon, 17 Aug 2020 15:06:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:54900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387689AbgHQPoN (ORCPT ); Mon, 17 Aug 2020 11:44:13 -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 D489122D00; Mon, 17 Aug 2020 15:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679048; bh=Z6K4uvy4C7W23CznrC/gasZ1erGhoQ4x23h6wbcUX98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O9S2HUW+v8B8eTuf+uRI14G5riz3tduGZIEYQGKPSXi6ystDDzN1U9RQjKCmM6aih 1QZCBhjT4n6r+ll3d+K9HvEjLsUCuC/a2v2SQvDZvhbLHdWsaF94MBD5emOTT5vPpj NSelAxKWx0n8hpEviKYfPkkJ5XSyyEfoqMmd7oSk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Ben Skeggs , Dave Airlie , Sasha Levin Subject: [PATCH 5.7 078/393] drm/nouveau/kms/nv50-: Fix disabling dithering Date: Mon, 17 Aug 2020 17:12:08 +0200 Message-Id: <20200817143823.400058467@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 From: Lyude Paul [ Upstream commit fb2420b701edbf96c2b6d557f0139902f455dc2b ] While we expose the ability to turn off hardware dithering for nouveau, we actually make the mistake of turning it on anyway, due to dithering_depth containing a non-zero value if our dithering depth isn't also set to 6 bpc. So, fix it by never enabling dithering when it's disabled. Signed-off-by: Lyude Paul Reviewed-by: Ben Skeggs Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20200627194657.156514-6-lyude@redhat.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/dispnv50/head.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c index 8f6455697ba72..ed6819519f6d8 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -84,18 +84,20 @@ nv50_head_atomic_check_dither(struct nv50_head_atom *armh, { u32 mode = 0x00; - if (asyc->dither.mode == DITHERING_MODE_AUTO) { - if (asyh->base.depth > asyh->or.bpc * 3) - mode = DITHERING_MODE_DYNAMIC2X2; - } else { - mode = asyc->dither.mode; - } + if (asyc->dither.mode) { + if (asyc->dither.mode == DITHERING_MODE_AUTO) { + if (asyh->base.depth > asyh->or.bpc * 3) + mode = DITHERING_MODE_DYNAMIC2X2; + } else { + mode = asyc->dither.mode; + } - if (asyc->dither.depth == DITHERING_DEPTH_AUTO) { - if (asyh->or.bpc >= 8) - mode |= DITHERING_DEPTH_8BPC; - } else { - mode |= asyc->dither.depth; + if (asyc->dither.depth == DITHERING_DEPTH_AUTO) { + if (asyh->or.bpc >= 8) + mode |= DITHERING_DEPTH_8BPC; + } else { + mode |= asyc->dither.depth; + } } asyh->dither.enable = mode; -- 2.25.1