All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v2] drm/arcpgu: Get use of dedicated memory area for frame buffer
@ 2016-04-28 14:19 ` Alexey Brodkin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, linux-snps-arc, Alexey Brodkin, Dave Airlie,
	Daniel Vetter, devicetree

This mini-series allows to allocate frame buffer memory in desired
location. Allocation of a frame buffer memory in a special memory region
allows bypassing of so-called IO Coherency aperture which is typically set
as a range 0x8z-0xAz.

I.e. all data traffic to PGU bypasses IO Coherency block
and saves its bandwidth for other peripherals.

Cc: Dave Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: devicetree@vger.kernel.org

Changes v1 -> v2:
 * Reserved memory size bumped from 16Mb to 32Mb.

 * Reserved area in AXS103 boards moved to the very end of available DDR.

Alexey Brodkin (2):
  drm/arcpgu: use dedicated memory area for frame buffer
  ARC: [axs10x] Specify reserved memory for frame buffer

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

-- 
2.5.5

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

* [PATCH 0/2 v2] drm/arcpgu: Get use of dedicated memory area for frame buffer
@ 2016-04-28 14:19 ` Alexey Brodkin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: linux-snps-arc

This mini-series allows to allocate frame buffer memory in desired
location. Allocation of a frame buffer memory in a special memory region
allows bypassing of so-called IO Coherency aperture which is typically set
as a range 0x8z-0xAz.

I.e. all data traffic to PGU bypasses IO Coherency block
and saves its bandwidth for other peripherals.

Cc: Dave Airlie <airlied at gmail.com>
Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: devicetree at vger.kernel.org

Changes v1 -> v2:
 * Reserved memory size bumped from 16Mb to 32Mb.

 * Reserved area in AXS103 boards moved to the very end of available DDR.

Alexey Brodkin (2):
  drm/arcpgu: use dedicated memory area for frame buffer
  ARC: [axs10x] Specify reserved memory for frame buffer

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

-- 
2.5.5

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

* [PATCH 1/2 v2] drm/arcpgu: use dedicated memory area for frame buffer
  2016-04-28 14:19 ` Alexey Brodkin
@ 2016-04-28 14:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, linux-snps-arc, Alexey Brodkin, Dave Airlie, Daniel Vetter

Now when ARC supports reserved memory areas and
per-device coherent DMA allocations we may switch ARC PGU
to use of those dedicated areas.

One of the benefits we may move frame-buffer area out
from IO Coherency aperture and so significantly
reduce IOC utilization allowing less demanding
peripherals to use all perks of IOC.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Dave Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
---

No changes v1 -> v2.

 drivers/gpu/drm/arc/arcpgu_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 5b35e5db..76e187a 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -19,6 +19,7 @@
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_atomic_helper.h>
+#include <linux/of_reserved_mem.h>
 
 #include "arcpgu.h"
 #include "arcpgu_regs.h"
@@ -135,6 +136,11 @@ static int arcpgu_load(struct drm_device *drm)
 	dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
 		 arc_pgu_read(arcpgu, ARCPGU_REG_ID));
 
+	/* Get the optional framebuffer memory resource */
+	ret = of_reserved_mem_device_init(drm->dev);
+	if (ret && ret != -ENODEV)
+		return ret;
+
 	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
 		return -ENODEV;
 
-- 
2.5.5

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

* [PATCH 1/2 v2] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-04-28 14:19   ` Alexey Brodkin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: linux-snps-arc

Now when ARC supports reserved memory areas and
per-device coherent DMA allocations we may switch ARC PGU
to use of those dedicated areas.

One of the benefits we may move frame-buffer area out
from IO Coherency aperture and so significantly
reduce IOC utilization allowing less demanding
peripherals to use all perks of IOC.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Dave Airlie <airlied at gmail.com>
Cc: Daniel Vetter <daniel at ffwll.ch>
---

No changes v1 -> v2.

 drivers/gpu/drm/arc/arcpgu_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 5b35e5db..76e187a 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -19,6 +19,7 @@
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_atomic_helper.h>
+#include <linux/of_reserved_mem.h>
 
 #include "arcpgu.h"
 #include "arcpgu_regs.h"
@@ -135,6 +136,11 @@ static int arcpgu_load(struct drm_device *drm)
 	dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
 		 arc_pgu_read(arcpgu, ARCPGU_REG_ID));
 
