Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org, kernel-dev@igalia.com
Subject: Re: [PATCH 1/2] drm/xe: Simplify batch buffer allocation in emit_wa_job()
Date: Mon, 30 Jun 2025 08:44:58 +0100	[thread overview]
Message-ID: <db53b846-d684-4356-a8d4-164ce3e40c8f@igalia.com> (raw)
In-Reply-To: <a5xk7rv2p5gr3tqlt6w7xwthchix4gvzddbrkmwwlxtlpa5cy7@3qhl5c67sbts>


On 27/06/2025 23:47, Lucas De Marchi wrote:
> On Fri, Jun 27, 2025 at 02:14:37PM +0100, Tvrtko Ursulin wrote:
>> Code just needs a large enough buffer and it doesn't even check. Lets
>> therefore simplify to one allocation path which is guaranteed to be as
>> least as big as the current ones.
> 
> In my stashed patches (not sent yet since they don't fix an LRC
> corruption we are chasing) I went the other way around:
> 
> b1f0626cb3d3 o drm/xe/gt: Extract emit_job_sync()
> 979fe60f3883 o drm/xe: Count dwords before allocating
> 5dca40d2503f o drm/xe/lrc: Reduce scope of empty lrc data
> d892c8ac707a o drm/xe/lrc: Add table with LRC layout
> 
> ... particularly the "Count dwords before allocating".

Sounds good from the titles. Carry on as planned. :)

Regards,

Tvrtko

>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
>> ---
>> drivers/gpu/drm/xe/xe_gt.c | 9 ++-------
>> 1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
>> index d397df056e4c..86018fee74d3 100644
>> --- a/drivers/gpu/drm/xe/xe_gt.c
>> +++ b/drivers/gpu/drm/xe/xe_gt.c
>> @@ -190,13 +190,8 @@ static int emit_wa_job(struct xe_gt *gt, struct 
>> xe_exec_queue *q)
>>     int count_rmw = 0;
>>     int count = 0;
>>
>> -    if (q->hwe->class == XE_ENGINE_CLASS_RENDER)
>> -        /* Big enough to emit all of the context's 3DSTATE */
>> -        bb = xe_bb_new(gt, xe_gt_lrc_size(gt, q->hwe->class), false);
>> -    else
>> -        /* Just pick a large BB size */
>> -        bb = xe_bb_new(gt, SZ_4K, false);
>> -
>> +    /* Just pick a large BB size */
>> +    bb = xe_bb_new(gt, xe_gt_lrc_size(gt, q->hwe->class), false);
>>     if (IS_ERR(bb))
>>         return PTR_ERR(bb);
>>
>> -- 
>> 2.48.0
>>


  reply	other threads:[~2025-06-30  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 13:14 [PATCH 0/2] Small emit_wa_job() tidy Tvrtko Ursulin
2025-06-27 13:14 ` [PATCH 1/2] drm/xe: Simplify batch buffer allocation in emit_wa_job() Tvrtko Ursulin
2025-06-27 22:47   ` Lucas De Marchi
2025-06-30  7:44     ` Tvrtko Ursulin [this message]
2025-06-27 13:14 ` [PATCH 2/2] drm/xe: Waste fewer instructions " Tvrtko Ursulin
2025-06-27 13:20   ` Raag Jadav
2025-06-30 13:39     ` Tvrtko Ursulin
2025-06-30 14:12 ` ✗ CI.checkpatch: warning for Small emit_wa_job() tidy Patchwork
2025-06-30 14:13 ` ✓ CI.KUnit: success " Patchwork
2025-06-30 14:48 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-01 15:36 ` ✓ Xe.CI.Full: " 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=db53b846-d684-4356-a8d4-164ce3e40c8f@igalia.com \
    --to=tvrtko.ursulin@igalia.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=kernel-dev@igalia.com \
    --cc=lucas.demarchi@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