From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
To: "Antonino A. Daplas" <adaplas@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-fbdev-devel@lists.sourceforge.net
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
Subject: [patch 04/11] ps3fb: Inline macros that are used only once
Date: Fri, 25 Jan 2008 16:06:27 +0100 [thread overview]
Message-ID: <20080125153107.177014292@vixen.sonytel.be> (raw)
In-Reply-To: 20080125150623.202631389@vixen.sonytel.be
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2028 bytes --]
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
ps3fb: inline 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>
---
drivers/video/ps3fb.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
--- a/drivers/video/ps3fb.c
+++ b/drivers/video/ps3fb.c
@@ -287,15 +287,8 @@ static const struct fb_videomode ps3fb_m
#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
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 +
--
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
next prev parent reply other threads:[~2008-01-25 15:06 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-25 15:06 [patch 00/11] ps3av/3fb patches for 2.6.25 Geert Uytterhoeven
2008-01-25 15:06 ` [patch 01/11] ps3av: ps3av_get_scanmode() and ps3av_get_refresh_rate() are unused Geert Uytterhoeven
2008-01-25 15:06 ` [patch 02/11] ps3: Use symbolic names for video modes Geert Uytterhoeven
2008-01-25 15:06 ` [patch 03/11] ps3fb: Kill PS3FB_FULL_MODE_BIT Geert Uytterhoeven
2008-01-25 15:06 ` Geert Uytterhoeven [this message]
2008-01-27 6:01 ` [patch 04/11] ps3fb: Inline macros that are used only once Andrew Morton
2008-01-27 9:34 ` Geert Uytterhoeven
2008-01-25 15:06 ` [patch 05/11] ps3fb: Kill ps3fb_res Geert Uytterhoeven
2008-01-25 15:06 ` [patch 06/11] ps3fb: Make frame buffer offsets unsigned int Geert Uytterhoeven
2008-01-25 15:06 ` [patch 07/11] ps3fb: Add support for configurable black borders Geert Uytterhoeven
2008-01-25 15:06 ` [patch 08/11] ps3fb: Reorganize modedb handling Geert Uytterhoeven
2008-01-25 15:06 ` [patch 09/11] ps3fb: Round up video modes Geert Uytterhoeven
2008-01-27 6:01 ` Andrew Morton
2008-01-27 9:53 ` Geert Uytterhoeven
2008-01-25 15:06 ` [patch 10/11] ps3fb: Cleanup sweep Geert Uytterhoeven
2008-01-25 15:06 ` [patch 11/11] ps3fb: Fix modedb typos Geert Uytterhoeven
2008-01-27 6:01 ` [patch 00/11] ps3av/3fb patches for 2.6.25 Andrew Morton
2008-01-27 9:44 ` Geert Uytterhoeven
2008-01-27 10:16 ` Andrew Morton
2008-01-27 11:15 ` Geert Uytterhoeven
2008-01-27 13:42 ` Josh Boyer
2008-01-27 16:15 ` Jon Loeliger
2008-01-27 20:01 ` Geoff Levand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080125153107.177014292@vixen.sonytel.be \
--to=geert.uytterhoeven@sonycom.com \
--cc=adaplas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).