Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1021579yba; Thu, 4 Apr 2019 02:36:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVxrTcpixQAWZZ89+uzQ/Mn7aH7X0886lqEc49+7FgjHDyPRNc4fnQkBvvFS2POCCbKWIK X-Received: by 2002:a17:902:1002:: with SMTP id b2mr5392704pla.248.1554370615856; Thu, 04 Apr 2019 02:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370615; cv=none; d=google.com; s=arc-20160816; b=azKN5eZIPGdFrDXpTb3C6f5RF4kiq/svuCrR0dDwr3Q0WzaQrPtBoFis+HNa9zUpRi pV6Gg1CzTqJUtfv/VCJW4dhx5mN8C0XKx2cL3J3QlQyaiCQCEAdEMDkyCHUQnmrdyfI4 Aa0jHPjrPgN2Qqq1VKkAfjgMe3ltBZE0C8LmmcwWHoYG1myPUxAt5J9v0qdDt3M6a0Ii tA5yxCags75jE0T2LV/7oMzOUki+k+IJ6BQuofWMEgDDsKv5yLTMxYtaT9DEEqDxfmwC 4F4wDzRhJcdifB/yjNMZ5G3erKd/OfN+FSOVFH47fw9mPeksV18b36AI6LRmm6449Mrq b1Mg== 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=gwX+FwxscpZy4HIFrB5LvxGSk+kESwzRQWk9wZG0nyY=; b=RwOBUDb4kvTQO+6ARvRQiOxEoGA78u9tjkrXdTMnk3CRxKoZMvF97zCNzWyA3xKcXc G2ej/dK+LCD3D+ObP17C/0b26TtHrdffC76b+9VhjZnxhGzTwZmuLJ0dGtTc6jzg4iB8 zsVi8IhdWbj089A4n4xA0o3zDZMn4qqgx99hJt/wghs5T0XAoUoQfOLRFxbldM1BhfG7 H5360nyQsaz/dNyJKpbER4gJZ7XVPZfkHG9ZJm63rr0wKI+dnU8RgCjmNqTftum6+wmh XieMmzm5Eau0Tg58lrpBKtbyy1SnrQjhiJ1COifQCglQyx0WcHmIZFXCtA1BrSj2deSc 5lWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wjsxEPi2; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si7310458pgn.530.2019.04.04.02.36.40; Thu, 04 Apr 2019 02:36:55 -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=wjsxEPi2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731847AbfDDJGc (ORCPT + 99 others); Thu, 4 Apr 2019 05:06:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731878AbfDDJGb (ORCPT ); Thu, 4 Apr 2019 05:06:31 -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 D3E6121903; Thu, 4 Apr 2019 09:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368790; bh=S7h+1oHFVi4/xwDCSJu8zozHdCRLvs6me0aBynF4QlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wjsxEPi2hzGJaUl1sRyHXbq0RNqjpfWq7n+Lxy+F661I5y/gpqR/8wMF/v6Qsg2VD bozD8V+Fzu2+Q25U1nV+YuriXC2snFLVxfi5W2mLSHq6GaXOoeyBmyeiTAmBNwGqBK hO9Uk8RmPeNR6Hwr/L0QgChddtcFYalu6HEYI6kI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Paul Kocialkowski , Maxime Ripard , Sasha Levin Subject: [PATCH 4.19 171/187] drm: Auto-set allow_fb_modifiers when given modifiers at plane init Date: Thu, 4 Apr 2019 10:48:28 +0200 Message-Id: <20190404084611.152555146@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 6153cbda239f..d36b1be632d9 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -211,6 +211,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