Re: [PATCH 32/33] drm/i915: Consolidate error object printing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On su, 2016-08-07 at 15:45 +0100, Chris Wilson wrote:
>  static void print_error_obj(struct drm_i915_error_state_buf *m,
> +			    struct intel_engine_cs *engine,
> +			    const char *name,
>  			    struct drm_i915_error_object *obj)
>  {
>  	int page, offset, elt;
>  
> +	if (!obj)
> +		return;
> +
> +	if (name) {
> +		err_printf(m, "%s --- %s gtt_offset = 0x%08x_%08x\n",
> +			   engine ? engine->name : "global", name,
> +			   upper_32_bits(obj->gtt_offset),
> +			   lower_32_bits(obj->gtt_offset));
> +	}
> +
>  	for (page = offset = 0; page < obj->page_count; page++) {
>  		for (elt = 0; elt < PAGE_SIZE/4; elt++) {
>  			err_printf(m, "%08x :  %08x\n", offset,
> @@ -330,8 +342,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  	struct drm_i915_error_state *error = error_priv->error;
>  	struct drm_i915_error_object *obj;
> -	int i, j, offset, elt;
>  	int max_hangcheck_score;
> +	int i, j;
>  
>  	if (!error) {
>  		err_printf(m, "no error state collected\n");
> @@ -446,15 +458,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  			err_printf(m, " --- gtt_offset = 0x%08x %08x\n",

If intended for userspace parsing "0x%08x %08x" vs. "0x%08x_%08x" would
be good to be consistent. And to reduce such error in future, I'd also
make this line be printed with above function (let there be extra
space).

With that;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux