devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Allocation of frame buffer at a specific memory range or address
       [not found] ` <1460735338.3248.21.camel-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
@ 2016-04-16  6:07   ` Vineet Gupta
  2016-04-16 21:48     ` Rob Clark
  0 siblings, 1 reply; 2+ messages in thread
From: Vineet Gupta @ 2016-04-16  6:07 UTC (permalink / raw)
  To: Alexey Brodkin,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
  Cc: daniel-/w4YWyX8dFk@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	airlied-cv59FeDIM0c@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring

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.

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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Allocation of frame buffer at a specific memory range or address
  2016-04-16  6:07   ` Allocation of frame buffer at a specific memory range or address Vineet Gupta
@ 2016-04-16 21:48     ` Rob Clark
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Clark @ 2016-04-16 21:48 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: devicetree@vger.kernel.org, Alexey Brodkin,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-snps-arc@lists.infradead.org

On Sat, Apr 16, 2016 at 2:07 AM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-16 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1460735338.3248.21.camel@synopsys.com>
     [not found] ` <1460735338.3248.21.camel-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2016-04-16  6:07   ` Allocation of frame buffer at a specific memory range or address Vineet Gupta
2016-04-16 21:48     ` Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).