public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v7 01/13] drm/i915/guc: Update GuC ADS size for error capture lists
Date: Fri, 11 Mar 2022 02:18:05 -0800	[thread overview]
Message-ID: <b679d4c7-6623-3033-4786-c367684da25e@intel.com> (raw)
In-Reply-To: <20220310053055.GA24765@jons-linux-dev-box>


On 3/9/2022 9:30 PM, Matthew Brost wrote:
> On Sat, Feb 26, 2022 at 01:55:29AM -0800, Alan Previn wrote:
> +intel_guc_capture_getlist(struct intel_guc *guc, u32 owner, u32 type, 
> u32 classid,
>> +			  struct file **fileoutptr)
>> +{
>> +	struct __guc_state_capture_priv *gc = guc->capture.priv;
>> +	struct __guc_capture_ads_cache *cache = &gc->ads_cache[owner][type][classid];
>> +	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
>> +	struct guc_debug_capture_list *listnode;
>> +	struct file *file;
>> +	u8 *caplist, *tmp;
>> +	size_t size = 0;
>> +	int ret, num_regs;
>> +
>> +	if (!gc->reglists)
>> +		return -ENODEV;
>> +
>> +	if (cache->is_valid) {
>> +		*fileoutptr = cache->file;
>> +		return cache->status;
>> +	}
>> +
>> +	ret = intel_guc_capture_getlistsize(guc, owner, type, classid, &size);
>> +	if (ret) {
>> +		cache->is_valid = true;
>> +		cache->file = NULL;
>> +		cache->size = 0;
>> +		cache->status = ret;
>> +		return ret;
>> +	}
>> +
>> +	caplist = kzalloc(size, GFP_KERNEL);
>> +	if (!caplist)
>> +		return -ENOMEM;
>> +
>> +	/* populate capture list header */
>> +	tmp = caplist;
>> +	num_regs = guc_cap_list_num_regs(guc->capture.priv, owner, type, classid);
>> +	listnode = (struct guc_debug_capture_list *)tmp;
>> +	listnode->header.info = FIELD_PREP(GUC_CAPTURELISTHDR_NUMDESCR, (u32)num_regs);
>> +
>> +	/* populate list of register descriptor */
>> +	tmp += sizeof(struct guc_debug_capture_list);
>> +	guc_capture_list_init(guc, owner, type, classid, (struct guc_mmio_reg *)tmp, num_regs);
>> +
>> +	/* ADS only takes file handles, so we keep that as our cache */
>> +	file = shmem_create_from_data("guc-err-cap", caplist, size);
> I don't think you need a file here, why can't this just be a peice of
> kalloc'd memory that is populated and copied via IOSYS map calls?
Agreed on above.
> The memory will need to be persistent (allocated at driver load, free'd
> during unload) as can't allocate memory in the reset path tho.
Of course (as per prior rev comments)
> Beyond that, you are parsing a static table to populate memory. That
> almost certainly means you could just have static memory which we
> directly copy into the ADS.

On this, we dont actually copy the static tables from the top of this 
src file as-is directly into ADS because the format of the static tables 
is different from what ADS expects - i need both formats since the 
latter is lean (just register info) but the former also contains the 
name of registers (strings) to be used at printout time.

> Matt
>

  parent reply	other threads:[~2022-03-11 10:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26  9:55 [Intel-gfx] [PATCH v7 00/13] Add GuC Error Capture Support Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 01/13] drm/i915/guc: Update GuC ADS size for error capture lists Alan Previn
2022-02-26 20:22   ` Teres Alexis, Alan Previn
2022-02-27 21:02   ` kernel test robot
2022-03-10  5:30   ` Matthew Brost
2022-03-11  9:59     ` Teres Alexis, Alan Previn
2022-03-11 10:18     ` Teres Alexis, Alan Previn [this message]
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 02/13] drm/i915/guc: Add XE_LP static registers for GuC error capture Alan Previn
2022-03-10  0:05   ` Umesh Nerlige Ramappa
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 03/13] drm/i915/guc: Add XE_LP steered register lists support Alan Previn
2022-03-10  0:56   ` Umesh Nerlige Ramappa
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 04/13] drm/i915/guc: Add DG2 registers for GuC error state capture Alan Previn
2022-03-10  1:53   ` Umesh Nerlige Ramappa
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 05/13] drm/i915/guc: Add Gen9 " Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 06/13] drm/i915/guc: Add GuC's error state capture output structures Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 07/13] drm/i915/guc: Update GuC-log relay function names Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 08/13] drm/i915/guc: Add capture region into intel_guc_log Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 09/13] drm/i915/guc: Check sizing of guc_capture output Alan Previn
2022-02-28 22:32   ` kernel test robot
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 10/13] drm/i915/guc: Extract GuC error capture lists on G2H notification Alan Previn
2022-03-11 18:16   ` Umesh Nerlige Ramappa
2022-03-11 22:27     ` Teres Alexis, Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 11/13] drm/i915/guc: Pre-allocate output nodes for extraction Alan Previn
2022-03-11 19:40   ` Umesh Nerlige Ramappa
2022-03-11 19:46     ` Teres Alexis, Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 12/13] drm/i915/guc: Plumb GuC-capture into gpu_coredump Alan Previn
2022-02-26  9:55 ` [Intel-gfx] [PATCH v7 13/13] drm/i915/guc: Print the GuC error capture output register list Alan Previn
2022-03-11  5:26   ` Umesh Nerlige Ramappa
2022-02-26 10:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add GuC Error Capture Support (rev7) Patchwork
2022-02-26 10:12 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-26 10:43 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b679d4c7-6623-3033-4786-c367684da25e@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox