video: tegra: host: Fix leak in 3D register read
Terje Bergstrom [Wed, 15 Aug 2012 09:12:16 +0000 (12:12 +0300)]
When 3D register is read, and we need to do a context switch, the old
context reference is incremented, but it never gets decremented. Fix
by using nvhost_job_get_hwctx() to acquire the reference.

Bug 1031746

Change-Id: Ic72637cb2399f960e2297733bfe45e585a8ec180
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/123678
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/video/tegra/host/host1x/host1x_channel.c

index 1d02537..3c07460 100644 (file)
@@ -365,7 +365,7 @@ static int host1x_channel_read_3d_reg(
                if (hwctx_to_save) {
                        syncpt_incrs += hwctx_to_save->save_incrs;
                        hwctx_to_save->hwctx.valid = true;
-                       channel->ctxhandler->get(&hwctx_to_save->hwctx);
+                       nvhost_job_get_hwctx(job, &hwctx_to_save->hwctx);
                }
                channel->cur_ctx = hwctx;
                if (channel->cur_ctx && channel->cur_ctx->valid) {