video: tegra: Fix handling non-zero Y offset
Taekhyun Kim [Tue, 25 Jan 2011 23:31:45 +0000 (15:31 -0800)]
Original-Change-Id: I6ce3f66075856397b394f433a4ee29ff3357b548
Reviewed-on: http://git-master/r/16977
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R1c5786f094067ccdfed27e08c972cff3d0592f38

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/fb.c

index f778aeb..c1b29be 100644 (file)
@@ -126,6 +126,7 @@ struct tegra_dc_win {
 
        void                    *virt_addr;
        dma_addr_t              phys_addr;
+       unsigned                offset;
        unsigned                offset_u;
        unsigned                offset_v;
        unsigned                stride;
index ce5eea2..371d8fd 100644 (file)
@@ -552,7 +552,9 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n)
 
                tegra_dc_writel(dc, 0, DC_WIN_BUF_STRIDE);
                tegra_dc_writel(dc, 0, DC_WIN_UV_BUF_STRIDE);
-               tegra_dc_writel(dc, (unsigned long)win->phys_addr,
+               tegra_dc_writel(dc,
+                               (unsigned long)win->phys_addr +
+                               (unsigned long)win->offset,
                                DC_WINBUF_START_ADDR);
 
                if (!yuvp) {
index 9b7d5f8..a921ca8 100644 (file)
@@ -436,9 +436,10 @@ static int tegra_fb_set_windowattr(struct tegra_fb_info *tegra_fb,
        win->cur_handle = flip_win->handle;
 
        /* STOPSHIP verify that this won't read outside of the surface */
-       win->phys_addr = flip_win->phys_addr + flip_win->attr.offset;
-       win->offset_u = flip_win->attr.offset_u + flip_win->attr.offset;
-       win->offset_v = flip_win->attr.offset_v + flip_win->attr.offset;
+       win->phys_addr = flip_win->phys_addr;
+       win->offset = flip_win->attr.offset;
+       win->offset_u = flip_win->attr.offset_u;
+       win->offset_v = flip_win->attr.offset_v;
        win->stride = flip_win->attr.stride;
        win->stride_uv = flip_win->attr.stride_uv;