+	/* Get the optional framebuffer memory resource */
+	ret = of_reserved_mem_device_init(drm->dev);
+	if (ret && ret != -ENODEV)
+		return ret;
+
 	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
 		return -ENODEV;
 
-- 
2.5.5

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

* [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
  2016-04-28 14:19 ` Alexey Brodkin
  (?)
@ 2016-04-28 14:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, linux-snps-arc, Alexey Brodkin, Vineet Gupta, devicetree

Allocation of a frame buffer memory in a special memory region
allows bypassing of so-called IO Coherency aperture
which is typically set as a range 0x8z-0xAz.

I.e. all data traffic to PGU bypasses IO Coherency block
and saves its bandwidth for other peripherals.

Even though for AXS101 (which sorts ARC770 CPU) IOC is not
an option for a sake of keeping one DT description for the
base-board (axs10x_mb.dtsi) we're still defining reserved
memory location in the very end of DDR.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: devicetree@vger.kernel.org
---

Changes v1 -> v2:
 * Reserved memory size bumped from 16Mb to 32Mb.
   Given the corner case 1920x1080x24bpp and tripl-buffering
   we'll need ~18Mb in the future so let's reserve 32Mb today
   and don't think about that any more.

 * Reserved area in AXS103 boards moved to the very end of the first Gb.
   Even though we use only 512Mb for kernel on AXS103 board
   we have 1Gb of DDR really. So let's move reserved area in the very
   end of available mamory. This way we'll be able to keep this mapping
   when we'll want to use > 512Mb in the kernel.

 * And while at it correct "ranges" value for AXS101 board: we do have
   only 512 Mb of DDR on the board so let's not temp users to try to use more.

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
index 420dcfd..262496a 100644
--- a/arch/arc/boot/dts/axc001.dtsi
+++ b/arch/arc/boot/dts/axc001.dtsi
@@ -93,8 +93,26 @@
 	memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
-		ranges = <0x00000000 0x80000000 0x40000000>;
+		ranges = <0x00000000 0x80000000 0x20000000>;
 		device_type = "memory";
-		reg = <0x80000000 0x20000000>;	/* 512MiB */
+		reg = <0x80000000 0x1b000000>;	/* (512 - 32) MiB */
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * We just move frame buffer area to the very end of
+		 * available DDR. And even though in case of ARC770 there's
+		 * no strict requirement for a frame-buffer to be in any
+		 * particular location it allows us to use the same
+		 * base board's DT node for ARC PGU as for ARc HS38.
+		 */
+		frame_buffer: frame_buffer@9e000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x9e000000 0x2000000>;
+			no-map;
+		};
 	};
 };
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index f90fadf..35ece04 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -100,4 +100,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer@be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index 06a9f29..df9ddb6 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -123,4 +123,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer@be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 823f15c..64b063d 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -283,7 +283,7 @@
 			encoder-slave = <&adv7511>;
 			clocks = <&pguclk>;
 			clock-names = "pxlclk";
-
+			memory-region = <&frame_buffer>;
 			port {
 				pgu_output: endpoint {
 					remote-endpoint = <&adv7511_input>;
-- 
2.5.5

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

* [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
@ 2016-04-28 14:19   ` Alexey Brodkin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: dri-devel
  Cc: devicetree, Vineet Gupta, linux-snps-arc, Alexey Brodkin, linux-kernel

Allocation of a frame buffer memory in a special memory region
allows bypassing of so-called IO Coherency aperture
which is typically set as a range 0x8z-0xAz.

I.e. all data traffic to PGU bypasses IO Coherency block
and saves its bandwidth for other peripherals.

Even though for AXS101 (which sorts ARC770 CPU) IOC is not
an option for a sake of keeping one DT description for the
base-board (axs10x_mb.dtsi) we're still defining reserved
memory location in the very end of DDR.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: devicetree@vger.kernel.org
---

Changes v1 -> v2:
 * Reserved memory size bumped from 16Mb to 32Mb.
   Given the corner case 1920x1080x24bpp and tripl-buffering
   we'll need ~18Mb in the future so let's reserve 32Mb today
   and don't think about that any more.

 * Reserved area in AXS103 boards moved to the very end of the first Gb.
   Even though we use only 512Mb for kernel on AXS103 board
   we have 1Gb of DDR really. So let's move reserved area in the very
   end of available mamory. This way we'll be able to keep this mapping
   when we'll want to use > 512Mb in the kernel.

 * And while at it correct "ranges" value for AXS101 board: we do have
   only 512 Mb of DDR on the board so let's not temp users to try to use more.

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
index 420dcfd..262496a 100644
--- a/arch/arc/boot/dts/axc001.dtsi
+++ b/arch/arc/boot/dts/axc001.dtsi
@@ -93,8 +93,26 @@
 	memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
-		ranges = <0x00000000 0x80000000 0x40000000>;
+		ranges = <0x00000000 0x80000000 0x20000000>;
 		device_type = "memory";
-		reg = <0x80000000 0x20000000>;	/* 512MiB */
+		reg = <0x80000000 0x1b000000>;	/* (512 - 32) MiB */
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * We just move frame buffer area to the very end of
+		 * available DDR. And even though in case of ARC770 there's
+		 * no strict requirement for a frame-buffer to be in any
+		 * particular location it allows us to use the same
+		 * base board's DT node for ARC PGU as for ARc HS38.
+		 */
+		frame_buffer: frame_buffer@9e000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x9e000000 0x2000000>;
+			no-map;
+		};
 	};
 };
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index f90fadf..35ece04 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -100,4 +100,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer@be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index 06a9f29..df9ddb6 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -123,4 +123,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer@be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 823f15c..64b063d 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -283,7 +283,7 @@
 			encoder-slave = <&adv7511>;
 			clocks = <&pguclk>;
 			clock-names = "pxlclk";
