From bbf47520227fe64258b0ccd397f512f951ea7f5c Mon Sep 17 00:00:00 2001 From: Martin Radev Date: Tue, 21 Jan 2025 12:28:54 +0200 Subject: [PATCH] host1x_emu: fix syncpoint 0 WAR This patch fixes the existing WAR to not allocate syncpoint id 0. The bug was that indexing starts from 1, but syncpoint array starts from 0. The fix is to start syncpoint array iteration from 1 as well. Bug 5064819 Change-Id: I4120d83dd33ef134d80417dcf9e1c75b55b99719 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3287523 Reviewed-by: mobile promotions GVS: buildbot_gerritrpt Reviewed-by: Raghavendra Vishnu Kumar Tested-by: Martin Radev Reviewed-by: Amitabh Dutta Tested-by: mobile promotions --- drivers/gpu/host1x-emu/syncpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x-emu/syncpt.c b/drivers/gpu/host1x-emu/syncpt.c index 8f908531..b7b4c483 100644 --- a/drivers/gpu/host1x-emu/syncpt.c +++ b/drivers/gpu/host1x-emu/syncpt.c @@ -340,7 +340,7 @@ HOST1X_EMU_EXPORT_DECL(struct host1x_syncpt*, host1x_syncpt_alloc(struct host1x * dosen't effectively utilize per pool polling thread. */ /* FIXME: WAR to allocate syncpoint from index 1, As at client level synpt-id 0 is invalid*/ - for (i = host->syncpt_base + 1; i < host->syncpt_end; i++, sp++) { + for (i = host->syncpt_base + 1, sp = sp + 1; i < host->syncpt_end; i++, sp++) { /* Do pool verification if pool selected */ if ((pool != NULL) && (sp->pool != pool))