Received: by 10.213.65.68 with SMTP id h4csp375063imn; Wed, 28 Mar 2018 05:26:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx49X3CHF3Om3475ZjLi0FB25Nh54wno9KUCmNtabQs1FZ8qo+Dzjk7pCtoydr/YeoF1O5m07 X-Received: by 10.99.136.194 with SMTP id l185mr2459117pgd.419.1522239990740; Wed, 28 Mar 2018 05:26:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522239990; cv=none; d=google.com; s=arc-20160816; b=jpOi5K4VCP03KPzMC9naieENAbFsVqQ4nPyj7pqON+ubgSz25/a3byGWRKIOQjfXJ8 Tq2r95iFMtraeAofYpUNJJ6ayxq4pzA9rad4nLeJJdJt1PkgfkQGEDvgynGu4pIpy5EE eACxykr3GprRboGtZNwRnc1SVSjU6M0CZ7DbxWTXWa3kxitFwlr9ZlLou20TO/KGqR5A MYblunKnDDQYt8k5NJWGSC/lJeHZUAU18jH+hojmk7M6MaW9YNdIxo30A8jla4c1lJLI ivQHi0/KBekQJfRuC9cekEZOtf7+TgOcxwhmy8eKhwlC5rUNieP3C9PO7cKZKPMGjPcc IXrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=dnxMmFlF5bmP/XJh4yj+y9/v7A0heoexFguFtr0ezTI=; b=ZfUgkUbt3/By52LINmm95R0MAiEzG8Prp+Z5TYYCTJqUvQCObuTwH/HfsncB+sVTTI o64y22MA0CiA6BQ3zYdm/4ZkRh5SFtqLUaG8jfJroBCpn0BMNwpJcFbZe6X9iu9oB97e fbmgs54MORDOdoe8+3zKcvth71g5kwDb2H1YKltnTudvbjMMFGiRKkfI+DXcR7XVhJnj yvwJ4RyG4p7Ens/mbpK7KzHj+1iJtEteevzL96GR2s5xnZ4SHaatb1waYVj8WmKuS1/J OCRxDD1AMXf3RO//PjV/Aa2YI6rU1VcVQvv6fsXOLYoLT8hBdnyqRdcc8LyypDgaO5ma ujrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si3492431plr.182.2018.03.28.05.26.16; Wed, 28 Mar 2018 05:26:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbeC1MZQ (ORCPT + 99 others); Wed, 28 Mar 2018 08:25:16 -0400 Received: from mail.bootlin.com ([62.4.15.54]:55351 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbeC1MZP (ORCPT ); Wed, 28 Mar 2018 08:25:15 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 2FC472071F; Wed, 28 Mar 2018 14:25:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 7815E203B1; Wed, 28 Mar 2018 14:25:12 +0200 (CEST) Date: Wed, 28 Mar 2018 14:25:12 +0200 From: Boris Brezillon To: Daniel Vetter Cc: Peter Rosin , Egbert Eich , Boris Brezillon , Alexandre Belloni , David Airlie , Nicolas Ferre , Takashi Iwai , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] drm/atmel-hlcdc: add command line option to specify preferred depth Message-ID: <20180328142512.14f8c502@bbrezillon> In-Reply-To: <20180328122236.GF14155@phenom.ffwll.local> References: <20180326073502.19259-1-peda@axentia.se> <20180328093454.4149fa3b@bbrezillon> <20180328122236.GF14155@phenom.ffwll.local> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Mar 2018 14:22:36 +0200 Daniel Vetter wrote: > On Wed, Mar 28, 2018 at 09:34:54AM +0200, Boris Brezillon wrote: > > Hi Peter, > > > > On Mon, 26 Mar 2018 09:35:02 +0200 > > Peter Rosin wrote: > > > > > I have an sama5d31-based system with 64MB of memory and a 1920x1080 > > > LVDS display wired for 16-bpp. When I enable legacy fbdev support, > > > the contiguous memory allocator invariably fails with the order-11 > > > allocation for a 1920x1080@24-bpp buffer (~6MB). But this HW can never > > > make any good use of RGB888, so that is a wasted attempt anyway that > > > would also waste precious memory should it succeed. > > > > > > Sure, I could rewrite user-space to go directly to KMS etc, and that > > > makes the (attempted) order-11 allocation go away, replacing it with > > > one order-10 allocation per application restart for a 1920x1080@16-bpp > > > buffer (<4MB). But after a few restarts, order-10 allocations start to > > > fail as well, which is only to be expected AFAIU. > > > > > > So, I'd rather not change user-space (which was originally written > > > to target a smaller display) so that I at the same time get the > > > benefit of an early pre-allocated fbdev frame-buffer that can be > > > reused over and over. But to do that I need to tell the driver that > > > 16-bpp is the preferred depth. Add a module parameter to do just that. > > > > > > Signed-off-by: Peter Rosin > > > --- > > > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 18 +++++++++++++++++- > > > 1 file changed, 17 insertions(+), 1 deletion(-) > > > > > > I found some inspiration regarding naming and implementation here: > > > https://patchwork.kernel.org/patch/9848631/ > > > > > > I have found no feedback on that patch though, which makes me wonder if > > > I'm perhaps barking up the wronig tree? > > > > Hm, isn't that something you can already overload with the video= > > parameter? > > > > video=:[-] > > > > AFAIR, encodes the color depth, so what is the benefit of adding > > this new property to overload the default depth? > > > > Maybe I'm wrong and the default depth param is actually useful, but in > > this case we should probably make it generic since other drivers seems > > to need it too, and we might want to attach it to a specific display > > engine instance. > > I think for the drm's fbdev emulation we ignore the bpp ... Nope, it's already parsed [1]. [1]https://elixir.bootlin.com/linux/v4.16-rc3/source/drivers/gpu/drm/drm_fb_helper.c#L1812 -- Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com