From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC3CDC4360F for ; Thu, 4 Apr 2019 09:19:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 898F920652 for ; Thu, 4 Apr 2019 09:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369567; bh=4dGqVl3IPj5VehvGU0pniDoSmMaom/ZvlU/gAkdLQXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A0tBrbjxvQakmiS03gun15UCbMt1ggmK5vxqob1WMYSoGcC7ABsbqOhrCu521aHPZ waMWCjcFNnAAy4WWK6F1vUVqTjn8FgID9hBxmmK8+G/B/i/PmeS9nxEnoz6cVWK0YS P5l3hdyo98/qjEDZ5JoCIrtjRxH3vvue1xux7wp8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388281AbfDDJT0 (ORCPT ); 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