Message ID | 20230609062050.2107143-5-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp750232vqr; Thu, 8 Jun 2023 23:37:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wkXNM4Kprjuf88S5qxSMHvhUNLq6IJyezaJb8uPlT9vr86d0c+w4wG5aej+Sw5jX0et9K X-Received: by 2002:a17:902:ce90:b0:1aa:d545:462e with SMTP id f16-20020a170902ce9000b001aad545462emr590062plg.13.1686292660899; Thu, 08 Jun 2023 23:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686292660; cv=none; d=google.com; s=arc-20160816; b=ReLkIJQjXtUNZ45XBgswN30inKR0cydY0Ny356FnAskTHXcrurl1fkKk+dbWuDWHTU Gbt0PlLfGjKii1pU9mdQUKOuyp6Nwb5pOAks+Vd/7PCOnHW9HXvf+rqVcWnE3BQQ0HcV eK9xbDTGjUGLGa80W61qPyosj24dB+5CpfJsviYT330ruwNKrakAb+ODQF7GX21TQ8Fm kH7V+RD2ZEbrDId/Rn1hiHbMNQ33rrkMZyUtoXWcx7+OvX6MbozpmOAGHaVy34WKe27f eAjSLVGP8DVyat3n46h335KKi0fj1eTW81n9XW7EN32b+rWT4qDYltJKPXMbS+xW5aT9 zFlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iGNFX6HEdIKRiw8NKvPwhXc8R+GQd9GHBG/7VCCQih4=; b=s1OWqZMeRUb4Ji998YTMI97Er7mNPmz5ftatbGrfnl+tcaeVF8RTC7h5TUKifrCGKp DJuXrEH07sV5+22kAuxavIjppTRfnWuM5+odh9Fmmr8MzE1NQiEpTMw7enK+h7ZNWT4I +EaGApg8oHNh4xKIucHgPWU+uwFB2qfKbjCJCEj4h3zNQmWQbrZZbx9UfiLuiaOOoON3 kAtEuxS1rhCUAzOHt50Hap18SNgMdnRMxjNp/6QKsw8bWlJeS+Cp3qBzRfSKRlaBw6fM Ra6yTIsXyG3mnl1WMSvp5T5xZ0FCuWS+qT2R7b20SsP/wM6KX27+X9kkdMmlodChxplo kDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="M/5/NpTF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z8-20020a170903018800b001b1be1317a1si2460407plg.219.2023.06.08.23.37.27; Thu, 08 Jun 2023 23:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="M/5/NpTF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237878AbjFIGVY (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 02:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237720AbjFIGVL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 02:21:11 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656A92119 for <linux-kernel@vger.kernel.org>; Thu, 8 Jun 2023 23:21:09 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-51492ae66a4so2133471a12.1 for <linux-kernel@vger.kernel.org>; Thu, 08 Jun 2023 23:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1686291667; x=1688883667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iGNFX6HEdIKRiw8NKvPwhXc8R+GQd9GHBG/7VCCQih4=; b=M/5/NpTFFGCRpQ6Zin9qb9E+Y65G+15U8vBcdXBhKs2ziuqY9ne2OMuK1rKdp1YynY oa6vtGFNCboTCqlpxK6MP3hC0Z8+ZlqlWgCvLTrWhND0vLpGIyWQJmPWuF6cogAOP2js EClF5qAkMaZyWVM7yJWgvLRRy9WQ+t2GO8J3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686291667; x=1688883667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iGNFX6HEdIKRiw8NKvPwhXc8R+GQd9GHBG/7VCCQih4=; b=J9tSJFVoorGsisBpJUdlS3g4rZ+DSV24NCNewIKYjfvyqO+Dr89g6tQgz4iDfYdwHz OeeL1nHp6Dq5ZSKxuLfdHGUr0jgdNJACD4vMq/OGeVazN+qaZHQKfE+KSqwBu7D2piXa KK9e3sTa5KvAso9cW2jEXWKjnL2VsSyn4jcd8FVqdVnksQltI/wluK7MJb7jPLaiGIIG 1DKQ1XQzCW7gOvwKDaX7OSTmdJFBICZF7XNn0OVBkUhIezD7v8uncBZixZcAb10RrrBS UhcShy2DJ8kxQShAnBk8F20jn2AOQZbu0uIgXQ1QVdfKouhgGNGW51Tmhbx/mRuOk1F2 FdxA== X-Gm-Message-State: AC+VfDy5K83GOV2OShSl60chIdIWvZpQ+BCP1fRTONxfKYc/ITYndCtG /H7GWw1X/UQTLr2sggJrKiJVhPFtooWz+fzhqkm26w== X-Received: by 2002:aa7:c40b:0:b0:517:6ed9:6629 with SMTP id j11-20020aa7c40b000000b005176ed96629mr416496edq.21.1686291667668; Thu, 08 Jun 2023 23:21:07 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-248-31-20.retail.telecomitalia.it. [95.248.31.20]) by smtp.gmail.com with ESMTPSA id m7-20020aa7d347000000b005149461b1e0sm1380058edr.25.2023.06.08.23.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 23:21:07 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: michael@amarulasolutions.com, Amarula patchwork <linux-amarula@amarulasolutions.com>, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Philippe Cornu <philippe.cornu@foss.st.com>, Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>, Yannick Fertre <yannick.fertre@foss.st.com>, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v3 4/4] drm/stm: add an option to change FB bpp Date: Fri, 9 Jun 2023 08:20:50 +0200 Message-Id: <20230609062050.2107143-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230609062050.2107143-1-dario.binacchi@amarulasolutions.com> References: <20230609062050.2107143-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768206013350550296?= X-GMAIL-MSGID: =?utf-8?q?1768206013350550296?= |
Series | Add display support on the stm32f746-disco board | |
Commit Message
Dario Binacchi
June 9, 2023, 6:20 a.m. UTC
Boards that use the STM32F{4,7} series have limited amounts of RAM. The
added parameter allows users to size, within certain limits, the memory
footprint required by the framebuffer.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes in v3:
- drop [4/6] dt-bindings: display: simple: add Rocktech RK043FN48H
Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next):
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c42a37a27c777d63961dd634a30f7c887949491a
- drop [5/6] drm/panel: simple: add support for Rocktech RK043FN48H panel
Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=13cdd12a9f934158f4ec817cf048fcb4384aa9dc
drivers/gpu/drm/stm/drv.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Comments
On 6/9/23 08:20, Dario Binacchi wrote: > Boards that use the STM32F{4,7} series have limited amounts of RAM. The > added parameter allows users to size, within certain limits, the memory > footprint required by the framebuffer. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > Changes in v3: > - drop [4/6] dt-bindings: display: simple: add Rocktech RK043FN48H > Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next): > https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c42a37a27c777d63961dd634a30f7c887949491a > - drop [5/6] drm/panel: simple: add support for Rocktech RK043FN48H panel > Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next) > https://cgit.freedesktop.org/drm/drm-misc/commit/?id=13cdd12a9f934158f4ec817cf048fcb4384aa9dc > > drivers/gpu/drm/stm/drv.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c > index 422220df7d8c..65be2b442a6a 100644 > --- a/drivers/gpu/drm/stm/drv.c > +++ b/drivers/gpu/drm/stm/drv.c > @@ -30,6 +30,11 @@ > #define STM_MAX_FB_WIDTH 2048 > #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ > > +static uint stm_bpp = 16; > + > +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); > +module_param_named(bpp, stm_bpp, uint, 0644); > + > static const struct drm_mode_config_funcs drv_mode_config_funcs = { > .fb_create = drm_gem_fb_create, > .atomic_check = drm_atomic_helper_check, > @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) > ddev->mode_config.min_height = 0; > ddev->mode_config.max_width = STM_MAX_FB_WIDTH; > ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; > + ddev->mode_config.preferred_depth = stm_bpp; > ddev->mode_config.funcs = &drv_mode_config_funcs; > ddev->mode_config.normalize_zpos = true; > > @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) > if (ret) > goto err_put; > > - drm_fbdev_dma_setup(ddev, 16); > + drm_fbdev_dma_setup(ddev, stm_bpp); > > return 0; > Acked-by: Philippe Cornu <philippe.cornu@foss.st.com> Many thanks, Philippe :-)
Hi On Tue, Jun 13, 2023 at 4:41 PM Philippe CORNU <philippe.cornu@foss.st.com> wrote: > > > > On 6/9/23 08:20, Dario Binacchi wrote: > > Boards that use the STM32F{4,7} series have limited amounts of RAM. The > > added parameter allows users to size, within certain limits, the memory > > footprint required by the framebuffer. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > --- > > > > Changes in v3: > > - drop [4/6] dt-bindings: display: simple: add Rocktech RK043FN48H > > Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next): > > https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c42a37a27c777d63961dd634a30f7c887949491a > > - drop [5/6] drm/panel: simple: add support for Rocktech RK043FN48H panel > > Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next) > > https://cgit.freedesktop.org/drm/drm-misc/commit/?id=13cdd12a9f934158f4ec817cf048fcb4384aa9dc > > > > drivers/gpu/drm/stm/drv.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c > > index 422220df7d8c..65be2b442a6a 100644 > > --- a/drivers/gpu/drm/stm/drv.c > > +++ b/drivers/gpu/drm/stm/drv.c > > @@ -30,6 +30,11 @@ > > #define STM_MAX_FB_WIDTH 2048 > > #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ > > > > +static uint stm_bpp = 16; > > + > > +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); > > +module_param_named(bpp, stm_bpp, uint, 0644); > > + > > static const struct drm_mode_config_funcs drv_mode_config_funcs = { > > .fb_create = drm_gem_fb_create, > > .atomic_check = drm_atomic_helper_check, > > @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) > > ddev->mode_config.min_height = 0; > > ddev->mode_config.max_width = STM_MAX_FB_WIDTH; > > ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; > > + ddev->mode_config.preferred_depth = stm_bpp; > > ddev->mode_config.funcs = &drv_mode_config_funcs; > > ddev->mode_config.normalize_zpos = true; > > > > @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) > > if (ret) > > goto err_put; > > > > - drm_fbdev_dma_setup(ddev, 16); > > + drm_fbdev_dma_setup(ddev, stm_bpp); > > > > return 0; > > > > Acked-by: Philippe Cornu <philippe.cornu@foss.st.com> > Many thanks, > Philippe :-) > According to the latest review on usb patchset: "Please do not add new module parameters, this is not the 1990's anymore. We have per-device settings everywhere, this makes that impossible. Just use a DT value, if it is wrong, then fix the DT value! No need to have the kernel override it, that's not what DT files are for." I think it makes more sense to have dts parameters. Should maybe apply here too Michael
On 6/13/23 16:52, Michael Nazzareno Trimarchi wrote: > Hi > > On Tue, Jun 13, 2023 at 4:41 PM Philippe CORNU > <philippe.cornu@foss.st.com> wrote: >> >> >> On 6/9/23 08:20, Dario Binacchi wrote: >>> Boards that use the STM32F{4,7} series have limited amounts of RAM. The >>> added parameter allows users to size, within certain limits, the memory >>> footprint required by the framebuffer. >>> >>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> >>> >>> --- >>> >>> Changes in v3: >>> - drop [4/6] dt-bindings: display: simple: add Rocktech RK043FN48H >>> Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next): >>> https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c42a37a27c777d63961dd634a30f7c887949491a >>> - drop [5/6] drm/panel: simple: add support for Rocktech RK043FN48H panel >>> Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next) >>> https://cgit.freedesktop.org/drm/drm-misc/commit/?id=13cdd12a9f934158f4ec817cf048fcb4384aa9dc >>> >>> drivers/gpu/drm/stm/drv.c | 8 +++++++- >>> 1 file changed, 7 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c >>> index 422220df7d8c..65be2b442a6a 100644 >>> --- a/drivers/gpu/drm/stm/drv.c >>> +++ b/drivers/gpu/drm/stm/drv.c >>> @@ -30,6 +30,11 @@ >>> #define STM_MAX_FB_WIDTH 2048 >>> #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ >>> >>> +static uint stm_bpp = 16; >>> + >>> +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); >>> +module_param_named(bpp, stm_bpp, uint, 0644); >>> + >>> static const struct drm_mode_config_funcs drv_mode_config_funcs = { >>> .fb_create = drm_gem_fb_create, >>> .atomic_check = drm_atomic_helper_check, >>> @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) >>> ddev->mode_config.min_height = 0; >>> ddev->mode_config.max_width = STM_MAX_FB_WIDTH; >>> ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; >>> + ddev->mode_config.preferred_depth = stm_bpp; >>> ddev->mode_config.funcs = &drv_mode_config_funcs; >>> ddev->mode_config.normalize_zpos = true; >>> >>> @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) >>> if (ret) >>> goto err_put; >>> >>> - drm_fbdev_dma_setup(ddev, 16); >>> + drm_fbdev_dma_setup(ddev, stm_bpp); >>> >>> return 0; >>> >> Acked-by: Philippe Cornu <philippe.cornu@foss.st.com> >> Many thanks, >> Philippe :-) >> > According to the latest review on usb patchset: "Please do not add new > module parameters, this is not the 1990's anymore. > We have per-device settings everywhere, this makes that impossible. > Just use a DT value, if it is wrong, then fix the DT value! No need to > have the kernel override it, that's not what DT files are for." I actually am conflicted about this idea, but I still think that here the best option would be to put a device-tree property. In which context here the module parameters could be used ? I think a module parameter would be quite troublesome for userspace applications in that case. Raphaël > > I think it makes more sense to have dts parameters. Should maybe apply here too > > Michael
On 6/13/23 17:26, Raphael Gallais-Pou wrote: > > On 6/13/23 16:52, Michael Nazzareno Trimarchi wrote: >> Hi >> >> On Tue, Jun 13, 2023 at 4:41 PM Philippe CORNU >> <philippe.cornu@foss.st.com> wrote: >>> >>> >>> On 6/9/23 08:20, Dario Binacchi wrote: >>>> Boards that use the STM32F{4,7} series have limited amounts of RAM. The >>>> added parameter allows users to size, within certain limits, the memory >>>> footprint required by the framebuffer. >>>> >>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> >>>> >>>> --- >>>> >>>> Changes in v3: >>>> - drop [4/6] dt-bindings: display: simple: add Rocktech RK043FN48H >>>> Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next): >>>> https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c42a37a27c777d63961dd634a30f7c887949491a >>>> - drop [5/6] drm/panel: simple: add support for Rocktech RK043FN48H panel >>>> Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next) >>>> https://cgit.freedesktop.org/drm/drm-misc/commit/?id=13cdd12a9f934158f4ec817cf048fcb4384aa9dc >>>> >>>> drivers/gpu/drm/stm/drv.c | 8 +++++++- >>>> 1 file changed, 7 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c >>>> index 422220df7d8c..65be2b442a6a 100644 >>>> --- a/drivers/gpu/drm/stm/drv.c >>>> +++ b/drivers/gpu/drm/stm/drv.c >>>> @@ -30,6 +30,11 @@ >>>> #define STM_MAX_FB_WIDTH 2048 >>>> #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ >>>> >>>> +static uint stm_bpp = 16; >>>> + >>>> +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); >>>> +module_param_named(bpp, stm_bpp, uint, 0644); >>>> + >>>> static const struct drm_mode_config_funcs drv_mode_config_funcs = { >>>> .fb_create = drm_gem_fb_create, >>>> .atomic_check = drm_atomic_helper_check, >>>> @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) >>>> ddev->mode_config.min_height = 0; >>>> ddev->mode_config.max_width = STM_MAX_FB_WIDTH; >>>> ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; >>>> + ddev->mode_config.preferred_depth = stm_bpp; >>>> ddev->mode_config.funcs = &drv_mode_config_funcs; >>>> ddev->mode_config.normalize_zpos = true; >>>> >>>> @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) >>>> if (ret) >>>> goto err_put; >>>> >>>> - drm_fbdev_dma_setup(ddev, 16); >>>> + drm_fbdev_dma_setup(ddev, stm_bpp); >>>> >>>> return 0; >>>> >>> Acked-by: Philippe Cornu <philippe.cornu@foss.st.com> >>> Many thanks, >>> Philippe :-) >>> >> According to the latest review on usb patchset: "Please do not add new >> module parameters, this is not the 1990's anymore. >> We have per-device settings everywhere, this makes that impossible. >> Just use a DT value, if it is wrong, then fix the DT value! No need to >> have the kernel override it, that's not what DT files are for." > > > I actually am conflicted about this idea, but I still think that here the best > option would be to put a device-tree property. > > In which context here the module parameters could be used ? I think a module > parameter would be quite troublesome for userspace applications in that case. > > > Raphaël > >> >> I think it makes more sense to have dts parameters. Should maybe apply here too >> >> Michael Hi Raphaël & Michael, Many thanks for your comments. Dario's usage of this stm driver is STM32 MCUs (STM32F4 & F7...) where, sometimes, old userland fbdev-based applications are used, and I imagine it is maybe "easier" to use a module parameter (through the kernel command line or whatever...) in these use cases (even if using dt is always better and not that complex). Moreover, as I did not find any drm drivers with drm_fbdev_dma_setup() using a dt property "as example" (but always hard-coded value), then I decided to not block this proposal :) Thanks to your feedback, I am reconsidering my position. And sorry Dario, hope you understand it will take more time for reviewing your patch. Does anyone have an opinion to share on this point? Many thanks, Philippe :-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index 422220df7d8c..65be2b442a6a 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -30,6 +30,11 @@ #define STM_MAX_FB_WIDTH 2048 #define STM_MAX_FB_HEIGHT 2048 /* same as width to handle orientation */ +static uint stm_bpp = 16; + +MODULE_PARM_DESC(bpp, "bits-per-pixel (default: 16)"); +module_param_named(bpp, stm_bpp, uint, 0644); + static const struct drm_mode_config_funcs drv_mode_config_funcs = { .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, @@ -93,6 +98,7 @@ static int drv_load(struct drm_device *ddev) ddev->mode_config.min_height = 0; ddev->mode_config.max_width = STM_MAX_FB_WIDTH; ddev->mode_config.max_height = STM_MAX_FB_HEIGHT; + ddev->mode_config.preferred_depth = stm_bpp; ddev->mode_config.funcs = &drv_mode_config_funcs; ddev->mode_config.normalize_zpos = true; @@ -203,7 +209,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) if (ret) goto err_put; - drm_fbdev_dma_setup(ddev, 16); + drm_fbdev_dma_setup(ddev, stm_bpp); return 0;