From: Ben Widawsky <ben@bwidawsk.net>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH 2/5] drm/i915: add cpu_map to i915 object
Date: Thu, 12 Jul 2012 23:16:13 -0700 [thread overview]
Message-ID: <1342160176-1807-3-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1342160176-1807-1-git-send-email-ben@bwidawsk.net>
mostly for convenience, this will help us clear up a bit of the code in
intel_ringbuffer.c
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/i915_drv.h | 1 +
drivers/gpu/drm/i915/i915_gem.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 627fe35..ff0323c 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -988,6 +988,7 @@ struct drm_i915_gem_object {
* This is the same as gtt_space->start
*/
uint32_t gtt_offset;
+ void *cpu_map; /* optional kernel mapping */
struct intel_ring_buffer *ring;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 53c3946..c09df96 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3542,6 +3542,9 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj)
if (gem_obj->import_attach)
drm_prime_gem_destroy(gem_obj, obj->sg_table);
+ if (WARN_ON(obj->cpu_map))
+ kunmap(obj->pages[0]);
+
if (obj->phys_obj)
i915_gem_detach_phys_object(dev, obj);
--
1.7.11.1
next prev parent reply other threads:[~2012-07-13 6:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 6:16 [PATCH 0/5] some ringbuffer cleanups Ben Widawsky
2012-07-13 6:16 ` [PATCH 1/5] drm/i915: missing error case in init status page Ben Widawsky
2012-07-13 19:20 ` Daniel Vetter
2012-07-13 6:16 ` Ben Widawsky [this message]
2012-07-13 7:47 ` [PATCH 2/5] drm/i915: add cpu_map to i915 object Chris Wilson
2012-07-13 13:56 ` Ben Widawsky
2012-07-13 14:03 ` Chris Wilson
2012-07-13 6:16 ` [PATCH 3/5] drm/i915: refactor ring object allocation Ben Widawsky
2012-07-13 6:16 ` [PATCH 4/5] drm/i915: kill struct pipe_control Ben Widawsky
2012-07-13 6:16 ` [PATCH 5/5] drm/i915: move ring init to intel_ringbuffer.c Ben Widawsky
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=1342160176-1807-3-git-send-email-ben@bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=intel-gfx@lists.freedesktop.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).