From patchwork Mon Dec 24 12:25:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10742241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F69F13BF for ; Mon, 24 Dec 2018 12:26:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 383E228A96 for ; Mon, 24 Dec 2018 12:26:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A1EC28AA4; Mon, 24 Dec 2018 12:26:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92BDC28A96 for ; Mon, 24 Dec 2018 12:26:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED83B89938; Mon, 24 Dec 2018 12:26:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E6FE89938 for ; Mon, 24 Dec 2018 12:26:24 +0000 (UTC) Received: by mail.bootlin.com (Postfix, from userid 110) id 23A5D20A46; Mon, 24 Dec 2018 13:26:23 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-38-38.w90-88.abo.wanadoo.fr [90.88.157.38]) by mail.bootlin.com (Postfix) with ESMTPSA id DBC8B206F9; Mon, 24 Dec 2018 13:26:12 +0100 (CET) From: Paul Kocialkowski To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/vc4: Allow fb modifiers early enough to fill IN_FORMATS property Date: Mon, 24 Dec 2018 13:25:51 +0100 Message-Id: <20181224122551.9912-1-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Eben Upton , David Airlie , Paul Kocialkowski , Thomas Petazzoni Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The KMS mode_config elements are currently configured in vc4_kms_load, that is called after all components are binded (component_bind_all). However, the CRTC component (for the Pixel Valve) needs to access the allow_fb_modifiers element at bind time, when initializing its planes through drm_universal_plane_init. This helpers checks allow_fb_modifiers to decide whether to fill the IN_FORMATS property. Because allow_fb_modifiers is still set to false at this point, the property is never filled and userspace cannot retrieve the combination of supported formats and modifiers. Fix this by setting allow_fb_modifiers right after calling drm_mode_config_init (which initializes the structure), before binding the components of the driver. Fixes: 423ad7b3cbd1 ("drm/vc4: Advertise supported modifiers for planes") Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_kms.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 7195a0bcceb3..5c24f80dd34e 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -273,6 +273,7 @@ static int vc4_drm_bind(struct device *dev) goto dev_put; drm_mode_config_init(drm); + drm->mode_config.allow_fb_modifiers = true; vc4_gem_init(drm); diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index b0cbb869f659..b70931fd8cf0 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -530,7 +530,6 @@ int vc4_kms_load(struct drm_device *dev) dev->mode_config.funcs = &vc4_mode_funcs; dev->mode_config.preferred_depth = 24; dev->mode_config.async_page_flip = true; - dev->mode_config.allow_fb_modifiers = true; drm_modeset_lock_init(&vc4->ctm_state_lock);