Skip to content

Commit dc3ae06

Browse files
smaeulmripard
authored andcommitted
drm/sun4i: Remove obsolete references to PHYS_OFFSET
commit b4bdc4f ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") added a platform device notifier that sets the DMA offset for all of the display engine frontend and backend devices. The code applying the offset to DMA buffer physical addresses was then removed from the backend driver in commit 756668b ("drm/sun4i: backend: Remove the MBUS quirks"), but the code subtracting PHYS_OFFSET was left in the frontend driver. As a result, the offset was applied twice in the frontend driver. This likely went unnoticed because it only affects specific configurations (scaling or certain pixel formats) where the frontend is used, on boards with both one of these older SoCs and more than 1 GB of DRAM. In addition, the references to PHYS_OFFSET prevent compiling the driver on architectures where PHYS_OFFSET is not defined. Fixes: b4bdc4f ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") Reviewed-by: Jernej Skrabec <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 94f4c49 commit dc3ae06

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/gpu/drm/sun4i/sun4i_frontend.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,18 @@ void sun4i_frontend_update_buffer(struct sun4i_frontend *frontend,
222222

223223
/* Set the physical address of the buffer in memory */
224224
paddr = drm_fb_cma_get_gem_addr(fb, state, 0);
225-
paddr -= PHYS_OFFSET;
226225
DRM_DEBUG_DRIVER("Setting buffer #0 address to %pad\n", &paddr);
227226
regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR0_REG, paddr);
228227

229228
if (fb->format->num_planes > 1) {
230229
paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 2 : 1);
231-
paddr -= PHYS_OFFSET;
232230
DRM_DEBUG_DRIVER("Setting buffer #1 address to %pad\n", &paddr);
233231
regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR1_REG,
234232
paddr);
235233
}
236234

237235
if (fb->format->num_planes > 2) {
238236
paddr = drm_fb_cma_get_gem_addr(fb, state, swap ? 1 : 2);
239-
paddr -= PHYS_OFFSET;
240237
DRM_DEBUG_DRIVER("Setting buffer #2 address to %pad\n", &paddr);
241238
regmap_write(frontend->regs, SUN4I_FRONTEND_BUF_ADDR2_REG,
242239
paddr);

0 commit comments

Comments
 (0)