Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751969AbcDPVsI (ORCPT ); Sat, 16 Apr 2016 17:48:08 -0400 Received: from mail-yw0-f177.google.com ([209.85.161.177]:35499 "EHLO mail-yw0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbcDPVsG (ORCPT ); Sat, 16 Apr 2016 17:48:06 -0400 MIME-Version: 1.0 In-Reply-To: <5711D698.4030606@synopsys.com> References: <1460735338.3248.21.camel@synopsys.com> <5711D698.4030606@synopsys.com> Date: Sat, 16 Apr 2016 17:48:04 -0400 Message-ID: Subject: Re: Allocation of frame buffer at a specific memory range or address From: Rob Clark To: Vineet Gupta Cc: Alexey Brodkin , "dri-devel@lists.freedesktop.org" , "daniel@ffwll.ch" , "linux-kernel@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "airlied@linux.ie" , "devicetree@vger.kernel.org" , Rob Herring Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1669 Lines: 55 On Sat, Apr 16, 2016 at 2:07 AM, Vineet Gupta wrote: > On Friday 15 April 2016 09:18 PM, Alexey Brodkin wrote: > >> And now the question is how to force DRM subsystem or just that driver >> to use whatever predefined (say via device tree) location in memory >> for data buffer allocation. > > It seems this is pretty easy to do with DT reserved-memory binding. > > You need to partition memory into @memory and @reserved-memory. > Later can be subdivided into more granular regions and your driver can refer to > one of the regions. jfyi, it might be useful to look at msm_init_vram() which has support to wrap vram carveout as gem buffer, for exact same purpose.. BR, -R > Something like below (untested) > > + memory { > + device_type = "memory"; > + reg = <0x0 0x80000000 0x0 0xA0000000>; > + #address-cells = <2>; > + #size-cells = <2>; > + }; > + > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <2>; > + ranges; > + /* This memory bypasses IOC port */ > + fb_reserved@A0000000 { > + reg = <0x0 0xA0000000 0x0 0xAF000000>; > + #address-cells = <2>; > + #size-cells = <2>; > + /* no-map; */ > + }; > + }; > + > + > + fb0: video@12300000 { > + memory-region = <&fb_reserved>; > + /* ... */ > + }; > > This might also need a DT helper in ARC mm init code. > > + early_init_fdt_scan_reserved_mem(); > > HTH, > -Vineet