Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2656419pxa; Mon, 17 Aug 2020 15:41:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMqI/4FhCypZzPXOTaJFvY9x6D9iL2pHoNuPHnd0LSLs0Tjdrd2cpF/z2X3Bt7/TK71enI X-Received: by 2002:a17:906:390c:: with SMTP id f12mr724536eje.28.1597704086098; Mon, 17 Aug 2020 15:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704086; cv=none; d=google.com; s=arc-20160816; b=MfR5FgjcRMf1TSIdA99+wF/Cp3eFlbrytA6VNAYkFPy9nQHzHai6MA/Li4PH4Ux722 7effulfA3SQir60ZTO2H0SM9e0B2HE3n8hW3+kwP4WlYb9CNa7f+poacd5Zarl/KabWZ az+QQSQly8w0RhVlEl1V3cP5YtgBDj7dvJdOTdDGpv9DDIPI1E4g+K0gnHfsSws42Szo tcgnySMseEvaS7Oiv5PwT0Rq0aSmzT1H+irkC/7Bmn0kTK1jv5eJeboC5XkaBqe+IBNY WNsLMie2yKgNn1r4w3pM1t69DeFvd0qxQQq8qGjML89wPzlxS0BLq5+MNb2hiPwCs1aj /SsA== 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=YUZOiUHt2DQZ+Wep2cbAOgsTV5SxnQyJARpUwHKtLjA=; b=xdm8cs64jiaExuoa08h/iC9Mo7hCNUKpdhZEPly3RwBoyx2n9vmJHJ7NTkZC5ymf3n Lv7871jhDCKLVvSRyLWxf6pdrQ4iBE2VhmvUZfXOP3KkFu9w8k5qGbNrD6UBl10Rr8Cf 3JOtQsQ+sWichOzUmKF0oM10Li7hAgbUC2tGA7UmnSzpTBUm6949Pvi51niFpuSejnlI T5zmkK+gDv9TOFCS/keba7k8AoBnd6bs154Dd0jH/NRD0IWFj229EdDN9AuN9WFRfbZx PVlGNDsbeMZ8dJdDOPj0R6jlpogudin+7vDxVOuus8PAyl412QpvzDm7Gf9d6dElMuyj BZNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n2GLDhGu; 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 a9si12066789ejb.116.2020.08.17.15.41.02; Mon, 17 Aug 2020 15:41:26 -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=n2GLDhGu; 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 S2390639AbgHQS16 (ORCPT + 99 others); Mon, 17 Aug 2020 14:27:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:49154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388170AbgHQQB7 (ORCPT ); Mon, 17 Aug 2020 12:01:59 -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 5784520729; Mon, 17 Aug 2020 16:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680118; bh=xNyM5rNjE6+khPL8+Pq/eDFaju85TkaxQzyaLz0LRUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2GLDhGuKNFuPHfvIEF3tuDk4Jz3LDoLQ/kAjsB3DOvexgy0Dyb2KXW7TKXziKPyu VeQJM/gpfoiJBjcWC9Fq/d7ZWHg05oI/NDuy36e+ZKw7Nkdg+TiUdGIBgGhQs2eyt/ 60QXqWoSvZc8bkeSJ7AzzSsBwZB5GePbvDO7Pae8= 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.4 058/270] drm/nouveau/kms/nv50-: Fix disabling dithering Date: Mon, 17 Aug 2020 17:14:19 +0200 Message-Id: <20200817143758.665239242@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 c9692df2b76cc..46578108a4305 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/head.c +++ b/drivers/gpu/drm/nouveau/dispnv50/head.c @@ -83,18 +83,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