✗ CI.checkpatch: warning for drm/xe: Refactor BO flags (rev2)

Patchwork patchwork at emeril.freedesktop.org
Thu Mar 14 19:17:34 UTC 2024


== Series Details ==

Series: drm/xe: Refactor BO flags (rev2)
URL   : https://patchwork.freedesktop.org/series/131120/
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 979d5ad4e62e9165c6dac5847c9ae8f62eff13bb
Author: Lucas De Marchi <lucas.demarchi at intel.com>
Date:   Wed Mar 13 22:26:19 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)/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 at intel.com>
    Reviewed-by: Matthew Auld <matthew.auld at intel.com>
+ /mt/dim checkpatch f5246a1cf97dd1b9bf955148b0ca2cbf0b18d31e drm-intel
cae87073d223 drm/xe: Stop passing user flag to xe_bo_create_user()
979d5ad4e62e 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)) |

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

-:824: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tile' - possible side-effects?
#824: 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, 927 lines checked




More information about the Intel-xe mailing list