CC: l...@lists.linux.dev
CC: kbuild-...@lists.01.org
BCC: l...@intel.com
In-Reply-To: <20220313192952.12058-2-tzimmerm...@suse.de>
References: <20220313192952.12058-2-tzimmerm...@suse.de>
TO: Thomas Zimmermann <tzimmerm...@suse.de>
TO: dan...@ffwll.ch
TO: del...@gmx.de
TO: m.szyprow...@samsung.com
TO: ge...@linux-m68k.org
TO: javi...@redhat.com
TO: s...@ravnborg.org
CC: linux-fb...@vger.kernel.org
CC: dri-de...@lists.freedesktop.org
CC: Thomas Zimmermann <tzimmerm...@suse.de>

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: 19 hours ago
:::::: commit date: 19 hours ago
config: x86_64-randconfig-c007 
(https://download.01.org/0day-ci/archive/20220314/202203142244.kd75rw4r-...@intel.com/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/34e093954c6d2a7ff3da7c7d599ba6486855c3d1
        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 34e093954c6d2a7ff3da7c7d599ba6486855c3d1
        # 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 <l...@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro 
'__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro 
'__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   drivers/acpi/apei/erst.c:1015: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]
           memcpy(record->buf, rcd->data, len - sizeof(*rcd));
           ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro 
'__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro 
'__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   drivers/acpi/apei/erst.c:1015:2: note: 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
           memcpy(record->buf, rcd->data, len - sizeof(*rcd));
           ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro 
'__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro 
'__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   drivers/acpi/apei/erst.c:1046: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(rcd, 0, sizeof(*rcd));
           ^
   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/acpi/apei/erst.c:1046: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(rcd, 0, sizeof(*rcd));
           ^
   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/acpi/apei/erst.c:1047: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]
           memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE);
           ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro 
'__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro 
'__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   drivers/acpi/apei/erst.c:1047:2: note: 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
           memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE);
           ^
   include/linux/fortify-string.h:369:26: note: expanded from macro 'memcpy'
   #define memcpy(p, q, s)  __fortify_memcpy_chk(p, q, s,                  \
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/fortify-string.h:362:2: note: expanded from macro 
'__fortify_memcpy_chk'
           __underlying_##op(p, q, __fortify_size);                        \
           ^~~~~~~~~~~~~~~~~
   note: expanded from here
   include/linux/fortify-string.h:45:29: note: expanded from macro 
