Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5640700img; Wed, 27 Mar 2019 12:15:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaT9lYi8VplVqt6rkwtPmh28ovo+dWDYFvfkoqYh/mYtkf4AUmYsQ1IeTzf+qsY8W3WEu1 X-Received: by 2002:a17:902:362:: with SMTP id 89mr37010100pld.172.1553714113911; Wed, 27 Mar 2019 12:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714113; cv=none; d=google.com; s=arc-20160816; b=SZdZJNMLMja7tj/FPo7e904blIU+l15AUmbWJnyHUUNidp1k8Cxq8MtRgmM97O2ZdH wgxkN/plhNCG8Mm8xeQ4t6ECDLA7ZQJ8lQsiC0rlJe4NlW8+17J9YhHhkDl74+VxoZmd 53ICB7QZZZNCV/Ych+G8/ElvCJMKpVYC4lnhW1j0rBTjhugesq0Ws6QEvKrugTTy4DFC 8H1+eqd/iRZrnC6+jIke89HnynwgKP31M/lABRutDybxg6IJsdug/D58FYMCV3Q1AgF1 lkEliLYvChWtWcLlorXheFx+QvbDu0xXSfLPFuJhNRZmB+YEx7H+AR72Y1nHjFwbV/u2 NXfA== 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=mgWm7xEgWg0BpLiZTRoiIJFGePQdFWb9q3dB/F/vK5s=; b=CgMY2gE3DY3grPgN5mDs0wJ2difNd9xU/O9BppGWctVUHx455cRKpoSAh/muUS+ZoC VKp0Wnvkw5Fqn5mVePEzrZzw5Sj/5M7F6F8M44Acol82LHDwGSFM28RlIRKYIkZZwhXM XMVkg0UPLRkQKLayRFo2sEzhZrYV536z5+br5yc1shsWeBW10kw9ww9gsBodjh0wBWwh bMGSIwkQFIwMMDG1LKdZRN5RdodJqCP7VlxRjmE+vrqYP7Hsdu7BsVzJ62FzB75nI01N KLTLK9aRPfxBC6aAGLIMISPullOOFpl1bolex49faMb7EfCE2r94BXL1hwdJPmezyTjk Jx7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zhy7U1YX; 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 h20si18070786pgv.388.2019.03.27.12.14.58; Wed, 27 Mar 2019 12:15: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=Zhy7U1YX; 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 S2388648AbfC0SJt (ORCPT + 99 others); Wed, 27 Mar 2019 14:09:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388618AbfC0SJp (ORCPT ); Wed, 27 Mar 2019 14:09:45 -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 4ECC1217F5; Wed, 27 Mar 2019 18:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710185; bh=uWUGsKf5++BnjiYmQRr1ejbbK4d8tDhLO6rT5Vnf96c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zhy7U1YXh2gMNvno8MKc+FzoB6pe+sfHZXG/SQb/rhRXJ3Ywo7DLlTkemFZzqIWTv ii7tOPDMIfTNKouX0K5iRt+wAFA1HzcKGJrrqikD3TaQ3lIcCe3zZQDRrrnlDY+rYe e5OReAJY2PscoDat8n5XeIzQLNkTAtseGEJWSo2o= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Paul Kocialkowski , Maxime Ripard , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.0 241/262] drm: Auto-set allow_fb_modifiers when given modifiers at plane init Date: Wed, 27 Mar 2019 14:01:36 -0400 Message-Id: <20190327180158.10245-241-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 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: Paul Kocialkowski [ Upstream commit 890880ddfdbe256083170866e49c87618b706ac7 ] When drivers pass non-empty lists of modifiers for initializing their planes, we can infer that they allow framebuffer modifiers and set the driver's allow_fb_modifiers mode config element. In case the allow_fb_modifiers element was not set (some drivers tend to set them after registering planes), the modifiers will still be registered but won't be available to userspace unless the flag is set later. However in that case, the IN_FORMATS blob won't be created. In order to avoid this case and generally reduce the trouble associated with the flag, always set allow_fb_modifiers when a non-empty list of format modifiers is passed at plane init. Reviewed-by: Daniel Vetter Signed-off-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20190104085610.5829-1-paul.kocialkowski@bootlin.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_plane.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 5f650d8fc66b..4cfb56893b7f 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -220,6 +220,9 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, format_modifier_count++; } + if (format_modifier_count) + config->allow_fb_modifiers = true; + plane->modifier_count = format_modifier_count; plane->modifiers = kmalloc_array(format_modifier_count, sizeof(format_modifiers[0]), -- 2.19.1