Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
/**
 * Query information about GPU resets observed by this context
 *
 * Called via \c dd_function_table::GetGraphicsResetStatus.
 */
GLenum
brw_get_graphics_reset_status(struct gl_context *ctx)
{
   struct brw_context *brw = brw_context(ctx);
   int err;
   uint32_t reset_count;
   uint32_t active;
   uint32_t pending;

   /* If hardware contexts are not being used (or
    * DRM_IOCTL_I915_GET_RESET_STATS is not supported), this function should
    * not be accessible.
    */
   assert(brw->hw_ctx != NULL);

#if 0
   /* This is waiting until the kernel code can be merged and a new libdrm
    * actually released.
    */
   err = drm_intel_get_reset_stats(brw->hw_ctx, &reset_count, &active,
                                   &pending);
   if (err)
      return GL_NO_ERROR;
#else
   return GL_NO_ERROR;
#endif

   /* A reset was observed while a batch from this context was executing.
    * Assume that this context was at fault.
    */
   if (active != 0)
      return GL_GUILTY_CONTEXT_RESET_ARB;

   /* A reset was observed while a batch from this context was in progress,
    * but the batch was not executing.  In this case, assume that the context
    * was not at fault.
    */
   if (pending != 0)
      return GL_INNOCENT_CONTEXT_RESET_ARB;

   /* FINISHME: Should we report anything if reset_count > brw->reset_count?
    */

   return GL_NO_ERROR;
}