media: tegra: nvavp: Fix for relocation offset
Gajanan Bhat [Fri, 22 Jul 2011 00:40:31 +0000 (17:40 -0700)]
Fix for bug in relocation offset calculation,
causing wrong surface offset to be sent to AVP.

Original-Change-Id: I6fea7c27a339238d6514276e3316f38ecf8d7742
Reviewed-on: http://git-master/r/42495
Tested-by: Gajanan Bhat <gbhat@nvidia.com>
Reviewed-by: Isaac Richards <irichards@nvidia.com>
Reviewed-by: Kaz Fukuoka <kfukuoka@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Soumen Kumar Dey <sdey@nvidia.com>
Tested-by: Soumen Kumar Dey <sdey@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

Rebase-Id: Re0091d2e8a67c61a6ed4a35ac4b3f2da3a34e8b3

drivers/media/video/tegra/nvavp/nvavp_dev.c

index 05f413c..d0f707c 100644 (file)
@@ -607,10 +607,12 @@ static int nvavp_pushbuffer_submit_ioctl(struct file *filp, unsigned int cmd,
                        goto err_reloc_info;
                }
 
-       reloc_addr = cmdbuf_data + (clientctx->relocs[i].cmdbuf_offset >> 2);
+               reloc_addr = cmdbuf_data +
+                            (clientctx->relocs[i].cmdbuf_offset >> 2);
+
                target_phys_addr = nvmap_handle_address(clientctx->nvmap,
                                            clientctx->relocs[i].target);
-               target_phys_addr += (clientctx->relocs[i].target_offset >> 2);
+               target_phys_addr += clientctx->relocs[i].target_offset;
                writel(target_phys_addr, reloc_addr);
        }