intel: Add a function for the new register read ioctl.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
main
Eric Anholt 2012-08-01 16:43:16 -07:00
parent 934ea3b321
commit 2607dad20b
2 changed files with 21 additions and 0 deletions

View File

@ -241,6 +241,9 @@ void drm_intel_decode_set_head_tail(struct drm_intel_decode *ctx,
void drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, FILE *out); void drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, FILE *out);
void drm_intel_decode(struct drm_intel_decode *ctx); void drm_intel_decode(struct drm_intel_decode *ctx);
int drm_intel_reg_read(drm_intel_bufmgr *bufmgr,
uint32_t offset,
uint64_t *result);
/** @{ Compatibility defines to keep old code building despite the symbol rename /** @{ Compatibility defines to keep old code building despite the symbol rename
* from dri_* to drm_intel_* * from dri_* to drm_intel_*

View File

@ -2947,6 +2947,24 @@ drm_intel_gem_context_destroy(drm_intel_context *ctx)
free(ctx); free(ctx);
} }
int
drm_intel_reg_read(drm_intel_bufmgr *bufmgr,
uint32_t offset,
uint64_t *result)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr;
struct drm_i915_reg_read reg_read;
int ret;
VG_CLEAR(reg_read);
reg_read.offset = offset;
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_REG_READ, &reg_read);
*result = reg_read.val;
return ret;
}
/** /**
* Annotate the given bo for use in aub dumping. * Annotate the given bo for use in aub dumping.