'__underlying_memcpy'
   #define __underlying_memcpy     __builtin_memcpy
                                   ^~~~~~~~~~~~~~~~
   Suppressed 37 warnings (37 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.
   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/sysimgblt.c:274: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/sysimgblt.c:296:6: note: Assuming field 'state' is 
equal to FBINFO_STATE_RUNNING
           if (p->state != FBINFO_STATE_RUNNING)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:296:2: note: Taking false branch
           if (p->state != FBINFO_STATE_RUNNING)
           ^
   drivers/video/fbdev/core/sysimgblt.c:307:6: note: Assuming field 'fb_sync' 
is null
           if (p->fbops->fb_sync)
               ^~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:307:2: note: Taking false branch
           if (p->fbops->fb_sync)
           ^
   drivers/video/fbdev/core/sysimgblt.c:310:6: note: Assuming field 'depth' is 
equal to 1
           if (image->depth == 1) {
               ^~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:310:2: note: Taking true branch
           if (image->depth == 1) {
           ^
   drivers/video/fbdev/core/sysimgblt.c:311:7: note: Assuming field 'visual' is 
not equal to FB_VISUAL_TRUECOLOR
                   if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:311:7: note: Left side of '||' is false
   drivers/video/fbdev/core/sysimgblt.c:312:7: note: Assuming field 'visual' is 
not equal to FB_VISUAL_DIRECTCOLOR
                       p->fix.visual == FB_VISUAL_DIRECTCOLOR) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:311:3: note: Taking false branch
                   if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
                   ^
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Assuming the condition is 
true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Left side of '&&' is true
   drivers/video/fbdev/core/sysimgblt.c:320:24: note: Assuming 'start_index' is 0
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                                        ^~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/sysimgblt.c:320:40: note: Assuming 'pitch_index' is 0
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                                                        ^~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/sysimgblt.c:321:8: note: Assuming the condition is 
true
                       ((width & (32/bpp-1)) == 0) &&
                        ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/sysimgblt.c:322:7: note: Assuming 'bpp' is >= 8
                       bpp >= 8 && bpp <= 32)
                       ^~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:7: note: Left side of '&&' is true
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                       ^
   drivers/video/fbdev/core/sysimgblt.c:322:19: note: Assuming 'bpp' is <= 32
                       bpp >= 8 && bpp <= 32)
                                   ^~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:320:3: note: Taking true branch
                   if (32 % bpp == 0 && !start_index && !pitch_index &&
                   ^
   drivers/video/fbdev/core/sysimgblt.c:323:4: note: Calling 'fast_imageblit'
                           fast_imageblit(image, p, dst1, fgcolor, bgcolor);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/video/fbdev/core/sysimgblt.c:197:9: note: 'j' declared without an 
initial value
           int i, j, k;
                  ^
   drivers/video/fbdev/core/sysimgblt.c:199:2: note: Control jumps to 'case 
32:'  at line 208
           switch (bpp) {
           ^
   drivers/video/fbdev/core/sysimgblt.c:211:3: note:  Execution continues on 
line 216
                   break;
                   ^
   drivers/video/fbdev/core/sysimgblt.c:216:2: note: Loop condition is false. 
Execution continues on line 223
           for (i = ppw-1; i--; ) {
           ^
   drivers/video/fbdev/core/sysimgblt.c:227:2: note: Loop condition is true.  
Entering loop body
           for (i = 0; i < tablen; ++i)
           ^
   drivers/video/fbdev/core/sysimgblt.c:227:2: note: Loop condition is true.  
Entering loop body
   drivers/video/fbdev/core/sysimgblt.c:227:2: note: Loop condition is false. 
Execution continues on line 230
   drivers/video/fbdev/core/sysimgblt.c:230:2: note: Loop condition is true.  
Entering loop body
           for (i = image->height; i--; ) {
           ^
   drivers/video/fbdev/core/sysimgblt.c:240:3: note: 'Default' branch taken. 
Execution continues on line 274
                   switch (ppw) {
                   ^
   drivers/video/fbdev/core/sysimgblt.c:274: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.
   68 warnings generated.
   drivers/ptp/ptp_chardev.c:24: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(&rq, 0, sizeof(rq));
           ^
   include/linux/fortify-string.h:272:25: note: expanded from macro 'memset'

vim +274 drivers/video/fbdev/core/sysimgblt.c

68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  177  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  178  /*
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  179   * fast_imageblit - optimized monochrome color expansion
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  180   *
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  181   * Only if:  bits_per_pixel == 8, 16, or 32
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  182   *           image->width is divisible by pixel/dword (ppw);
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  183   *           fix->line_legth is divisible by 4;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  184   *           beginning and end of a scanline is dword aligned
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  185   */
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  186  static void fast_imageblit(const struct fb_image *image, 
struct fb_info *p,
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  187                                    void *dst1, u32 fgcolor, u32 
bgcolor)
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  188  {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  189          u32 fgx = fgcolor, bgx = bgcolor, bpp = 
p->var.bits_per_pixel;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  190          u32 ppw = 32/bpp, spitch = (image->width + 7)/8;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  191          u32 bit_mask, eorx, shift;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  192          const char *s = image->data, *src;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  193          u32 *dst;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  194          const u32 *tab;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  195          size_t tablen;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  196          u32 colortab[16];
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  197          int i, j, k;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  198  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  199          switch (bpp) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  200          case 8:
e4c690e061b909 drivers/video/sysimgblt.c            Anton Vorontsov    
2008-04-28  201                  tab = fb_be_math(p) ? cfb_tab8_be : 
cfb_tab8_le;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  202                  tablen = 16;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  203                  break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  204          case 16:
e4c690e061b909 drivers/video/sysimgblt.c            Anton Vorontsov    
2008-04-28  205                  tab = fb_be_math(p) ? cfb_tab16_be : 
cfb_tab16_le;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  206                  tablen = 4;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  207                  break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  208          case 32:
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  209                  tab = cfb_tab32;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  210                  tablen = 2;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  211                  break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  212          default:
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  213                  return;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  214          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  215  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  216          for (i = ppw-1; i--; ) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  217                  fgx <<= bpp;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  218                  bgx <<= bpp;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  219                  fgx |= fgcolor;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  220                  bgx |= bgcolor;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  221          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  222  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  223          bit_mask = (1 << ppw) - 1;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  224          eorx = fgx ^ bgx;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  225          k = image->width/ppw;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  226  
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  227          for (i = 0; i < tablen; ++i)
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  228                  colortab[i] = (tab[i] & eorx) ^ bgx;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  229  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  230          for (i = image->height; i--; ) {
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  231                  dst = dst1;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  232                  shift = 8;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  233                  src = s;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  234  
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  235                  /*
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  236                   * Manually unroll the per-line copying loop 
for better
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  237                   * performance. This works until we processed 
the last
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  238                   * completely filled source byte (inclusive).
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  239                   */
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  240                  switch (ppw) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  241                  case 4: /* 8 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  242                          for (j = k; j >= 2; j -= 2, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  243                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  244                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  245                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  246                          break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  247                  case 2: /* 16 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  248                          for (j = k; j >= 4; j -= 4, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  249                                  *dst++ = colortab[(*src >> 6) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  250                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  251                                  *dst++ = colortab[(*src >> 2) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  252                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  253                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  254                          break;
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  255                  case 1: /* 32 bpp */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  256                          for (j = k; j >= 8; j -= 8, ++src) {
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  257                                  *dst++ = colortab[(*src >> 7) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  258                                  *dst++ = colortab[(*src >> 6) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  259                                  *dst++ = colortab[(*src >> 5) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  260                                  *dst++ = colortab[(*src >> 4) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  261                                  *dst++ = colortab[(*src >> 3) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  262                                  *dst++ = colortab[(*src >> 2) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  263                                  *dst++ = colortab[(*src >> 1) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  264                                  *dst++ = colortab[(*src >> 0) 
& bit_mask];
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  265                          }
6f29e04938bf50 drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-02-23  266                          break;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  267                  }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  268  
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  269                  /*
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  270                   * For image widths that are not a multiple of 
8, there
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  271                   * are trailing pixels left on the current 
line. Print
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  272                   * them as well.
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  273                   */
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13 @274                  for (; j--; ) {
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  275                          shift -= ppw;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  276                          *dst++ = colortab[(*src >> shift) & 
bit_mask];
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  277                          if (!shift) {
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  278                                  shift = 8;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  279                                  ++src;
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  280                          }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  281                  }
34e093954c6d2a drivers/video/fbdev/core/sysimgblt.c Thomas Zimmermann  
2022-03-13  282  
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  283                  dst1 += p->fix.line_length;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  284                  s += spitch;
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  285          }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  286  }
68648ed1f58d98 drivers/video/sysimgblt.c            Antonino A. Daplas 
2007-05-08  287  

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

Reply via email to