drm/mediatek: init RDMA with valid buffer
RDMA is initialized with buffer pointer 0. This creates IOMMU errors
when the DMA try to read this unmapped address.
Instead of initializing with 0, initialize it with some allocated
buffer address.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Change-Id: I98162ce1fe1b08eb602fce577bb0f146259b5f86
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 98bc695..731ea04 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -300,12 +300,16 @@
/* Initially configure all planes */
for (i = 0; i < mtk_crtc->layer_nr; i++) {
struct drm_plane *plane = &mtk_crtc->planes[i];
+ struct drm_framebuffer *fb = plane->state->fb;
struct mtk_plane_state *plane_state;
struct mtk_ddp_comp *comp = mtk_crtc->ddp_comp[0];
+ struct drm_gem_object *gem = fb->obj[0];
+ struct mtk_drm_gem_obj *mtk_gem = to_mtk_gem_obj(gem);
unsigned int comp_layer_nr = mtk_ddp_comp_layer_nr(comp);
unsigned int local_layer;
plane_state = to_mtk_plane_state(plane->state);
+ plane_state->pending.addr = mtk_gem->dma_addr;
if (i >= comp_layer_nr) {
comp = mtk_crtc->ddp_comp[1];