From: Shailendra Verma <shailendra.v@samung.com>
To: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, vidushi.koul@samsung.com
Subject: [PATCH] video:fbdev:core:Calculate the buffer alignment if buffer is not IO mapped.
Date: Fri, 30 Oct 2015 11:41:45 +0000 [thread overview]
Message-ID: <1446204585-23412-1-git-send-email-shailendra.v@samung.com> (raw)
From: Shailendra Verma <Shailendra.v@samsung.com>
Moving the instruction "align = buf->buf_align - 1" just after the
verification of the buffer if it is IP mapped or not as the buffer
alignment is not required if it is IO mapped.Thus it will save an
extra instuction execution when buffer is IO mapped.
Signed-off-by: Shailendra Verma <Shailendra.v@samsung.com>
---
linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c b/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
index 0705d88..d92ec99 100644
--- a/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
+++ b/linux-4.3-rc6/drivers/video/fbdev/core/fbmem.c
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(fb_pad_unaligned_buffer);
*/
char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size)
{
- u32 align = buf->buf_align - 1, offset;
+ u32 align, offset;
char *addr = buf->addr;
/* If IO mapped, we need to sync before access, no sharing of
@@ -169,6 +169,8 @@ char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size
return addr;
}
+ align = buf->buf_align - 1;
+
/* See if we fit in the remaining pixmap space */
offset = buf->offset + align;
offset &= ~align;
--
1.7.9.5
reply other threads:[~2015-10-30 11:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1446204585-23412-1-git-send-email-shailendra.v@samung.com \
--to=shailendra.v@samung.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=tomi.valkeinen@ti.com \
--cc=vidushi.koul@samsung.com \
/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).