Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1259413
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Shailendra Verma <shailendra.v@samung.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] video:fbdev:core:Calculate the buffer alignment if buffer is not IO mapped. |
| Date | Fri, 30 Oct 2015 12:40:01 +0100 |
| Message-ID | <qpgch-5f8-1@gated-at.bofh.it> (permalink) |
| X-Original-To | Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>, linux-fbdev@vger.kernel.org |
| X-Auditid | cbfee61a-f79a06d000005c6f-1b-563354e30704 |
| X-Mailer | git-send-email 1.7.9.5 |
| X-Brightmail-Tracker | H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsVy+t9jQd0nIcZhBo+mMFmc6PvAanF51xw2 i3UPXzBZrJ9/i83i78VLbA6sHq8u3GHx6NuyitHj+I3tTB6fN8kFsERx2aSk5mSWpRbp2yVw Zdy9NIGlYCdXxar/B9kbGM9ydDFyckgImEi83XqbHcIWk7hwbz1bFyMXh5DALEaJHZu2sEM4 rxklbu37xdzFyMHBJmAgselWAEhcRKCZUWJ7VwcjSDezgJXEpP+zWUFqhAXiJBo2ZYOEWQRU Ja4cncUGYvMKuEvsab3OCFIiIaAgMWeSzQRG7gWMDKsYJVILkguKk9JzDfNSy/WKE3OLS/PS 9ZLzczcxgkPhmdQOxoO73A8xCnAwKvHw/kgwChNiTSwrrsw9xCjBwawkwtvjZBwmxJuSWFmV WpQfX1Sak1p8iFGag0VJnFffE6haID2xJDU7NbUgtQgmy8TBKdXAKOV0lHG+XG+JyOE9e6y9 NuqYnckqn/06L9S3eZVitccspvavD/mvcXilMYV1PWf4fLHm/6fcdx+/ie30qfuQUBOZ8SK2 0/TDy7Cq5abzv/UGuByMEd20f5ZIEccNl0WhiS8WWu3tuLy017jntFPQSn2xMlVBy+e/Mg9M C45UVfscITB/gsJPJZbijERDLeai4kQAs5GidQECAAA= |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 42 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, vidushi.koul@samsung.com |
| X-Original-Date | Fri, 30 Oct 2015 16:59:45 +0530 |
| X-Original-Message-ID | <1446204585-23412-1-git-send-email-shailendra.v@samung.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1259413 |
Show key headers only | View 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] video:fbdev:core:Calculate the buffer alignment if buffer is not IO mapped. Shailendra Verma <shailendra.v@samung.com> - 2015-10-30 12:40 +0100
csiph-web