Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1009933yba; Thu, 4 Apr 2019 02:20:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8FpemrwKtUOldQ6biq6WTyyiXZCQzswp07szeNreop6bAc7g/eAIrRh335RAoBzOkR1vR X-Received: by 2002:a62:75d7:: with SMTP id q206mr4666889pfc.213.1554369639866; Thu, 04 Apr 2019 02:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369639; cv=none; d=google.com; s=arc-20160816; b=EIRASMyO4gJCc8uTd3a0AsGJqe7zVixQ+1HwuA6p1WYlVYDi/HT45W2CCa9kBIygtG W5EpNQqMo40dwU5dnJnuz07rzV1mstA0ofPK/8RWuLzh0XRu8g/RGw8SK2i+AWGvrjX6 T5sf7GZqR20gFvtENBs1Sl0dR2QcMb7nlzxo8PTJnATx5yHQ8LFZ9gZKl2ufPpL9pWrL DJ34LLtBi3QKMNIeug7VYxUSOcvUSlYrWCi3SSqvB0XcOoaF/EUBKT2ars4XGrJs6FHT 4R+6LD8Oj418RTKq5q99XzWeaggXI2nPSNVD5KxasNS5xatX8LaSHzzuiYzWJFNeZK/X PuQg== 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=QlkAKWY8Q8Yd3bZqNfF3pyFwpRfyjyhxFScLsjAJKTc=; b=whtbcxioimClF7AkVSoh1Ge3/P15uFB16VI3+jfQTtZw4FA5k8Y8y4JJ9jJ3hVyw89 9A7Q0wYuaaMct3lhQcuGo+mZFiVsRm/32rZZZyZfkjK7WddeWjzvgFOJZqOsjBiw1aYI KGHEJCqguC3J5+aHbqegzcf9nWvIa0Io1KLa8nWCVbo5FPvFIaVXcHr9FbIslwPjvRAb zLVARY3M9qtP/rg0p2tY+kdtxsy+gDs5Jb6BhNbwiE4xRuZZoty/kfB+Da0p87H+ZRRc LX4f5CjzINXfeNlyOH7OfTUsPkFo+e8d4N5QrlOkzw57D7AgfQcZcH3fADvWLKqMz5bx jBjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O3Pc6F5V; 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 p10si15938942plq.152.2019.04.04.02.20.25; Thu, 04 Apr 2019 02:20:39 -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=O3Pc6F5V; 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 S2388144AbfDDJT0 (ORCPT + 99 others); Thu, 4 Apr 2019 05:19:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:60060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733120AbfDDJSD (ORCPT ); Thu, 4 Apr 2019 05:18:03 -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 CDD1120652; Thu, 4 Apr 2019 09:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369483; bh=4dGqVl3IPj5VehvGU0pniDoSmMaom/ZvlU/gAkdLQXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3Pc6F5VGkp8W0SnKtQWYlDwh/8RFkCW0ROxzZJ4K7hDQfHPXz2GB5SEUThO3ta3M tr91eWUEvQMyg41kmW+GWyI+fOk1WGtigM4OlgFxVgXbzUoiLmx521LNMVZuuulpFC yT0b+rGCF3fGwAnC8t74npckHbXQfsXWmj8imgaA= 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 5.0 225/246] drm: Auto-set allow_fb_modifiers when given modifiers at plane init Date: Thu, 4 Apr 2019 10:48:45 +0200 Message-Id: <20190404084627.099723726@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@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 5.0-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 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