* [linux-next:master 7759/9190] drivers/gpu/drm/i915/display/intel_fb.c:635 calc_plane_remap_info() warn: right shifting more than type allows 32 vs 32
@ 2021-04-01 21:45 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-01 21:45 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 6227 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Imre Deak <imre.deak@intel.com>
CC: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 454c576c3f5e51d60f00a4ac0dde07f4f9d70e9d
commit: 1b6b032aa46f6c0749555dd67f6e576504018252 [7759/9190] drm/i915: Shrink the size of intel_remapped_plane_info struct
:::::: branch date: 13 hours ago
:::::: commit date: 3 days ago
config: i386-randconfig-m031-20210401 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/i915/display/intel_fb.c:635 calc_plane_remap_info() warn: right shifting more than type allows 32 vs 32
vim +635 drivers/gpu/drm/i915/display/intel_fb.c
1b6b032aa46f6c0 Imre Deak 2021-03-25 620
23c87dc6777c25f Imre Deak 2021-03-25 621 static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_plane,
23c87dc6777c25f Imre Deak 2021-03-25 622 const struct fb_plane_view_dims *dims,
23c87dc6777c25f Imre Deak 2021-03-25 623 u32 obj_offset, u32 gtt_offset, int x, int y,
23c87dc6777c25f Imre Deak 2021-03-25 624 struct intel_fb_view *view)
23c87dc6777c25f Imre Deak 2021-03-25 625 {
23c87dc6777c25f Imre Deak 2021-03-25 626 struct drm_i915_private *i915 = to_i915(fb->base.dev);
23c87dc6777c25f Imre Deak 2021-03-25 627 struct intel_remapped_plane_info *remap_info = &view->gtt.remapped.plane[color_plane];
23c87dc6777c25f Imre Deak 2021-03-25 628 struct i915_color_plane_view *color_plane_info = &view->color_plane[color_plane];
23c87dc6777c25f Imre Deak 2021-03-25 629 unsigned int tile_width = dims->tile_width;
23c87dc6777c25f Imre Deak 2021-03-25 630 unsigned int tile_height = dims->tile_height;
23c87dc6777c25f Imre Deak 2021-03-25 631 unsigned int tile_size = intel_tile_size(i915);
23c87dc6777c25f Imre Deak 2021-03-25 632 unsigned int pitch_tiles;
23c87dc6777c25f Imre Deak 2021-03-25 633 struct drm_rect r;
23c87dc6777c25f Imre Deak 2021-03-25 634
1b6b032aa46f6c0 Imre Deak 2021-03-25 @635 assign_chk_ovf(i915, remap_info->offset, obj_offset);
1b6b032aa46f6c0 Imre Deak 2021-03-25 636 assign_chk_ovf(i915, remap_info->stride, plane_view_stride_tiles(fb, color_plane, dims));
1b6b032aa46f6c0 Imre Deak 2021-03-25 637 assign_chk_ovf(i915, remap_info->width, plane_view_width_tiles(fb, color_plane, dims, x));
1b6b032aa46f6c0 Imre Deak 2021-03-25 638 assign_chk_ovf(i915, remap_info->height, plane_view_height_tiles(fb, color_plane, dims, y));
23c87dc6777c25f Imre Deak 2021-03-25 639
23c87dc6777c25f Imre Deak 2021-03-25 640 if (view->gtt.type == I915_GGTT_VIEW_ROTATED) {
23c87dc6777c25f Imre Deak 2021-03-25 641 check_array_bounds(i915, view->gtt.rotated.plane, color_plane);
23c87dc6777c25f Imre Deak 2021-03-25 642
23c87dc6777c25f Imre Deak 2021-03-25 643 /* rotate the x/y offsets to match the GTT view */
23c87dc6777c25f Imre Deak 2021-03-25 644 drm_rect_init(&r, x, y, dims->width, dims->height);
23c87dc6777c25f Imre Deak 2021-03-25 645 drm_rect_rotate(&r,
23c87dc6777c25f Imre Deak 2021-03-25 646 remap_info->width * tile_width,
23c87dc6777c25f Imre Deak 2021-03-25 647 remap_info->height * tile_height,
23c87dc6777c25f Imre Deak 2021-03-25 648 DRM_MODE_ROTATE_270);
23c87dc6777c25f Imre Deak 2021-03-25 649
23c87dc6777c25f Imre Deak 2021-03-25 650 color_plane_info->x = r.x1;
23c87dc6777c25f Imre Deak 2021-03-25 651 color_plane_info->y = r.y1;
23c87dc6777c25f Imre Deak 2021-03-25 652
23c87dc6777c25f Imre Deak 2021-03-25 653 pitch_tiles = remap_info->height;
23c87dc6777c25f Imre Deak 2021-03-25 654 color_plane_info->stride = pitch_tiles * tile_height;
23c87dc6777c25f Imre Deak 2021-03-25 655
23c87dc6777c25f Imre Deak 2021-03-25 656 /* rotate the tile dimensions to match the GTT view */
23c87dc6777c25f Imre Deak 2021-03-25 657 swap(tile_width, tile_height);
23c87dc6777c25f Imre Deak 2021-03-25 658 } else {
23c87dc6777c25f Imre Deak 2021-03-25 659 drm_WARN_ON(&i915->drm, view->gtt.type != I915_GGTT_VIEW_REMAPPED);
23c87dc6777c25f Imre Deak 2021-03-25 660
23c87dc6777c25f Imre Deak 2021-03-25 661 check_array_bounds(i915, view->gtt.remapped.plane, color_plane);
23c87dc6777c25f Imre Deak 2021-03-25 662
23c87dc6777c25f Imre Deak 2021-03-25 663 color_plane_info->x = x;
23c87dc6777c25f Imre Deak 2021-03-25 664 color_plane_info->y = y;
23c87dc6777c25f Imre Deak 2021-03-25 665
23c87dc6777c25f Imre Deak 2021-03-25 666 pitch_tiles = remap_info->width;
23c87dc6777c25f Imre Deak 2021-03-25 667 color_plane_info->stride = pitch_tiles * tile_width *
23c87dc6777c25f Imre Deak 2021-03-25 668 fb->base.format->cpp[color_plane];
23c87dc6777c25f Imre Deak 2021-03-25 669 }
23c87dc6777c25f Imre Deak 2021-03-25 670
23c87dc6777c25f Imre Deak 2021-03-25 671 /*
23c87dc6777c25f Imre Deak 2021-03-25 672 * We only keep the x/y offsets, so push all of the gtt offset into
23c87dc6777c25f Imre Deak 2021-03-25 673 * the x/y offsets. x,y will hold the first pixel of the framebuffer
23c87dc6777c25f Imre Deak 2021-03-25 674 * plane from the start of the remapped/rotated gtt mapping.
23c87dc6777c25f Imre Deak 2021-03-25 675 */
23c87dc6777c25f Imre Deak 2021-03-25 676 intel_adjust_tile_offset(&color_plane_info->x, &color_plane_info->y,
23c87dc6777c25f Imre Deak 2021-03-25 677 tile_width, tile_height,
23c87dc6777c25f Imre Deak 2021-03-25 678 tile_size, pitch_tiles,
23c87dc6777c25f Imre Deak 2021-03-25 679 gtt_offset * tile_size, 0);
23c87dc6777c25f Imre Deak 2021-03-25 680
23c87dc6777c25f Imre Deak 2021-03-25 681 return remap_info->width * remap_info->height;
23c87dc6777c25f Imre Deak 2021-03-25 682 }
23c87dc6777c25f Imre Deak 2021-03-25 683
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30429 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-01 21:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-01 21:45 [linux-next:master 7759/9190] drivers/gpu/drm/i915/display/intel_fb.c:635 calc_plane_remap_info() warn: right shifting more than type allows 32 vs 32 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.