✗ CI.checkpatch: warning for drm/xe: Refactor BO flag

Patchwork patchwork at emeril.freedesktop.org
Fri Mar 22 15:15:34 UTC 2024


== Series Details ==

Series: drm/xe: Refactor BO flag
URL   : https://patchwork.freedesktop.org/series/131497/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
a9eb1ac8298ef9f9146567c29fa762d8e9efa1ef
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 63b8bbd55d57ab14a574b029425823bebf9f5b1a
Author: Lucas De Marchi <lucas.demarchi at intel.com>
Date:   Fri Mar 22 07:27:02 2024 -0700

    drm/xe: Normalize bo flags macros
    
    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|GGTT_INVALIDATE)/XE_BO_FLAG_\1/g'
    
    And then the defines in drivers/gpu/drm/xe/xe_bo.h are adjusted to
    follow the coding style.
    
    Reviewed-by: Matthew Auld <matthew.auld at intel.com>
    Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
+ /mt/dim checkpatch b89042d4d087c1e037c1f7904b4c223e48919b88 drm-intel
8bf17d865ae3 drm/xe: Stop passing user flag to xe_bo_create_user()
63b8bbd55d57 drm/xe: Normalize bo flags macros
-:11: WARNING:COMMIT_LOG_LONG_LINE: Prefer a maximum 75 chars per line (possible unwrapped commit description?)
#11: 
	Define bits using ``REG_BIT(N)``. Do **not** add ``_BIT`` suffix to the name.

-:109: WARNING:LONG_LINE: line length of 102 exceeds 100 columns
#109: FILE: drivers/gpu/drm/xe/display/intel_fbdev_fb.c:56:
+					  XE_BO_FLAG_VRAM_IF_DGFX(xe_device_get_root_tile(dev_priv)) |

-:617: CHECK:SPACING: spaces preferred around that '|' (ctx:VxV)
#617: FILE: drivers/gpu/drm/xe/xe_bo.c:1328:
+	if (flags & (XE_BO_FLAG_USER|XE_BO_FLAG_SYSTEM))
 	                            ^

-:844: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tile' - possible side-effects?
#844: FILE: drivers/gpu/drm/xe/xe_bo.h:34:
+#define XE_BO_FLAG_VRAM_IF_DGFX(tile)	(IS_DGFX(tile_to_xe(tile)) ? \
+					 XE_BO_FLAG_VRAM0 << (tile)->id : \
+					 XE_BO_FLAG_SYSTEM)

total: 0 errors, 2 warnings, 2 checks, 996 lines checked




More information about the Intel-xe mailing list