From: David Herrmann <dh.herrmann@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Dave Airlie <airlied@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
David Herrmann <dh.herrmann@gmail.com>,
Rob Clark <robdclark@gmail.com>
Subject: [PATCH v2 4/4] drm/omap: remove useless if() in evict_entry()
Date: Tue, 13 Aug 2013 19:42:19 +0200 [thread overview]
Message-ID: <1376415739-11685-5-git-send-email-dh.herrmann@gmail.com> (raw)
In-Reply-To: <1376415739-11685-1-git-send-email-dh.herrmann@gmail.com>
anon_inode->i_mapping is always set. This was needed before we introduced
anon_inodes. We can safely remove it now.
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
drivers/gpu/drm/omapdrm/omap_gem.c | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 8219940..0f714a8 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -153,25 +153,23 @@ static struct {
static void evict_entry(struct drm_gem_object *obj,
enum tiler_fmt fmt, struct usergart_entry *entry)
{
- if (obj->dev->anon_inode->i_mapping) {
- struct omap_gem_object *omap_obj = to_omap_bo(obj);
- int n = usergart[fmt].height;
- size_t size = PAGE_SIZE * n;
- loff_t off = mmap_offset(obj) +
- (entry->obj_pgoff << PAGE_SHIFT);
- const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE);
- if (m > 1) {
- int i;
- /* if stride > than PAGE_SIZE then sparse mapping: */
- for (i = n; i > 0; i--) {
- unmap_mapping_range(obj->dev->anon_inode->i_mapping,
- off, PAGE_SIZE, 1);
- off += PAGE_SIZE * m;
- }
- } else {
+ struct omap_gem_object *omap_obj = to_omap_bo(obj);
+ int n = usergart[fmt].height;
+ size_t size = PAGE_SIZE * n;
+ loff_t off = mmap_offset(obj) + (entry->obj_pgoff << PAGE_SHIFT);
+ const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE);
+
+ if (m > 1) {
+ int i;
+ /* if stride > than PAGE_SIZE then sparse mapping: */
+ for (i = n; i > 0; i--) {
unmap_mapping_range(obj->dev->anon_inode->i_mapping,
- off, size, 1);
+ off, PAGE_SIZE, 1);
+ off += PAGE_SIZE * m;
}
+ } else {
+ unmap_mapping_range(obj->dev->anon_inode->i_mapping,
+ off, size, 1);
}
entry->obj = NULL;
--
1.8.3.4
prev parent reply other threads:[~2013-08-13 17:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 23:45 [PATCH 0/2] Anonymous Inode Allocations David Herrmann
2013-07-10 23:45 ` [PATCH 1/2] anon_inodes: allow external inode allocations David Herrmann
2013-07-11 6:29 ` Daniel Vetter
2013-07-24 9:45 ` David Herrmann
2013-07-10 23:45 ` [PATCH 2/2] DRM: use anon_inode instead of delayed inode init David Herrmann
2013-07-11 6:57 ` Daniel Vetter
2013-08-13 17:42 ` [PATCH v2 0/4] Anonymous Inode Allocations David Herrmann
2013-08-13 17:42 ` [PATCH v2 1/4] anon_inodes: allow external inode allocations David Herrmann
2013-08-13 17:42 ` [PATCH v2 2/4] DRM: use anon_inode instead of delayed inode init David Herrmann
2013-08-13 17:42 ` [PATCH v2 3/4] drm: init TTM dev_mapping in ttm_bo_device_init() David Herrmann
2013-08-13 17:42 ` David Herrmann [this message]
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=1376415739-11685-5-git-send-email-dh.herrmann@gmail.com \
--to=dh.herrmann@gmail.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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).