aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-11-05 15:37:42 -0500
committerDave Airlie <airlied@linux.ie>2008-12-29 02:47:22 -0500
commita9587470f753d670d910293ecbf1c7b66c99de50 (patch)
treec98f695d5bdce46d41ae0b8254904acfbca634a8 /drivers/gpu
parenta9d51a5ad1154b5b20add1e8d30a5564f8aabbe9 (diff)
drm/i915: Add /proc debugging entry for reading out the HWS.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_proc.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_proc.c b/drivers/gpu/drm/i915/i915_gem_proc.c
index e8d5abe1250e..4d1b9de0cd8b 100644
--- a/drivers/gpu/drm/i915/i915_gem_proc.c
+++ b/drivers/gpu/drm/i915/i915_gem_proc.c
@@ -250,6 +250,39 @@ static int i915_interrupt_info(char *buf, char **start, off_t offset,
250 return len - offset; 250 return len - offset;
251} 251}
252 252
253static int i915_hws_info(char *buf, char **start, off_t offset,
254 int request, int *eof, void *data)
255{
256 struct drm_minor *minor = (struct drm_minor *) data;
257 struct drm_device *dev = minor->dev;
258 drm_i915_private_t *dev_priv = dev->dev_private;
259 int len = 0, i;
260 volatile u32 *hws;
261
262 if (offset > DRM_PROC_LIMIT) {
263 *eof = 1;
264 return 0;
265 }
266
267 hws = (volatile u32 *)dev_priv->hw_status_page;
268 if (hws == NULL) {
269 *eof = 1;
270 return 0;
271 }
272
273 *start = &buf[offset];
274 *eof = 0;
275 for (i = 0; i < 4096 / sizeof(u32) / 4; i += 4) {
276 DRM_PROC_PRINT("0x%08x: 0x%08x 0x%08x 0x%08x 0x%08x\n",
277 i * 4,
278 hws[i], hws[i + 1], hws[i + 2], hws[i + 3]);
279 }
280 if (len > request + offset)
281 return request;
282 *eof = 1;
283 return len - offset;
284}
285
253static struct drm_proc_list { 286static struct drm_proc_list {
254 /** file name */ 287 /** file name */
255 const char *name; 288 const char *name;
@@ -262,6 +295,7 @@ static struct drm_proc_list {
262 {"i915_gem_request", i915_gem_request_info}, 295 {"i915_gem_request", i915_gem_request_info},
263 {"i915_gem_seqno", i915_gem_seqno_info}, 296 {"i915_gem_seqno", i915_gem_seqno_info},
264 {"i915_gem_interrupt", i915_interrupt_info}, 297 {"i915_gem_interrupt", i915_interrupt_info},
298 {"i915_gem_hws", i915_hws_info},
265}; 299};
266 300
267#define I915_GEM_PROC_ENTRIES ARRAY_SIZE(i915_gem_proc_list) 301#define I915_GEM_PROC_ENTRIES ARRAY_SIZE(i915_gem_proc_list)