Re: [PATCH 2/2] ARC: [axs10x] Specify reserved memory for frame buffer
Hi Vineet, On Thu, 2016-04-28 at 19:26 +0530, Vineet Gupta wrote: > On Thursday 28 April 2016 07:16 PM, Alexey Brodkin wrote: > > > > > > > > > > > > > Note that the IOC start alignment needs to follow > > > > max(4k, size). What will be maximum size of frame buffer - 16M always ! > > What do you mean by that? > For HS38, we intend to bypass the frame buffer traffic from IOC port. So the > frame > buffer start needs to be inside the IOC aperture base address. That value > can't be > arbitrary - it is atleast 4K aligned value and further also needs to be > aligned to > the size of aperture. So if the size is 16M it needs to be 16M aligned etc... The point is we want to put frame buffer memory OUTSIDE IOC aperture. So we allocate FB memory in the very end of DDR which is far away from IOC. And in that case IOC alignment issues are out of the question here. -Alexey ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH 1/2 v2] drm/arcpgu: use dedicated memory area for frame buffer
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 BrodkinCc: Dave Airlie Cc: Daniel Vetter --- 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 #include #include +#include #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 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 2/2] ARC: [axs10x] Specify reserved memory for frame buffer
Hi Vineet, On Thu, 2016-04-28 at 09:56 +0530, Vineet Gupta wrote: [snip] > > > > diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi > > index 420dcfd..ae6162d 100644 > > --- a/arch/arc/boot/dts/axc001.dtsi > > +++ b/arch/arc/boot/dts/axc001.dtsi > > @@ -95,6 +95,24 @@ > > #size-cells = <1>; > > ranges = <0x 0x8000 0x4000>; > > device_type = "memory"; > > - reg = <0x8000 0x2000>; /* 512MiB */ > > + reg = <0x8000 0x1f00>; /* 512 - 16 MiB */ > Is 16MB fixed size or is this a function of display resolution / density etc. Indeed this value depends on screen resolution and bpp and double- or even tripple-buffering (once this becomes supported in the driver). So as of now the corner case would be 1920x1080, 16 bits per pixel which gives ~4Mb. Now if we add support of triple-buffering we'll need ~12Mb so I booked a little bit more - 16Mb. But now I recalled that we also support r8g8b8 mode and in this case 3 bytes are used for color encoding, which effectively gives ~6Mb for 1 FullHD frame. And for tripple-buffering we'll need > 18Mb, so probably we'll need to go for 24 or even 32 Mb. [snip] > > + > > + reserved-memory { > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > > + /* > > + * Move frame buffer out of IOC aperture (0x8z-0xAz). > > + */ > > + frame_buffer: frame_buffer@bf00 { > > + compatible = "shared-dma-pool"; > > + reg = <0xbf00 0x100>; > Can this be made a bit more future safe. AXS103 has 1 GB of DDR while kernel > currently only uses 512M. Once we increase that, this will need fixing too. > Better > to make this as far possible. Makes sense. Will move it to the very end of 1Gb. > Note that the IOC start alignment needs to follow > max(4k, size). What will be maximum size of frame buffer - 16M always ! What do you mean by that? -Alexey ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc