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 796FFC4360F for ; Thu, 4 Apr 2019 09:06:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C32A214AF for ; Thu, 4 Apr 2019 09:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368792; bh=S7h+1oHFVi4/xwDCSJu8zozHdCRLvs6me0aBynF4QlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=m/T2qHk10yKNC2Dj5zuQfQKLPR0ztTbdL/9wHgb4OjbCFztbvXp06C5Is3+KOCJ6Q 3zZm5t36YrOJJmInPxbI0O8Qtp5s8ms4AfPeFYULHqZMt9o3zVxHtdf6Nfc9M8S/qC GnYSvKwzqB8BEHz4YAYpZnkg7TOMWb5utfX4c4yE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732327AbfDDJGb (ORCPT ); Thu, 4 Apr 2019 05:06:31 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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