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

Patchwork patchwork at emeril.freedesktop.org
Thu Mar 14 05:33:00 UTC 2024


== Series Details ==

Series: drm/xe: Refactor BO flags
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 9e2ee6987ee9b6a2765135bb741792f08c9cacfe
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>
+ /mt/dim checkpatch 96e47e3f3a5952e104d56352872becdc0048d26e drm-intel
353db0fc157d drm/xe: Stop passing user flag to xe_bo_create_user()
9e2ee6987ee9 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.

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

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

-:823: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tile' - possible side-effects?
#823: 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