From patchwork Thu Jun 1 17:03:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13264307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D420C77B7A for ; Thu, 1 Jun 2023 17:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IZ6GyTmXm4z5x0zkzLXFxQSACH6rt1scJv6fPa4WOZE=; b=GaCmAnqLoIodV8 M3HPnuig9qFn0GMFRj5Cr48D4qaE/4sFgoxU22Gyt26kSYIUeEQLdbkg8aaWyNV6Q/lSkTMxkBfPS Uif8Qi55mTibIAU/PADfArK8iBnAELIYE5FmprOyRtQF0hXQ4U5EKiYaRrcZB69TW0Gt8+1spTGZk wAmFDaviWzh10pVGGSPlkiKFOuxT4Hmpg9lBlho3uDwCp4A7xQ1iDmR8MvSqddtbqFMI1g6InasC+ /5e1gT7359T4QROdRaCVZza05RRLwazqxtW45++LrLxukjdHCUU1a5V7DtXS0a9uuIt0yeujXODfi EVi8zpY7un6HNV6jbFYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q4liQ-004Lm3-0u; Thu, 01 Jun 2023 17:03:58 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q4liO-004Lkn-1O for linux-arm-kernel@lists.infradead.org; Thu, 01 Jun 2023 17:03:57 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-96f850b32caso162955666b.3 for ; Thu, 01 Jun 2023 10:03:55 -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=Xoh/jkqkeV0nW+URNPF6+hOsWnHYmsp8XETTkCeKFNKC316RjHqvN4J8QGfdopC76W 0XDwDd5bgsT/OyBXPw0jMP3wjDXqhtPu7SwS9L2R83mn3G32Pn6vQEoz1b3qQhntPtQE JzkvJW9X1K+DayWMPxwYAa38eMOKDBvsk1kfCOWuGR+V9cYu2E0sL0/z6yUeVleLtwXl 4vcKHWyZrYHnZLh1sHSObDLcJBHrD128nHtPla9lxKXdYeKrTEZFj3dXcD8jZfpNDZUI Ayo2ME9xD5VLYT/2SrxAbHXET9rITKMXEoro6BUB5XGn2UuCJ4FqD4rOxHJ4B5XOXqii 58Pg== X-Gm-Message-State: AC+VfDy4UNYi0swv94amhIKCAKOMtDi/z4KYAwP5uue/uzY80LGLfp7w sROQlSo0SNDPJtyEEEeOQNhsSw== X-Google-Smtp-Source: ACHHUZ5oUVMAwFD6jXFbU87iuAQJMHlHZ+OpaWeKz6pu4pcRR1a2Pb6wyFg0KLbejd0vnRuywS3xIQ== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230601_100356_467491_825D5486 X-CRM114-Status: GOOD ( 13.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;