Revert "video: tegra: add utility function to compute framebuffer stride"
Erik Gilling [Mon, 11 Oct 2010 22:36:11 +0000 (15:36 -0700)]
This reverts commit 10c751b8f5bb78f674d4939b47be933934bb23dd.

Change-Id: I236ddcd531d3ca17c8727cac84e6d2aa6e27dbe1

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

index 9a66c25..f33c724 100644 (file)
 #define TEGRA_MAX_DC           2
 #define DC_N_WINDOWS           3
 
-#define TEGRA_DC_PITCH_ATOM    16
-#define TEGRA_DC_TILED_ATOM    16
-
-enum tegra_win_layout {
-       TEGRA_WIN_LAYOUT_PITCH,
-       TEGRA_WIN_LAYOUT_TILED,
-       TEGRA_WIN_LAYOUT_LINEAR_TILED,
-};
-
 struct tegra_dc_mode {
        int     pclk;
        int     h_ref_to_sync;
@@ -105,7 +96,6 @@ struct tegra_dc_win {
        unsigned                out_w;
        unsigned                out_h;
        unsigned                z;
-       enum tegra_win_layout   layout;
 
        int                     dirty;
        struct tegra_dc         *dc;
@@ -181,7 +171,4 @@ int tegra_dc_sync_windows(struct tegra_dc_win *windows[], int n);
 
 int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode);
 
-ssize_t tegra_dc_compute_stride(int xres, int bpp,
-                               enum tegra_win_layout layout);
-
 #endif
index da114d8..65a36dd 100644 (file)
@@ -328,20 +328,6 @@ struct tegra_dc *tegra_dc_get_dc(unsigned idx)
 }
 EXPORT_SYMBOL(tegra_dc_get_dc);
 
-ssize_t tegra_dc_compute_stride(int xres, int bpp, enum tegra_win_layout layout)
-{
-       unsigned int raw_stride = (xres * bpp) / 8;
-       unsigned int k, n = 0;
-
-       if (layout == TEGRA_WIN_LAYOUT_PITCH)
-               return ALIGN(raw_stride, TEGRA_DC_PITCH_ATOM);
-       else if (layout == TEGRA_WIN_LAYOUT_TILED)
-               return ALIGN(raw_stride, TEGRA_DC_TILED_ATOM);
-       else
-               return -EINVAL;
-}
-EXPORT_SYMBOL(tegra_dc_compute_stride);
-
 struct tegra_dc_win *tegra_dc_get_window(struct tegra_dc *dc, unsigned win)
 {
        if (win >= dc->n_windows)
index 9e5bb16..87ba58b 100644 (file)
@@ -148,10 +148,7 @@ static int tegra_fb_set_par(struct fb_info *info)
        default:
                return -EINVAL;
        }
-
-       info->fix.line_length = tegra_dc_compute_stride(var->xres,
-                       var->bits_per_pixel, TEGRA_WIN_LAYOUT_PITCH);
-       tegra_fb->win->stride = info->fix.line_length;
+       info->fix.line_length = var->xres * var->bits_per_pixel / 8;
 
        if (var->pixclock) {
                struct tegra_dc_mode mode;
@@ -681,9 +678,7 @@ struct tegra_fb_info *tegra_fb_register(struct nvhost_device *ndev,
        win->z = 0;
        win->phys_addr = fb_phys;
        win->virt_addr = fb_base;
-       win->layout = TEGRA_WIN_LAYOUT_PITCH;
-       win->stride = tegra_dc_compute_stride(fb_data->xres,
-                                     fb_data->bits_per_pixel, win->layout);
+       win->stride = fb_data->xres * fb_data->bits_per_pixel / 8;
        win->flags = TEGRA_WIN_FLAG_ENABLED;
 
        if (fb_mem)