-
+			memory-region = <&frame_buffer>;
 			port {
 				pgu_output: endpoint {
 					remote-endpoint = <&adv7511_input>;
-- 
2.5.5

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

* [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
@ 2016-04-28 14:19   ` Alexey Brodkin
  0 siblings, 0 replies; 11+ messages in thread
From: Alexey Brodkin @ 2016-04-28 14:19 UTC (permalink / raw)
  To: linux-snps-arc

Allocation of a frame buffer memory in a special memory region
allows bypassing of so-called IO Coherency aperture
which is typically set as a range 0x8z-0xAz.

I.e. all data traffic to PGU bypasses IO Coherency block
and saves its bandwidth for other peripherals.

Even though for AXS101 (which sorts ARC770 CPU) IOC is not
an option for a sake of keeping one DT description for the
base-board (axs10x_mb.dtsi) we're still defining reserved
memory location in the very end of DDR.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Vineet Gupta <vgupta at synopsys.com>
Cc: devicetree at vger.kernel.org
---

Changes v1 -> v2:
 * Reserved memory size bumped from 16Mb to 32Mb.
   Given the corner case 1920x1080x24bpp and tripl-buffering
   we'll need ~18Mb in the future so let's reserve 32Mb today
   and don't think about that any more.

 * Reserved area in AXS103 boards moved to the very end of the first Gb.
   Even though we use only 512Mb for kernel on AXS103 board
   we have 1Gb of DDR really. So let's move reserved area in the very
   end of available mamory. This way we'll be able to keep this mapping
   when we'll want to use > 512Mb in the kernel.

 * And while at it correct "ranges" value for AXS101 board: we do have
   only 512 Mb of DDR on the board so let's not temp users to try to use more.

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
index 420dcfd..262496a 100644
--- a/arch/arc/boot/dts/axc001.dtsi
+++ b/arch/arc/boot/dts/axc001.dtsi
@@ -93,8 +93,26 @@
 	memory {
 		#address-cells = <1>;
 		#size-cells = <1>;
-		ranges = <0x00000000 0x80000000 0x40000000>;
+		ranges = <0x00000000 0x80000000 0x20000000>;
 		device_type = "memory";
-		reg = <0x80000000 0x20000000>;	/* 512MiB */
+		reg = <0x80000000 0x1b000000>;	/* (512 - 32) MiB */
+	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * We just move frame buffer area to the very end of
+		 * available DDR. And even though in case of ARC770 there's
+		 * no strict requirement for a frame-buffer to be in any
+		 * particular location it allows us to use the same
+		 * base board's DT node for ARC PGU as for ARc HS38.
+		 */
+		frame_buffer: frame_buffer at 9e000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x9e000000 0x2000000>;
+			no-map;
+		};
 	};
 };
diff --git a/arch/arc/boot/dts/axc003.dtsi b/arch/arc/boot/dts/axc003.dtsi
index f90fadf..35ece04 100644
--- a/arch/arc/boot/dts/axc003.dtsi
+++ b/arch/arc/boot/dts/axc003.dtsi
@@ -100,4 +100,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer at be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axc003_idu.dtsi b/arch/arc/boot/dts/axc003_idu.dtsi
index 06a9f29..df9ddb6 100644
--- a/arch/arc/boot/dts/axc003_idu.dtsi
+++ b/arch/arc/boot/dts/axc003_idu.dtsi
@@ -123,4 +123,18 @@
 		device_type = "memory";
 		reg = <0x80000000 0x20000000>;	/* 512MiB */
 	};
+
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		/*
+		 * Move frame buffer out of IOC aperture (0x8z-0xAz).
+		 */
+		frame_buffer: frame_buffer at be000000 {
+			compatible = "shared-dma-pool";
+			reg = <0xbe000000 0x2000000>;
+			no-map;
+		};
+	};
 };
diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index 823f15c..64b063d 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -283,7 +283,7 @@
 			encoder-slave = <&adv7511>;
 			clocks = <&pguclk>;
 			clock-names = "pxlclk";
-
+			memory-region = <&frame_buffer>;
 			port {
 				pgu_output: endpoint {
 					remote-endpoint = <&adv7511_input>;
-- 
2.5.5

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

* Re: [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
  2016-04-28 14:19   ` Alexey Brodkin
  (?)
@ 2016-04-29 10:49     ` Vineet Gupta
  -1 siblings, 0 replies; 11+ messages in thread
From: Vineet Gupta @ 2016-04-29 10:49 UTC (permalink / raw)
  To: Alexey Brodkin, dri-devel
  Cc: devicetree, Vineet Gupta, linux-snps-arc, linux-kernel

On Thursday 28 April 2016 07:49 PM, Alexey Brodkin wrote:
> Even though for AXS101 (which sorts ARC770 CPU) IOC is not
> an option for a sake of keeping one DT description for the
> base-board (axs10x_mb.dtsi) we're still defining reserved
> memory location in the very end of DDR.
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Acked-by: Vineet Gupta <vgupta@synopsys.com>

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

* Re: [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
@ 2016-04-29 10:49     ` Vineet Gupta
  0 siblings, 0 replies; 11+ messages in thread
From: Vineet Gupta @ 2016-04-29 10:49 UTC (permalink / raw)
  To: Alexey Brodkin, dri-devel
  Cc: devicetree, Vineet Gupta, linux-snps-arc, linux-kernel

On Thursday 28 April 2016 07:49 PM, Alexey Brodkin wrote:
> Even though for AXS101 (which sorts ARC770 CPU) IOC is not
> an option for a sake of keeping one DT description for the
> base-board (axs10x_mb.dtsi) we're still defining reserved
> memory location in the very end of DDR.
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Acked-by: Vineet Gupta <vgupta@synopsys.com>

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

* [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
@ 2016-04-29 10:49     ` Vineet Gupta
  0 siblings, 0 replies; 11+ messages in thread
From: Vineet Gupta @ 2016-04-29 10:49 UTC (permalink / raw)
  To: linux-snps-arc

On Thursday 28 April 2016 07:49 PM, Alexey Brodkin wrote:
> Even though for AXS101 (which sorts ARC770 CPU) IOC is not
> an option for a sake of keeping one DT description for the
> base-board (axs10x_mb.dtsi) we're still defining reserved
> memory location in the very end of DDR.
> 
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>

Acked-by: Vineet Gupta <vgupta at synopsys.com>

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

* Fwd: [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory for frame buffer
       [not found]         ` <1464694143.6538.18.camel@synopsys.com>
@ 2016-06-02  7:35           ` Vineet Gupta
  0 siblings, 0 replies; 11+ messages in thread
From: Vineet Gupta @ 2016-06-02  7:35 UTC (permalink / raw)
  To: linux-snps-arc

On Tuesday 31 May 2016 04:59 PM, Alexey Brodkin wrote:
> Hi Vineet!
>
> On Thu, 2016-05-26@09:29 +0000, Vineet Gupta wrote:
>> On Thursday 26 May 2016 02:38 PM, Alexey Brodkin wrote:
>>>  1) IOC aperture is set to cover 0x8000_0000-0xA000_0000
>>>  2) FB area is 0xBE00_0000 - 0xC000_0000
>> So if someone rebuilds AXS103 with 1GB of memory in DT then they are screwed
>> because 0xa000_0000 to 0xBDFF_FFFF will not be io-coherent. A DMA buffer in that
>> range will be corrupt.
>>
>> The point is this IOC window programming must be tied to amount of memory in DT
>> and not assume 512MB
>> This is needed for supporting other customer platforms !
> Ok so actually what I think worth doing here is reverse our current logic.
> As of today we treat all memory except that special "reserved" region as covered
> by IOC. But if we want to have more robust IOC usage IMHO it would be better to
> specify dedicated "reserved area" for IOC and everything else let go outside of IOC
> aperture.

Not really - we want to utilize hardware capabilities to maximum - not minimum -
as in exception should be when IOC can't be used and not the other way around.
> This approach will allow:
>  [1] Having 1 known "reserved area" in DT parse its start and length and according to
>      it set IOC. Moreover here we'll do checks on proper start and size settings.
>      Remember IOc aperture should be 4kB aligned and size is set as
>      2^(SIZE+2)kB (which is 4*2^SIZE kB).
>  [2] Remove possible side-effects (if there're any - and that's quite interesting to
>      check) that could be caused by memory operations not related to peripherals but
>      still falling in IOC aperture and thus somehow additionally loading IOC snooper
>      logic.

I'm not sure what you imply by point #2 above.

> Only downside (which might not be a downside really) we'll need to specify IOC-covered
> memory for each peripheral that we want to use DMA. Well and probably not all drivers
> support memory allocation from reserved memory blocks, remember my commit that adds
> this feature to ARC PGU. As of today only ARM HDLCD and ARC PGU utilize
> of_reserved_mem_device_init().

Thats exactly my point above. We need to add for exception and not common case.

> Now thinking a bit more about this implementation I understood that we'll need to
> improve our DMA cache ops so different ops could be used for different memory areas.
> As of today if IOC is enabled we don't do any cache ops for DMAed data and fortunately
> PGU's frame-buffer is used as uncached so no cache ops are required. But if for some
> reason another peripheral is put outside IOC aperture we'll definitely need to do
> explicit cache flush/invalidation on its data buffers.

I really like this idea - this will certainly be needed for silicon
implementations which will likely have per peripheral IOC setting (such as routing
to IOC port or not) in addition to the blanket Core setting of IOC aperture. Thus
we can use that per device dma op hooks to do this additional ioc foo.

In the mean time, the pressing issue is potentially ticking time bomb of AXS103
broken (IOC + PGU + 1GB DDR) - let us add a boot time check in platform code to
panic if that is the case.

-Vineet

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

end of thread, other threads:[~2016-06-02  7:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28 14:19 [PATCH 0/2 v2] drm/arcpgu: Get use of dedicated memory area for frame buffer Alexey Brodkin
2016-04-28 14:19 ` Alexey Brodkin
2016-04-28 14:19 ` [PATCH 1/2 v2] drm/arcpgu: use " Alexey Brodkin
2016-04-28 14:19   ` Alexey Brodkin
2016-04-28 14:19 ` [PATCH 2/2 v2] ARC: [axs10x] Specify reserved memory " Alexey Brodkin
2016-04-28 14:19   ` Alexey Brodkin
2016-04-28 14:19   ` Alexey Brodkin
2016-04-29 10:49   ` Vineet Gupta
2016-04-29 10:49     ` Vineet Gupta
2016-04-29 10:49     ` Vineet Gupta
     [not found]   ` <57468A6C.9080505@synopsys.com>
     [not found]     ` <1464253672.4578.8.camel@synopsys.com>
     [not found]       ` <C2D7FE5348E1B147BCA15975FBA23075F4EAE493@us01wembx1.internal.synopsys.com>
     [not found]         ` <1464694143.6538.18.camel@synopsys.com>
2016-06-02  7:35           ` Fwd: " Vineet Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.