Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Matt Roper" <matthew.d.roper@intel.com>
Subject: Re: [PATCH 2/2] drm/xe: Normalize bo flags macros
Date: Thu, 14 Mar 2024 17:19:11 +0000	[thread overview]
Message-ID: <f9c143a9-694c-4a15-93f5-1e3a5f2d12e6@intel.com> (raw)
In-Reply-To: <20240314052619.2628396-3-lucas.demarchi@intel.com>

On 14/03/2024 05:26, Lucas De Marchi wrote:
> The flags stored in the BO grew over time without following
> much a naming pattern. First of all, get rid of the _BIT suffix that was
> banned from everywhere else due to the guideline in
> drivers/gpu/drm/i915/i915_reg.h that xe kind of follows:
> 
> 	Define bits using ``REG_BIT(N)``. Do **not** add ``_BIT`` suffix to the name.
> 
> Here the flags aren't for a register, but it's good practice to keep it
> consistent.
> 
> Second divergence on names is the use or not of "CREATE". This is
> because most of the flags are passed to xe_bo_create*() family of
> functions, changing its behavior. However, since the flags are also
> stored in the bo itself and checked elsewhere in the code, it seems
> better to just omit the CREATE part.
> 
> With those 2 guidelines, all the flags are given the form
> XE_BO_FLAG_<FLAG_NAME> with the following commands:
> 
> 	git grep -le "XE_BO_" -- drivers/gpu/drm/xe | xargs sed -i \
> 		-e "s/XE_BO_\([_A-Z0-9]*\)_BIT/XE_BO_\1/g" \
> 		-e 's/XE_BO_CREATE_/XE_BO_FLAG_/g'
> 	git grep -le "XE_BO_" -- drivers/gpu/drm/xe | xargs sed -i -r \
> 		-e 's/XE_BO_(DEFER_BACKING|SCANOUT|FIXED_PLACEMENT|PAGETABLE|NEEDS_CPU_ACCESS|NEEDS_UC|INTERNAL_TEST|INTERNAL_64k)/XE_BO_FLAG_\1/g'
> 
> And then the defines in drivers/gpu/drm/xe/xe_bo.h are adjusted to
> follow the coding style.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Looks like a nice cleanup to me,
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

  reply	other threads:[~2024-03-14 17:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  5:26 [PATCH 0/2] drm/xe: Refactor BO flags Lucas De Marchi
2024-03-14  5:26 ` [PATCH 1/2] drm/xe: Stop passing user flag to xe_bo_create_user() Lucas De Marchi
2024-03-14 17:07   ` Matthew Auld
2024-03-14  5:26 ` [PATCH 2/2] drm/xe: Normalize bo flags macros Lucas De Marchi
2024-03-14 17:19   ` Matthew Auld [this message]
2024-03-14  5:32 ` ✓ CI.Patch_applied: success for drm/xe: Refactor BO flags Patchwork
2024-03-14  5:33 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-14  5:33 ` ✓ CI.KUnit: success " Patchwork
2024-03-14  5:45 ` ✓ CI.Build: " Patchwork
2024-03-14  5:47 ` ✓ CI.Hooks: " Patchwork
2024-03-14  5:48 ` ✓ CI.checksparse: " Patchwork
2024-03-14  6:31 ` ✗ CI.BAT: failure " Patchwork
2024-03-14 16:41   ` Lucas De Marchi
2024-03-15  6:38     ` Musial, Ewelina
2024-03-16  0:52       ` Lucas De Marchi
2024-03-14 19:17 ` ✓ CI.Patch_applied: success for drm/xe: Refactor BO flags (rev2) Patchwork
2024-03-14 19:17 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-14 19:18 ` ✓ CI.KUnit: success " Patchwork
2024-03-14 19:30 ` ✓ CI.Build: " Patchwork
2024-03-14 19:33 ` ✓ CI.Hooks: " Patchwork
2024-03-14 19:34 ` ✓ CI.checksparse: " Patchwork
2024-03-14 19:57 ` ✓ CI.BAT: " 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=f9c143a9-694c-4a15-93f5-1e3a5f2d12e6@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=thomas.hellstrom@linux.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