ilo: add some more winsys functions

Add intel_winsys_get_reset_stats(), intel_winsys_import_userptr(), and
intel_bo_map_async().  The latter two are stubs, but we are not going to use
them immediately either.
This commit is contained in:
Chia-I Wu
2015-03-04 12:02:12 -07:00
parent 1e128e9b69
commit af4cff5d6f
2 changed files with 66 additions and 2 deletions

View File

@@ -111,6 +111,17 @@ int
intel_winsys_read_reg(struct intel_winsys *winsys,
uint32_t reg, uint64_t *val);
/**
* Return the numbers of submissions lost due to GPU reset.
*
* \param active_lost Number of lost active/guilty submissions
* \param pending_lost Number of lost pending/innocent submissions
*/
int
intel_winsys_get_reset_stats(struct intel_winsys *winsys,
struct intel_context *ctx,
uint32_t *active_lost,
uint32_t *pending_lost);
/**
* Allocate a buffer object.
*
@@ -141,6 +152,19 @@ intel_winsys_alloc_buffer(struct intel_winsys *winsys,
INTEL_TILING_NONE, size, 1, cpu_init);
}
/**
* Create a bo from a user memory pointer. Both \p userptr and (\p pitch * \p
* height) must be page aligned.
*/
struct intel_bo *
intel_winsys_import_userptr(struct intel_winsys *winsys,
const char *name,
void *userptr,
enum intel_tiling_mode tiling,
unsigned long pitch,
unsigned long height,
unsigned long flags);
/**
* Create a bo from a winsys handle.
*/
@@ -223,11 +247,15 @@ intel_bo_unreference(struct intel_bo *bo);
* sequential writes, but reads would be very slow. Callers always have a
* linear view of the bo.
*
* map_gtt_async() is similar to map_gtt(), except that it does not block.
* map_async() and map_gtt_async() work similar to map() and map_gtt()
* respectively, except that they do not block.
*/
void *
intel_bo_map(struct intel_bo *bo, bool write_enable);
void *
intel_bo_map_async(struct intel_bo *bo);
void *
intel_bo_map_gtt(struct intel_bo *bo);

View File

@@ -55,6 +55,12 @@ struct intel_winsys {
struct drm_intel_decode *decode;
};
static drm_intel_context *
gem_ctx(const struct intel_context *ctx)
{
return (drm_intel_context *) ctx;
}
static drm_intel_bo *
gem_bo(const struct intel_bo *bo)
{
@@ -244,7 +250,7 @@ void
intel_winsys_destroy_context(struct intel_winsys *winsys,
struct intel_context *ctx)
{
drm_intel_gem_context_destroy((drm_intel_context *) ctx);
drm_intel_gem_context_destroy(gem_ctx(ctx));
}
int
@@ -254,6 +260,18 @@ intel_winsys_read_reg(struct intel_winsys *winsys,
return drm_intel_reg_read(winsys->bufmgr, reg, val);
}
int
intel_winsys_get_reset_stats(struct intel_winsys *winsys,
struct intel_context *ctx,
uint32_t *active_lost,
uint32_t *pending_lost)
{
uint32_t reset_count;
return drm_intel_get_reset_stats(gem_ctx(ctx),
&reset_count, active_lost, pending_lost);
}
struct intel_bo *
intel_winsys_alloc_bo(struct intel_winsys *winsys,
const char *name,
@@ -307,6 +325,18 @@ intel_winsys_alloc_bo(struct intel_winsys *winsys,
return (struct intel_bo *) bo;
}
struct intel_bo *
intel_winsys_import_userptr(struct intel_winsys *winsys,
const char *name,
void *userptr,
enum intel_tiling_mode tiling,
unsigned long pitch,
unsigned long height,
unsigned long flags)
{
return NULL;
}
struct intel_bo *
intel_winsys_import_handle(struct intel_winsys *winsys,
const char *name,
@@ -496,6 +526,12 @@ intel_bo_map(struct intel_bo *bo, bool write_enable)
return gem_bo(bo)->virtual;
}
void *
intel_bo_map_async(struct intel_bo *bo)
{
return NULL;
}
void *
intel_bo_map_gtt(struct intel_bo *bo)
{