Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp725907pxb; Tue, 2 Feb 2021 16:49:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLN/mYwmVVSL74FkYjYYPiRduqEsRkbs4dumsveSx019dg9GqFTVuk875meDMCxA6D5UvI X-Received: by 2002:a05:6402:35d6:: with SMTP id z22mr661475edc.58.1612313367982; Tue, 02 Feb 2021 16:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313367; cv=none; d=google.com; s=arc-20160816; b=ErdedHXwTC8e8zIleNBk2XHevdNH3UcwSfgV0qBZ33S5l3ku4RTlzKO2mXjju8HBCO xhz92/xZ55OiZ2yirvaD0apl/SUxmsMHxdMfhmvkWtb4pyfdXOZkUjB8YFUdBblI9KJn GVGa8bx6uGOIsmyq/YkAvxBaM6YMWeg/j3Kzv8br+2JqKXtSuNa70CNIiV5MFReOJKfb jXnHjdZT4xb/Kgq20SgLtwnMAwB9a4QNMMmSYvueqXCLyxdmc+irc7ZFuhdEdiXwbUej 6wrCfStFuC0H7595XtPUjCZ7tvgcdU1YLXRs/CVsmWIVfmxYvX2LqWuh4LqN7pMmQoVk fUvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lRk1JtowV/XDY7EN1+aAzDga+b2KFOQgyLiveoS1sIs=; b=SlksgA4Q3k9gjfPEETLEb0/7K/1cYNriFCaDpGYeaqrQhitIsnsEDyoK8O5nuchrBu dOpw6c/qLQ6i/haj2bj8OQmcKyEO3CeuiOW/76qo/kmgxxM01re90kFe1PjuMm65Y8r/ Jm0m9dQOTB9HcRzbfhr6ApC4Mt2sVA4Ixtyipu62TgpaH5kSn1s+65iWDhWsQgnHOyvA BizZeM3cejbs1utvTHqmztAYVmFXddYLJvhJfRwqxu+DYQFwl2FL43SwHSDEIakORICN iXD2OiZDTwXXcP4YeGYWKO/FlELmFyc+CQQ8Nnk1LQ5O4O+6jIntZ+8KgNhH9VEIquel IPMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HFQsW7JZ; 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=pass (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 jg4si289331ejc.313.2021.02.02.16.49.04; Tue, 02 Feb 2021 16:49:27 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=HFQsW7JZ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240376AbhBBUEj (ORCPT + 99 others); Tue, 2 Feb 2021 15:04:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:35064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232736AbhBBNoi (ORCPT ); Tue, 2 Feb 2021 08:44:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B48264F6F; Tue, 2 Feb 2021 13:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273224; bh=WZAX6xb/MG6Cuh3DT7zUEAnMLWUeVRVdLWKn39TkcWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HFQsW7JZzAWN6eVtGoa/CBVefh9Q7mIT0t1i7p17/uxaHEw8DtSnlrMkgv8o0bF3n gXxWnRsSBfmIcxiavvaQ5ZXX928lzZId2NrgMZrsIdhUFx6wBmyaDKi6g093wzIHCm V69+W1TR2FR2R05FcswFDnFE9q8byrv9px1NGgBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Jones , Martin Peres , Jeremy Cline , Simon Ser , Lyude Paul , Ben Skeggs Subject: [PATCH 5.10 026/142] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes Date: Tue, 2 Feb 2021 14:36:29 +0100 Message-Id: <20210202132958.790713871@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lyude Paul commit 7c6d659868c77da9b518f32348160340dcdfa008 upstream. Nvidia hardware doesn't actually support using tiling formats with the cursor plane, only linear is allowed. In the future, we should write a testcase for this. Fixes: c586f30bf74c ("drm/nouveau/kms: Add format mod prop to base/ovly/nvdisp") Cc: James Jones Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Cc: # v5.8+ Signed-off-by: Lyude Paul Reviewed-by: Simon Ser Reviewed-by: James Jones Signed-off-by: Ben Skeggs Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -702,6 +702,11 @@ nv50_wndw_init(struct nv50_wndw *wndw) nvif_notify_get(&wndw->notify); } +static const u64 nv50_cursor_format_modifiers[] = { + DRM_FORMAT_MOD_LINEAR, + DRM_FORMAT_MOD_INVALID, +}; + int nv50_wndw_new_(const struct nv50_wndw_func *func, struct drm_device *dev, enum drm_plane_type type, const char *name, int index, @@ -713,6 +718,7 @@ nv50_wndw_new_(const struct nv50_wndw_fu struct nvif_mmu *mmu = &drm->client.mmu; struct nv50_disp *disp = nv50_disp(dev); struct nv50_wndw *wndw; + const u64 *format_modifiers; int nformat; int ret; @@ -728,10 +734,13 @@ nv50_wndw_new_(const struct nv50_wndw_fu for (nformat = 0; format[nformat]; nformat++); - ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, - format, nformat, - nouveau_display(dev)->format_modifiers, - type, "%s-%d", name, index); + if (type == DRM_PLANE_TYPE_CURSOR) + format_modifiers = nv50_cursor_format_modifiers; + else + format_modifiers = nouveau_display(dev)->format_modifiers; + + ret = drm_universal_plane_init(dev, &wndw->plane, heads, &nv50_wndw, format, nformat, + format_modifiers, type, "%s-%d", name, index); if (ret) { kfree(*pwndw); *pwndw = NULL;