drm/v3d: Flush the MMU before we supply more memory to the binner
BugLink: https://bugs.launchpad.net/bugs/2101915
[ Upstream commit d2fb8811108b2c1285c56f4fba4fff8fe3525593 ]
We must ensure that the MMU is flushed before we supply more memory to
the binner, otherwise we might end up with invalid MMU accesses by the
GPU.
Fixes: 57692c94dc ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923141348.2422499-3-mcanal@igalia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
[koichiroden: adjusted context due to missing commit:
51b76c1f3017 ("drm/v3d: Enable V3D to use different PAGE_SIZE")]
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
e708339e42
commit
c5fad09b83
@@ -536,6 +536,7 @@ void v3d_irq_disable(struct v3d_dev *v3d);
|
||||
void v3d_irq_reset(struct v3d_dev *v3d);
|
||||
|
||||
/* v3d_mmu.c */
|
||||
int v3d_mmu_flush_all(struct v3d_dev *v3d);
|
||||
int v3d_mmu_set_page_table(struct v3d_dev *v3d);
|
||||
void v3d_mmu_insert_ptes(struct v3d_bo *bo);
|
||||
void v3d_mmu_remove_ptes(struct v3d_bo *bo);
|
||||
|
||||
@@ -70,6 +70,8 @@ v3d_overflow_mem_work(struct work_struct *work)
|
||||
list_add_tail(&bo->unref_head, &v3d->bin_job->render->unref_list);
|
||||
spin_unlock_irqrestore(&v3d->job_lock, irqflags);
|
||||
|
||||
v3d_mmu_flush_all(v3d);
|
||||
|
||||
V3D_CORE_WRITE(0, V3D_PTB_BPOA, bo->node.start << PAGE_SHIFT);
|
||||
V3D_CORE_WRITE(0, V3D_PTB_BPOS, obj->size);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#define V3D_PTE_WRITEABLE BIT(29)
|
||||
#define V3D_PTE_VALID BIT(28)
|
||||
|
||||
static int v3d_mmu_flush_all(struct v3d_dev *v3d)
|
||||
int v3d_mmu_flush_all(struct v3d_dev *v3d)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user