linux/drivers/gpu/drm/sun4i
Chen-Yu Tsai 4690803b09 drm/sun4i: backend: Offset layer buffer address by DRAM starting address
The display backend, as well as other peripherals that have a DRAM
clock gate and access DRAM directly, bypassing the system bus,
address the DRAM starting from 0x0, while physical addresses the
system uses starts from 0x40000000 (or 0x20000000 in A80's case).

This issue was witnessed on the Cubietruck, which has 2GB of RAM.

Devices with less RAM function normally due to the DRAM address
wrapping around. CMA seems to always allocate its buffer at a
very high address, close to the end of DRAM.

On a 1GB RAM device, the physical address would be something like
0x78000000. The DRAM address 0x78000000 would access the same DRAM
region as 0x38000000 on a system, as the DRAM address would only
span 0x0 ~ 0x3fffffff. The bit 0x40000000 is non-functional in this
case.

However on the Cubietruck, the DRAM is 2GB. The physical address
is 0x40000000 ~ 0xbfffffff. The buffer would be something like
0xb8000000. But the DRAM address span 0x0 ~ 0x7fffffff, meaning
the buffer address wraps around to 0x38000000, which is wrong.
The correct DRAM address for it should be 0x78000000.

Correct the address configured into the backend layer registers
by PHYS_OFFSET to account for this.

Fixes: 9026e0d122 ("drm: Add Allwinner A10 Display Engine support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171017042349.31743-6-wens@csie.org
2017-10-17 16:25:45 +02:00
..
Kconfig drm/sun4i: cec: Enable back CEC-pin framework 2017-09-22 08:42:17 +02:00
Makefile drm/sun4i: hdmi: Implement I2C adapter for A10s DDC bus 2017-07-17 08:21:39 +02:00
sun4i_backend.c drm/sun4i: backend: Offset layer buffer address by DRAM starting address 2017-10-17 16:25:45 +02:00
sun4i_backend.h drm/sun4i: abstract a engine type 2017-06-01 09:47:23 +02:00
sun4i_crtc.c drm: Convert atomic drivers from CRTC .disable() to .atomic_disable() 2017-06-30 14:53:15 +02:00
sun4i_crtc.h drm/sun4i: abstract a engine type 2017-06-01 09:47:23 +02:00
sun4i_dotclock.c drm/sun4i: dotclock: Round to closest clock rate 2016-09-20 09:19:31 +02:00
sun4i_dotclock.h
sun4i_drv.c drm/sun4i: don't add components that are already in the queue 2017-10-16 09:53:44 +02:00
sun4i_drv.h drm/sun4i: abstract a engine type 2017-06-01 09:47:23 +02:00
sun4i_framebuffer.c drm/sun4i: Use drm_gem_fb_create() 2017-10-01 17:03:55 +02:00
sun4i_framebuffer.h
sun4i_hdmi_ddc_clk.c drm/sun4i: hdmi: Add support for controller hardware variants 2017-10-11 09:53:33 +02:00
sun4i_hdmi_enc.c drm/sun4i: hdmi: Move PAD_CTRL1 setting to mode_set function 2017-10-16 09:54:46 +02:00
sun4i_hdmi_i2c.c drm/sun4i: hdmi: Add support for controller hardware variants 2017-10-11 09:53:33 +02:00
sun4i_hdmi_tmds_clk.c drm/sun4i: hdmi: Add support for controller hardware variants 2017-10-11 09:53:33 +02:00
sun4i_hdmi.h drm/sun4i: hdmi: Document PAD_CTRL1 output invert bits 2017-10-16 09:54:21 +02:00
sun4i_layer.c Allwinner DRM changes for 4.14 2017-08-21 09:05:01 +10:00
sun4i_layer.h drm/sun4i: abstract a engine type 2017-06-01 09:47:23 +02:00
sun4i_rgb.c Allwinner DRM changes for 4.14 2017-08-21 09:05:01 +10:00
sun4i_rgb.h drm/sun4i: rgb: Pass tcon pointer when initializing RGB encoder 2017-03-07 22:18:24 +01:00
sun4i_tcon.c drm/sun4i: tcon: Add support for demuxing TCON output on A31 2017-10-11 09:52:50 +02:00
sun4i_tcon.h drm/sun4i: tcon: Add variant callback for TCON output muxing 2017-10-11 09:52:36 +02:00
sun4i_tv.c Allwinner DRM changes for 4.14 2017-08-21 09:05:01 +10:00
sun6i_drc.c Merge tag 'drm-misc-next-2016-11-16' of git://anongit.freedesktop.org/git/drm-misc into drm-next 2016-11-17 08:02:46 +10:00
sun8i_layer.c drm: Plumb modifiers through plane init 2017-08-01 17:50:06 +01:00
sun8i_layer.h drm/sun4i: add support for Allwinner DE2 mixers 2017-06-01 09:49:54 +02:00
sun8i_mixer.c drm/sun4i: add support for Allwinner DE2 mixers 2017-06-01 09:49:54 +02:00
sun8i_mixer.h drm/sun4i: add support for Allwinner DE2 mixers 2017-06-01 09:49:54 +02:00
sunxi_engine.h drm/sun4i: abstract a engine type 2017-06-01 09:47:23 +02:00