Received: by 10.213.65.68 with SMTP id h4csp1226896imn; Thu, 29 Mar 2018 00:11:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dnl/lbtbr3q9qDlxnOwXbUbpjBTyRb6eo+cIsxhn+wnKE2ps1gdTdREm6xK6K6SfDzEIB X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr6908714plg.195.1522307500998; Thu, 29 Mar 2018 00:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522307500; cv=none; d=google.com; s=arc-20160816; b=mU/H6mOqRWQs2dTzognaTXVLRTosDf6lEHVgnJ4DpLSSMXF4BOwNZXWtuppqnVVjjb Toug4CanqGI6zsfI4Zmm4x9SkwDi0NRd79WwouY9clm2nmuVjNlw7c8Hu1A847m94B6k gC/j4WcbDrL9pxaaCw6BT40fqbHj7CO3qk/4bASZgg3kIt9wajB2OfTqCm+ScocYaB1T kLUU4KHR57IZwxTX3VwBVkQpEjrdprdyIb5RnV8azTpDy725bUHOmYFiUiuO1m8Q+SPh 0qlFlujXWxO/v4incSa+ApeilRX/L/+aT9GxtUy+6kvkBsl6sgGtNnk1oIanUCAieJw8 lEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=uc4FKdRbd30zulLY1wKb6JIAzBmgDok4zgxDpzDGyfU=; b=mIgsEhfd+htGu1PuE8UIJ3QFhWSo7G5tdbiMnLEMe0h7+coFHtBPWL6PE7GWawcBgl Cf4i4VmWnWOmSWUS9q8cPhqtuXv1ItlM7LulUrlgNrY6Tj2I3aNcbSRerDHUKfSxyiVA triftc/wTjKZaE6J3Cx2y+SIfy0y9+4TwRI5pHVSfoFH134hqEi8K8YfQ06D2sMga+3d Yzp//WlVM5fp5D7DS8shGvFZVERAg6X/JU/80eEu+DTlvOyuFXWEFTWIz4yIxkQ5tGd6 S9QEwbqj5CPNsh0lkpJ6cpVHVjhF1A0/QkLJL0hFpVdflXr3nfrYjInhaesIjpJL/VcH gwYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=k3EeCwk7; 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 f9-v6si5305170pln.542.2018.03.29.00.11.25; Thu, 29 Mar 2018 00:11:40 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=k3EeCwk7; 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 S1751008AbeC2HKb (ORCPT + 99 others); Thu, 29 Mar 2018 03:10:31 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55798 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeC2HKa (ORCPT ); Thu, 29 Mar 2018 03:10:30 -0400 Received: by mail-wm0-f66.google.com with SMTP id b127so8057694wmf.5 for ; Thu, 29 Mar 2018 00:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uc4FKdRbd30zulLY1wKb6JIAzBmgDok4zgxDpzDGyfU=; b=k3EeCwk7skwV8hzCQEu/yHMrzgaYOO5Ym+DzBL2T02PFZsG1HXSGW4Hwe/21daj4sh bqFJ2xQlLFcpgS8KLyp+Pd7Jbi6Pl1zLgw1DIk/VyYs2uLjz5fl2azEQoRtrLa3tTVU2 7tG5p28YZw66uFy9yPd4yYEJC5YDbgHYLKU/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=uc4FKdRbd30zulLY1wKb6JIAzBmgDok4zgxDpzDGyfU=; b=hlNs2Ee6Pz/1W6/N/427YKgtkHhiiTa1nH46eE2nlbfGOIcIu1BJS5GJs3S7ZcRj6b XoDC1pEinZPh93v619YS86SOzNOZ1iS/yO43vwRSv1BLod+Q4sf3wUqshkpMOd5j/AsJ yabyFTZo+hAznAfzOVHue82WA3bRo+yKpp5EgoL2HjdXxqLOpSsFyf+ERdsOpgoano5A nb8Nuetq6TWisJYuNUJHbG4fPOn7aUm4FNNv1NgwMjQ9RE30OrEX7zj7kXKvHLMLUjsN YTGAze2wD3YtjaGeJ89tLn3i7oZcCCYJLBLOTknAzGtVErJhQGZVHCK/VdQ2M28i3icp +CRw== X-Gm-Message-State: AElRT7HaOD4EB228WtaT9iM+PrI+59OzdGRI1pZLTcGjSzQXOgs93Mww kb4id4DsUvTqEftl/HC4bE91MQ== X-Received: by 10.80.243.18 with SMTP id p18mr6237709edm.235.1522307428819; Thu, 29 Mar 2018 00:10:28 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id k4sm1483691edi.12.2018.03.29.00.10.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Mar 2018 00:10:27 -0700 (PDT) Date: Thu, 29 Mar 2018 09:10:25 +0200 From: Daniel Vetter To: Boris Brezillon Cc: Daniel Vetter , 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: <20180329071025.GE3881@phenom.ffwll.local> Mail-Followup-To: Boris Brezillon , 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 References: <20180326073502.19259-1-peda@axentia.se> <20180328093454.4149fa3b@bbrezillon> <20180328122236.GF14155@phenom.ffwll.local> <20180328142512.14f8c502@bbrezillon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180328142512.14f8c502@bbrezillon> X-Operating-System: Linux phenom 4.15.0-1-amd64 User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 28, 2018 at 02:25:12PM +0200, Boris Brezillon wrote: > 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 Oh, totally missed this. I honestly wonder why we then have all the various bpp module options in different drivers ... -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch