Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1094023rwd; Thu, 1 Jun 2023 10:19:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IH/TW1peqLWpmj9HCqeRETBPhNylbYGVhOv1VRsfbU2WSrtbW2hBL3jPm4psiAw3j8e0f X-Received: by 2002:a17:903:1208:b0:1ac:750e:33d5 with SMTP id l8-20020a170903120800b001ac750e33d5mr81579plh.15.1685639993945; Thu, 01 Jun 2023 10:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685639993; cv=none; d=google.com; s=arc-20160816; b=OxHFZ/y+glndC0eN37BWa95XSXH4UHSbDs3tLwNGqQDKTDKhkRAx8iY11ryY6rvdMR oRwwdgXYPap6dlqcrZ0b+H1H0tt0z7H+QViCEdu1q9u5vZG6nTpeVCvHegKLTXCOqBqf Hw99pjqjT70QBzA52+NYCZPaQXonGxs6eiRgcCVaxF+3eZxvKNb7DDWxq7FC39y699HQ 6kV+KZiA6k0C+CMINT9Lh6x3h8dK7Tsm99ENYvnN2GZxte5q6lalbpomZfqv9at8v42A Eotc4ZanjqJM9UniRqIYHDK44soUTRV9k9hwpSe3/avD+ImInTnwRUWUbvo47A5YjPx8 WD1A== 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=Ftjev7ny28lvJRfWKN2KXX1gaG/LDneackQ782m2++c=; b=hdHsnfcEdECc3qjD71ejrN94A8H9lo5YgtKv+FoxBCnKz9T9ua+B2ROJT9LG0kX10s tZPvqvUncNF0m74XepEKPpD0b1oTb/dP1PHAyTf8BM+iUVZ8FormkU/89gHChpvh88Rp gsYXwz9R/35XTyVjH/Ua3rffMGApYrCRnLq+8Z4C+QYtTj+XZ4f6CneVjp7YQBF8sVEA 8s3Jfx3j2OjKD7x8Qo6xpgZ3MQ+NOJkncf4k1mEFpKIpu+v1N+RzASFrdUUcCPz3XSle w6G8gGDD8VL93D2TB/Sh85eP2B4fQuhxcDxzYeZxGjasB5w60IvzoDkZsbeOouiByIiB xC/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RXpREj32; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170902c3c300b0019e57f5a5aesi2907441plj.567.2023.06.01.10.19.41; Thu, 01 Jun 2023 10:19:53 -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=RXpREj32; 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 S232558AbjFAREN (ORCPT + 99 others); Thu, 1 Jun 2023 13:04:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjFARD5 (ORCPT ); Thu, 1 Jun 2023 13:03:57 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A2F9198 for ; Thu, 1 Jun 2023 10:03:56 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-96f7bf3cf9eso165764366b.0 for ; Thu, 01 Jun 2023 10:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685639034; x=1688231034; 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=Ftjev7ny28lvJRfWKN2KXX1gaG/LDneackQ782m2++c=; b=RXpREj32QF9glE5vpN59wgL/+UV12KKLNYA9IA5/BKkN5MgZGAFTz0Twq/Y4ZK8Udq 3MKAomKMltBYpKajAE7tTaJq0jTEmWFCGs2ZhQaB1L+TuroGqIzUDmhiCBh2XBcq0rQR wyY6MJzAzVQZ1h79fJtF4m08kX4kf4xEXSOBc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685639034; x=1688231034; 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=Ftjev7ny28lvJRfWKN2KXX1gaG/LDneackQ782m2++c=; b=bW1YPLK2A+aRXPVkImeE8EThQAV3rrNsj+uOk9jkkCms2bgJZACpBQDyVhN71g1Y8u Imbzr6QhYEkoR8KbxMX/bp/5u4yajtdJOvhS6JQh8xnHRBVyUIhzHa5ayCTnNP/wdmjx 97gk2H2O5zVQT0Ggj9Ij35YlKDFQFE5WyWCvF1x4fbbYkuv5tTB2x8Nbu10bRBWfAkxm 3CfX6ieDsXr/+n6nlD7Z1W7uy9211cP5cQq8NtUpLYDHQRW8k+ijoupHzwvxN5Fnagea j8k+daSr906HQ8FhzTEdsS4HECvWzgKxhUpSfXhNdQxJhJjo0RUzOvy2ugFiP7J4A6Ub DIQw== X-Gm-Message-State: AC+VfDyemODmw8vwl1pkmvosoa1C+lJAYlmLIs4gadUxywy4Nxp6b4J4 rPSMR2DyUt+RHCj77iL3XBe6pvXd55FK+JeV3P+0JA== X-Received: by 2002:a17:907:da3:b0:973:d2b6:f536 with SMTP id go35-20020a1709070da300b00973d2b6f536mr9135641ejc.21.1685639034375; Thu, 01 Jun 2023 10:03:54 -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 bh25-20020a170906a0d900b0096165b2703asm10658522ejb.110.2023.06.01.10.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 10:03:54 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Amarula patchwork , michael@amarulasolutions.com, Dario Binacchi , Alexandre Torgue , Daniel Vetter , David Airlie , Maxime Coquelin , Philippe Cornu , Raphael Gallais-Pou , Yannick Fertre , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 6/6] drm/stm: add an option to change FB bpp Date: Thu, 1 Jun 2023 19:03:20 +0200 Message-Id: <20230601170320.2845218-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230601170320.2845218-1-dario.binacchi@amarulasolutions.com> References: <20230601170320.2845218-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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.32.0