CC: [email protected]
CC: [email protected]
BCC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Thomas Zimmermann <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: [email protected]
CC: Thomas Zimmermann <[email protected]>

Hi Thomas,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20220310]
[cannot apply to linus/master v5.17-rc7 v5.17-rc6 v5.17-rc5 v5.17-rc8]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/fbdev-Fix-image-blitting-for-arbitrary-image-widths/20220314-033209
base:    71941773e143369a73c9c4a3b62fbb60736a1182
:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
config: x86_64-randconfig-c007 
(https://download.01.org/0day-ci/archive/20220315/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
0467eb2cb7654c15ae366967ef35093c5724c416)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://github.com/0day-ci/linux/commit/9410e2f8731c2247eb12bf3b2c46d169917bb9b4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review 
Thomas-Zimmermann/fbdev-Fix-image-blitting-for-arbitrary-image-widths/20220314-033209
        git checkout 9410e2f8731c2247eb12bf3b2c46d169917bb9b4
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
               ^
   include/linux/rcupdate.h:877:41: note: expanded from macro 
'__is_kvfree_rcu_offset'
   #define __is_kvfree_rcu_offset(offset) ((offset) < 4096)
                                           ^~~~~~~~~~~~~~~
   kernel/rcu/tree.c:3129:2: note: Taking false branch
           if (__is_kvfree_rcu_offset((unsigned long)func))
           ^
   kernel/rcu/tree.c:3140:6: note: Assuming the condition is false
           if (unlikely(rcu_rdp_is_offloaded(rdp))) {
               ^
   include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                             ^~~~
   kernel/rcu/tree.c:3140:2: note: Taking true branch
           if (unlikely(rcu_rdp_is_offloaded(rdp))) {
           ^
   kernel/rcu/tree.c:3141:3: note: 2nd function call argument is an 
uninitialized value
                   __call_rcu_nocb_wake(rdp, was_alldone, flags); /* unlocks */
                   ^                         ~~~~~~~~~~~
   Suppressed 51 warnings (51 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   21 warnings generated.
   drivers/acpi/acpica/utnonansi.c:135:2: warning: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(dest, source);
           ^~~~~~
   drivers/acpi/acpica/utnonansi.c:135:2: note: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119
           strcpy(dest, source);
           ^~~~~~
   drivers/acpi/acpica/utnonansi.c:146:2: warning: Call to function 'strcat' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcat(dest, source);
           ^~~~~~
   drivers/acpi/acpica/utnonansi.c:146:2: note: Call to function 'strcat' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcat'. CWE-119
           strcat(dest, source);
           ^~~~~~
   drivers/acpi/acpica/utnonansi.c:163:2: warning: Call to function 'strncat' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'strncat_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           strncat(dest, source, max_transfer_length);
           ^~~~~~~
   drivers/acpi/acpica/utnonansi.c:163:2: note: Call to function 'strncat' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'strncat_s' in case of C11
           strncat(dest, source, max_transfer_length);
           ^~~~~~~
   drivers/acpi/acpica/utnonansi.c:171:2: warning: Call to function 'strncpy' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'strncpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           strncpy(dest, source, dest_size);
           ^~~~~~~
   drivers/acpi/acpica/utnonansi.c:171:2: note: Call to function 'strncpy' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'strncpy_s' in case of C11
           strncpy(dest, source, dest_size);
           ^~~~~~~
   Suppressed 17 warnings (17 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   17 warnings generated.
   Suppressed 17 warnings (17 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   48 warnings generated.
   drivers/video/fbdev/core/fbcvt.c:233:3: warning: Value stored to 'off' is 
never read [clang-analyzer-deadcode.DeadStores]
                   off += scnprintf(buf + off, size - off,
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/fbcvt.c:233:3: note: Value stored to 'off' is never 
read
                   off += scnprintf(buf + off, size - off,
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/fbcvt.c:252:4: warning: Value stored to 'off' is 
never read [clang-analyzer-deadcode.DeadStores]
                           off += scnprintf(buf + off, size - off, "-R");
                           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/fbcvt.c:252:4: note: Value stored to 'off' is never 
read
                           off += scnprintf(buf + off, size - off, "-R");
                           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/fbcvt.c:298:2: warning: Call to function 'memset' 
is insecure as it does not provide security checks introduced in the C11 
standard. Replace with analogous functions that support length arguments or 
provides boundary checks such as 'memset_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
           memset(&cvt, 0, sizeof(cvt));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/fbcvt.c:298:2: note: Call to function 'memset' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memset_s' in case of C11
           memset(&cvt, 0, sizeof(cvt));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'
   #define memset(p, c, s) __fortify_memset_chk(p, c, s,                   \
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:265:2: note: expanded from macro 
'__fortify_memset_chk'
           __underlying_memset(p, c, __fortify_size);                      \
           ^~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:47:29: note: expanded from macro 
'__underlying_memset'
   #define __underlying_memset     __builtin_memset
                                   ^~~~~~~~~~~~~~~~
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   45 warnings generated.
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   46 warnings generated.
>> drivers/video/fbdev/core/cfbimgblt.c:304:10: warning: The expression is an 
>> uninitialized value. The computed value will also be garbage 
>> [clang-analyzer-core.uninitialized.Assign]
                   for (; j--; ) {
                          ^
   drivers/video/fbdev/core/cfbimgblt.c:326:6: note: Assuming field 'state' is 
equal to FBINFO_STATE_RUNNING
           if (p->state != FBINFO_STATE_RUNNING)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:326:2: note: Taking false branch
           if (p->state != FBINFO_STATE_RUNNING)
           ^
   drivers/video/fbdev/core/cfbimgblt.c:337:6: note: Assuming field 'fb_sync' 
is null
           if (p->fbops->fb_sync)
               ^~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:337:2: note: Taking false branch
           if (p->fbops->fb_sync)
           ^
   drivers/video/fbdev/core/cfbimgblt.c:340:6: note: Assuming field 'depth' is 
equal to 1
           if (image->depth == 1) {
               ^~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:340:2: note: Taking true branch
           if (image->depth == 1) {
           ^
   drivers/video/fbdev/core/cfbimgblt.c:341:7: note: Assuming field 'visual' is 
not equal to FB_VISUAL_TRUECOLOR
                   if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:341:7: note: Left side of '||' is false
   drivers/video/fbdev/core/cfbimgblt.c:342:7: note: Assuming field 'visual' is 
not equal to FB_VISUAL_DIRECTCOLOR
                       p->fix.visual == FB_VISUAL_DIRECTCOLOR) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:341:3: note: Taking false branch
                   if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
                   ^
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Assuming the condition is 
true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Left side of '&&' is true
   drivers/video/fbdev/core/cfbimgblt.c:350:24: note: Assuming 'start_index' is 0
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                                        ^~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/cfbimgblt.c:350:40: note: Assuming 'pitch_index' is 0
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                                                        ^~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/cfbimgblt.c:351:8: note: Assuming the condition is 
true
                       ((width & (32/bpp-1)) == 0) &&
                        ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/cfbimgblt.c:352:7: note: Assuming 'bpp' is >= 8
                       bpp >= 8 && bpp <= 32)
                       ^~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/cfbimgblt.c:352:19: note: Assuming 'bpp' is <= 32
                       bpp >= 8 && bpp <= 32)
                                   ^~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:350:3: note: Taking true branch
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                   ^
   drivers/video/fbdev/core/cfbimgblt.c:353:4: note: Calling 'fast_imageblit'
                           fast_imageblit(image, p, dst1, fgcolor, bgcolor);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/cfbimgblt.c:227:9: note: 'j' declared without an 
initial value
           int i, j, k;
                  ^
   drivers/video/fbdev/core/cfbimgblt.c:229:2: note: Control jumps to 'case 
32:'  at line 238
           switch (bpp) {
           ^
   drivers/video/fbdev/core/cfbimgblt.c:241:3: note:  Execution continues on 
line 246
                   break;
                   ^
   drivers/video/fbdev/core/cfbimgblt.c:246:2: note: Loop condition is false. 
Execution continues on line 253
           for (i = ppw-1; i--; ) {
           ^
   drivers/video/fbdev/core/cfbimgblt.c:257:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < tablen; ++i)
           ^
   drivers/video/fbdev/core/cfbimgblt.c:257:2: note: Loop condition is true.  
Entering loop body
   drivers/video/fbdev/core/cfbimgblt.c:257:2: note: Loop condition is false. 
Execution continues on line 260
   drivers/video/fbdev/core/cfbimgblt.c:260:2: note: Loop condition is true.  
Entering loop body
           for (i = image->height; i--; ) {
           ^
   drivers/video/fbdev/core/cfbimgblt.c:270:3: note: 'Default' branch taken. 
Execution continues on line 304
                   switch (ppw) {
                   ^
   drivers/video/fbdev/core/cfbimgblt.c:304:10: note: The expression is an 
uninitialized value. The computed value will also be garbage
                   for (; j--; ) {
                          ^
   Suppressed 45 warnings (45 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   17 warnings generated.
   Suppressed 17 warnings (17 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   19 warnings generated.
   drivers/acpi/acpica/tbprint.c:70:2: warning: Call to function 'memcpy' is 
insecure as it does not provide security checks introduced in the C11 standard. 
Replace with analogous functions that support length arguments or provides 
boundary checks such as 'memcpy_s' in case of C11 
[clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]

vim +304 drivers/video/fbdev/core/cfbimgblt.c

^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  206  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  207  /*
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  208   * fast_imageblit - optimized monochrome color expansion
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  209   *
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  210   * Only if:  bits_per_pixel == 8, 16, or 32
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  211   *           image->width is divisible by pixel/dword (ppw);
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  212   *           fix->line_legth is divisible by 4;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  213   *           beginning and end of a scanline is dword aligned
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  214   */
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  215  static inline void fast_imageblit(const struct fb_image 
*image, struct fb_info *p,
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  216                                    u8 __iomem *dst1, u32 
fgcolor,
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  217                                    u32 bgcolor)
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  218  {
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  219          u32 fgx = fgcolor, bgx = bgcolor, bpp = 
p->var.bits_per_pixel;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  220          u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  221          u32 bit_mask, eorx, shift;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  222          const char *s = image->data, *src;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  223          u32 __iomem *dst;
d95159cf1b12e8e drivers/video/cfbimgblt.c            Helge Deller      
2006-12-08  224          const u32 *tab = NULL;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  225          size_t tablen;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  226          u32 colortab[16];
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  227          int i, j, k;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  228  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  229          switch (bpp) {
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  230          case 8:
e4c690e061b9091 drivers/video/cfbimgblt.c            Anton Vorontsov   
2008-04-28  231                  tab = fb_be_math(p) ? cfb_tab8_be : 
cfb_tab8_le;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  232                  tablen = 16;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  233                  break;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  234          case 16:
e4c690e061b9091 drivers/video/cfbimgblt.c            Anton Vorontsov   
2008-04-28  235                  tab = fb_be_math(p) ? cfb_tab16_be : 
cfb_tab16_le;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  236                  tablen = 4;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  237                  break;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  238          case 32:
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  239                  tab = cfb_tab32;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  240                  tablen = 2;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  241                  break;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  242          default:
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  243                  return;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  244          }
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  245  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  246          for (i = ppw-1; i--; ) {
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  247                  fgx <<= bpp;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  248                  bgx <<= bpp;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  249                  fgx |= fgcolor;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  250                  bgx |= bgcolor;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  251          }
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  252  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  253          bit_mask = (1 << ppw) - 1;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  254          eorx = fgx ^ bgx;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  255          k = image->width/ppw;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  256  
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  257          for (i = 0; i < tablen; ++i)
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  258                  colortab[i] = (tab[i] & eorx) ^ bgx;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  259  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  260          for (i = image->height; i--; ) {
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  261                  dst = (u32 __iomem *)dst1;
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  262                  shift = 8;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  263                  src = s;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  264  
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  265                  /*
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  266                   * Manually unroll the per-line copying loop 
for better
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  267                   * performance. This works until we processed 
the last
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  268                   * completely filled source byte (inclusive).
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  269                   */
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  270                  switch (ppw) {
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  271                  case 4: /* 8 bpp */
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  272                          for (j = k; j >= 2; j -= 2, ++src) {
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  273                                  FB_WRITEL(colortab[(*src >> 4) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  274                                  FB_WRITEL(colortab[(*src >> 0) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  275                          }
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  276                          break;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  277                  case 2: /* 16 bpp */
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  278                          for (j = k; j >= 4; j -= 4, ++src) {
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  279                                  FB_WRITEL(colortab[(*src >> 6) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  280                                  FB_WRITEL(colortab[(*src >> 4) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  281                                  FB_WRITEL(colortab[(*src >> 2) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  282                                  FB_WRITEL(colortab[(*src >> 0) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  283                          }
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  284                          break;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  285                  case 1: /* 32 bpp */
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  286                          for (j = k; j >= 8; j -= 8, ++src) {
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  287                                  FB_WRITEL(colortab[(*src >> 7) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  288                                  FB_WRITEL(colortab[(*src >> 6) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  289                                  FB_WRITEL(colortab[(*src >> 5) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  290                                  FB_WRITEL(colortab[(*src >> 4) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  291                                  FB_WRITEL(colortab[(*src >> 3) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  292                                  FB_WRITEL(colortab[(*src >> 2) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  293                                  FB_WRITEL(colortab[(*src >> 1) 
& bit_mask], dst++);
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  294                                  FB_WRITEL(colortab[(*src >> 0) 
& bit_mask], dst++);
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  295                          }
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  296                          break;
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  297                  }
0d03011894d2324 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-02-23  298  
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  299                  /*
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  300                   * For image widths that are not a multiple of 
8, there
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  301                   * are trailing pixels left on the current 
line. Print
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  302                   * them as well.
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  303                   */
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13 @304                  for (; j--; ) {
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  305                          shift -= ppw;
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  306                          FB_WRITEL(colortab[(*src >> shift) & 
bit_mask], dst++);
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  307                          if (!shift) {
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  308                                  shift = 8;
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  309                                  ++src;
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  310                          }
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  311                  }
9410e2f8731c224 drivers/video/fbdev/core/cfbimgblt.c Thomas Zimmermann 
2022-03-13  312  
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  313                  dst1 += p->fix.line_length;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  314                  s += spitch;
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  315          }
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  316  }
^1da177e4c3f415 drivers/video/cfbimgblt.c            Linus Torvalds    
2005-04-16  317  

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to