]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ps3fb: open-code macros that are used only once
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Wed, 6 Feb 2008 09:39:31 +0000 (01:39 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:17 +0000 (10:41 -0800)
Open-code the X_OFF(), Y_OFF(), WIDTH(), HEIGHT(), and VP_OFF() macros, as
they're used in one place only

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/ps3fb.c

index 069a6ed6e75be0351c80bd5f2d94cc1612fd5277..229727a5bc75f80e3b26f4be7b60e75da0e62105 100644 (file)
@@ -287,15 +287,8 @@ static const struct fb_videomode ps3fb_modedb[] = {
 #define HEAD_A
 #define HEAD_B
 
-#define X_OFF(i)       (ps3fb_res[i].xoff)     /* left/right margin (pixel) */
-#define Y_OFF(i)       (ps3fb_res[i].yoff)     /* top/bottom margin (pixel) */
-#define WIDTH(i)       (ps3fb_res[i].xres)     /* width of FB */
-#define HEIGHT(i)      (ps3fb_res[i].yres)     /* height of FB */
 #define BPP            4                       /* number of bytes per pixel */
 
-/* Start of the virtual frame buffer (relative to fullscreen ) */
-#define VP_OFF(i)      ((WIDTH(i) * Y_OFF(i) + X_OFF(i)) * BPP)
-
 
 static int ps3fb_mode;
 module_param(ps3fb_mode, int, 0);
@@ -611,7 +604,10 @@ static int ps3fb_set_par(struct fb_info *info)
 
        par->width = info->var.xres;
        par->height = info->var.yres;
-       offset = VP_OFF(i);
+
+       /* Start of the virtual frame buffer (relative to fullscreen) */
+       offset = ps3fb_res[i].yoff * ddr_line_length + ps3fb_res[i].xoff * BPP;
+
        par->fb_offset = GPU_ALIGN_UP(offset);
        par->full_offset = par->fb_offset - offset;
        par->pan_offset = info->var.yoffset * xdr_line_length +