From: Thomas Daniel <thomas.daniel@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: akash-goels@gmail.com
Subject: [PATCH] drm/i915: Don't pin LRC in GGTT when dumping in debugfs
Date: Thu, 20 Nov 2014 11:12:05 +0000 [thread overview]
Message-ID: <1416481925-15138-1-git-send-email-thomas.daniel@intel.com> (raw)
LRC object does not need to be mapped into the GGTT when dumping. Just use
pin_pages. A side-effect of this patch is that a compiler warning goes away
(not checking return value of i915_gem_obj_ggtt_pin).
Signed-off-by: Thomas Daniel <thomas.daniel@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index f91e7f7..7e1e7f7 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1801,25 +1801,30 @@ static int i915_dump_lrc(struct seq_file *m, void *unused)
struct page *page;
uint32_t *reg_state;
int j;
+ unsigned long ggtt_offset = 0;
- i915_gem_obj_ggtt_pin(ctx_obj,
- GEN8_LR_CONTEXT_ALIGN, 0);
-
- page = i915_gem_object_get_page(ctx_obj, 1);
- reg_state = kmap_atomic(page);
+ i915_gem_object_pin_pages(ctx_obj);
seq_printf(m, "CONTEXT: %s %u\n", ring->name,
intel_execlists_ctx_id(ctx_obj));
+ if (!i915_gem_obj_ggtt_bound(ctx_obj))
+ seq_puts(m, "\tNot bound in GGTT\n");
+ else
+ ggtt_offset = i915_gem_obj_ggtt_offset(ctx_obj);
+
+ page = i915_gem_object_get_page(ctx_obj, 1);
+ reg_state = kmap_atomic(page);
+
for (j = 0; j < 0x600 / sizeof(u32) / 4; j += 4) {
seq_printf(m, "\t[0x%08lx] 0x%08x 0x%08x 0x%08x 0x%08x\n",
- i915_gem_obj_ggtt_offset(ctx_obj) + 4096 + (j * 4),
+ ggtt_offset + 4096 + (j * 4),
reg_state[j], reg_state[j + 1],
reg_state[j + 2], reg_state[j + 3]);
}
kunmap_atomic(reg_state);
- i915_gem_object_ggtt_unpin(ctx_obj);
+ i915_gem_object_unpin_pages(ctx_obj);
seq_putc(m, '\n');
}
--
1.7.9.5
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2014-11-20 11:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-20 11:12 Thomas Daniel [this message]
2014-11-20 11:16 ` [PATCH] drm/i915: Don't pin LRC in GGTT when dumping in debugfs Chris Wilson
2014-11-20 11:25 ` Daniel, Thomas
2014-11-20 11:39 ` Daniel Vetter
2014-11-20 11:41 ` Chris Wilson
2014-11-20 12:09 ` Daniel, Thomas
2014-11-20 12:28 ` Chris Wilson
2014-11-20 12:50 ` Daniel Vetter
2014-11-25 14:30 ` Daniel, Thomas
2014-11-25 14:44 ` Chris Wilson
2014-11-25 15:59 ` Daniel Vetter
2014-11-25 16:42 ` Daniel, Thomas
2014-11-25 20:51 ` Chris Wilson
2014-11-26 12:28 ` Daniel Vetter
2014-12-02 13:21 ` Thomas Daniel
2014-12-02 14:22 ` Daniel Vetter
2014-12-03 1:39 ` shuang.he
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=1416481925-15138-1-git-send-email-thomas.daniel@intel.com \
--to=thomas.daniel@intel.com \
--cc=akash-goels@gmail.com \
--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