| Message ID | 20230609062050.2107143-5-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBVMJROSAMGQE7TU32YQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 97E613F057 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 9 Jun 2023 08:21:09 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5147e3dfccdsf1207609a12.1 for <linux-amarula@patchwork.amarulasolutions.com>; Thu, 08 Jun 2023 23:21:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686291669; cv=pass; d=google.com; s=arc-20160816; b=uY0kOLV/DMYuRwRQFh3c29nlTqR67+AWmbCGy+HPc7bGjg2x84P+ABwDcp5+m2rFMF F3ChPoCoTYYMkXln28gwfyoO6NrzWgc5NECmM4+WQnG3Y2fhG1tRNxg1RiQYZd6uRlFe ABxohlojBZ5Q+W4eAuzXPqkBdVtBytdjG6qtiHp/uNvCJxwoZgvYSa/pIdxV1zKr7cYi 04H+lkC2iTf6HaQ1ht+wiTl1x/CoNgFy9GrxGVTW54Vhs1y++SfIKjlUF40IcpvbVowP to6NXl4qPLMjdMgNt9OO/kyjtoiY1Pc8IOALY98bY4uFf+cMO222C3263xI4RJEBNoml Ld/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gRYqEngfxfEs/bcsAQB9O0oSFh2Ej48GJVXfBiL1P6g=; b=jtOqZnq+EJC/iBP13Qw1Q8OajVIRrQ4a8E6KV4g20F4GbTmaQ7cruklUBxvf8mO93B efjxPz/+xOzGBO65IHM5XIUDn8SOVQQ/qsOehYfzJXL/E6Sh8oI7TWOLF7TeCeT/Ur5B rpUl+AALjDtU+/3mnZ32P9cWjwlcvFayV82o5ycd80j+xmWfvBTXbfF6YyC9A7+aofrC 1oX7kYIaHZ1LK4C+a3fhwWsNqPGQ6Gr9CiiLLTIVl1rm2kfylXsI+Bk7MIOaazJsAg+u x4aTA7WqrM0ZXInkU3MeTOwYcf84EbfM/0PEmoLSL/tFgo4tK+LzuzKYNO2p3i/IiChN RZVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="M/5/NpTF"; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1686291669; x=1688883669; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=gRYqEngfxfEs/bcsAQB9O0oSFh2Ej48GJVXfBiL1P6g=; b=fWBS5gYGMnFV+kuRTY6VF3mKAOwVqB1XaO4vQENa0ClqnUEdmLVmRHIqGMwQWawNFq QSLescF3lW0gXmzIvlFtaw73OvoBojtgm6Zf9bsagsRrPeTavb6uLAH4o7Fhb8SZE0st rZB6+4TQluLwPaB5hM80+EfSFeoOP3sV0Lhns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686291669; x=1688883669; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gRYqEngfxfEs/bcsAQB9O0oSFh2Ej48GJVXfBiL1P6g=; b=C4fOrgIQMsnmS/aQIk4SXlgsKysrNFpTQuqJ8j+zlHhkA2dB6NEKP9/4y/Ekwe5d5D eqvDEjyIAIIAPpcCAXiJCTVVHP3jW5SWvbm30wB9r/Hu9fQ+P1aaIVEoapWgpQaY/2JU xDFf/Thfogre/5WUAfAm7FZIINiKO5ZKWaClF2Ru1KlKoPjJv+oCExYJXMqqWQ7o9pEW 0/3x1OsGOzI+LCf7Od+ylmLzHbcbw7p4CmY7ejnZitKVsKSGg7UfkJ7/ShdnuP0E0vqx M623H6lakFDIyUTiARckXJlaKuVYRyhCweq1Pq+0erJAaOK9j0kzE8VL90ku1IhNd5In XheQ== X-Gm-Message-State: AC+VfDw77JxHlFRWwoYvoHkGHjJeJXxFdGigb2xApM2QhcrYG7+q8sFD VyiBwEQk6D936olviHchHXaebne9 X-Google-Smtp-Source: ACHHUZ4t/l3LAPwfsJnKeE87xwHSzukezIsC4BoshjsJIU194UwHHZAxVKI9w5F7bJryRqvnl+at8w== X-Received: by 2002:a05:6402:1ada:b0:514:7afc:67d4 with SMTP id ba26-20020a0564021ada00b005147afc67d4mr376731edb.39.1686291669452; Thu, 08 Jun 2023 23:21:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2d0:b0:514:e4a3:f8d7 with SMTP id b16-20020a05640202d000b00514e4a3f8d7ls329385edx.1.-pod-prod-05-eu; Thu, 08 Jun 2023 23:21:08 -0700 (PDT) X-Received: by 2002:a17:907:969e:b0:94f:6058:4983 with SMTP id hd30-20020a170907969e00b0094f60584983mr737209ejc.76.1686291667913; Thu, 08 Jun 2023 23:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686291667; cv=none; d=google.com; s=arc-20160816; b=WPnCfXcw0UsScICKhV7casG7xO441/2QCb79/LmDD8Iob/xI3fKdXxqX6fC+PazmAI Y5KdReSxM6xZhU1n//X/vtdD54cmZkD5/jcS+oTmxm/oAHD6KQ3aCcUXu7hI+ptPpe0a g2dzbsWaZUIyRuFEcJ6EgFRVDyjxEEfmYK3wCEyWT3Nch6fSm113+EVn7sucKKjaM/pF CHtJLq8JYoUafvwFpOlpKXJhgioq3Uc/HZnZtfFrI6nM2bYPlFsmVeuRqdGAVT8HDJ5/ Ii1h/slFSB23BXLmLxoHgdpaqH0ntOVkKpWYKyWmSPRtyh3VXQ3Q9GWpAKUaHSl7iigi H5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=iGNFX6HEdIKRiw8NKvPwhXc8R+GQd9GHBG/7VCCQih4=; b=guYZsU+DhvMF0Ze01wPTpXlTRg3M96TlupTitwLyY9mlTf4/7+nQQB509jj+aPACPH tsti2zs6BixgBTCMyPn3iWLdVIGiHhpoKid1g0allAI6c1VgroRVpkPTMXsoPoQLhs5X 2FwBI92bmDNTT/hkidM2F3qqvGMOY2BAAiO/XH6I1DoklGRf2qpWgFxi0u7Jnk/tLEXr ID7k1fYMKTkcRLraUfKB1ZlpaBRZN26h/K+8jrKTYcHh9gSvwN4+F2UAir1XWQzgsAKf JY3U2M2IuVTq15tPEIdlZnRZ8Ei1g85U7UJ2geQqyn5zB+qbdJUZhbWpQEjP8aYuuN9u 8cCA== 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 dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id g25-20020a170906539900b0093c1e6b867dsor645255ejo.2.2023.06.08.23.21.07 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Thu, 08 Jun 2023 23:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-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 dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| 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;