All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 00/23] drm/i915: Add support for FBs requiring a POT stride padding
@ 2021-03-10 22:17 Imre Deak
  2021-03-10 22:17 ` [Intel-gfx] [PATCH 01/23] drm/i915: Fix rotation setup during plane HW readout Imre Deak
                   ` (25 more replies)
  0 siblings, 26 replies; 65+ messages in thread
From: Imre Deak @ 2021-03-10 22:17 UTC (permalink / raw)
  To: intel-gfx

An upcoming platform requires the stride of tiled display surfaces to be
power-of-two aligned. This patch adds support for this using the FB
remapping logic.

Until the functionality is fully enabled we keep testing it via the
vma selftests and by the last patch which forces the padding on for all
platforms where the FB remapping is possible.

The other goal of the changes is to reduce the size of intel_display.c,
starting to collect all FB plane specific functions to a separate
intel_fb.c file and to share more code between the FB creation and
commit time remapping logic.

For reference I also pushed the changes to:
https://github.com/ideak/linux/commits/fb_pot_remap

Imre Deak (23):
  drm/i915: Fix rotation setup during plane HW readout
  drm/i915/selftest: Fix error handling in igt_vma_remapped_gtt()
  drm/i915/selftest: Fix debug message in igt_vma_remapped_gtt()
  drm/i915: Make sure i915_ggtt_view is inited when creating an FB
  drm/i915/selftest: Make sure to init i915_ggtt_view in
    igt_vma_rotate_remap()
  drm/i915: Remove duplicate intel_surf_alignment() declaration
  drm/i915/intel_fb: Pull FB plane functions from intel_display_types.h
  drm/i915/intel_fb: Pull FB plane functions from skl_universal_plane.c
  drm/i915/intel_fb: Pull is_surface_linear() from
    intel_display.c/skl_universal_plane.c
  drm/i915/intel_fb: Pull FB plane functions from intel_sprite.c
  drm/i915/intel_fb: Pull FB plane functions from intel_display.c
  drm/i915/intel_fb: Unexport intel_fb_check_stride()
  drm/i915/intel_fb: s/dev_priv/i915/
  drm/i915/intel_fb: Factor out convert_plane_offset_to_xy()
  drm/i915/intel_fb: Factor out calc_plane_aligned_offset()
  drm/i915/intel_fb: Factor out calc_plane_normal_size()
  drm/i915/intel_fb: Factor out plane_calc_remap_info()
  drm/i915: Shrink the size of intel_remapped_plane_info struct
  drm/i915/selftest: Unify use of intel_remapped_plane_info in
    igt_vma_rotate_remap()
  drm/i915: s/stride/src_stride/ in the intel_remapped_plane_info struct
  drm/i915: Add support for FBs requiring a POT stride alignment
  drm/i915/selftest: Add remap/rotate vma subtests when
    dst_stride!=width/height
  drm/i915: For-CI: Force remapping the FB with a POT aligned stride

 drivers/gpu/drm/i915/Makefile                 |    1 +
 drivers/gpu/drm/i915/display/i9xx_plane.c     |    1 +
 drivers/gpu/drm/i915/display/intel_cursor.c   |    1 +
 drivers/gpu/drm/i915/display/intel_display.c  |  833 +-------------
 drivers/gpu/drm/i915/display/intel_display.h  |   19 -
 .../drm/i915/display/intel_display_types.h    |   32 +-
 drivers/gpu/drm/i915/display/intel_fb.c       | 1012 +++++++++++++++++
 drivers/gpu/drm/i915/display/intel_fb.h       |   56 +
 drivers/gpu/drm/i915/display/intel_sprite.c   |   32 -
 drivers/gpu/drm/i915/display/intel_sprite.h   |    1 -
 .../drm/i915/display/skl_universal_plane.c    |   41 +-
 .../drm/i915/display/skl_universal_plane.h    |    2 -
 drivers/gpu/drm/i915/gt/intel_ggtt.c          |   58 +-
 drivers/gpu/drm/i915/i915_debugfs.c           |   16 +-
 drivers/gpu/drm/i915/i915_vma_types.h         |   12 +-
 drivers/gpu/drm/i915/selftests/i915_vma.c     |  217 +++-
 16 files changed, 1310 insertions(+), 1024 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/display/intel_fb.c
 create mode 100644 drivers/gpu/drm/i915/display/intel_fb.h

-- 
2.25.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 65+ messages in thread
* Re: [Intel-gfx] [PATCH 18/23] drm/i915: Shrink the size of intel_remapped_plane_info struct
@ 2021-03-11  2:19 kernel test robot
  0 siblings, 0 replies; 65+ messages in thread
From: kernel test robot @ 2021-03-11  2:19 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7015 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210310221736.2963264-19-imre.deak@intel.com>
References: <20210310221736.2963264-19-imre.deak@intel.com>
TO: Imre Deak <imre.deak@intel.com>
TO: intel-gfx(a)lists.freedesktop.org

Hi Imre,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on next-20210310]
[cannot apply to drm-intel/for-linux-next v5.12-rc2]
[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/Imre-Deak/drm-i915-Add-support-for-FBs-requiring-a-POT-stride-padding/20210311-061955
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: x86_64-randconfig-m001-20210309 (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:628 calc_plane_remap_info() warn: right shifting more than type allows 32 vs 32

vim +628 drivers/gpu/drm/i915/display/intel_fb.c

244e592a2a0b66 Imre Deak 2021-03-11  609  
b298241d7baaeb Imre Deak 2021-03-11  610  static u32 calc_plane_remap_info(const struct intel_framebuffer *fb, int color_plane,
b298241d7baaeb Imre Deak 2021-03-11  611  				 const struct fb_plane_view_dims *dims,
b298241d7baaeb Imre Deak 2021-03-11  612  				 enum i915_ggtt_view_type view_type,
b298241d7baaeb Imre Deak 2021-03-11  613  				 u32 obj_offset, u32 gtt_offset, int x, int y,
b298241d7baaeb Imre Deak 2021-03-11  614  				 struct intel_remapped_plane_info *gtt_remap_info,
b298241d7baaeb Imre Deak 2021-03-11  615  				 struct intel_fb_plane_remap_info *plane_remap_info)
b298241d7baaeb Imre Deak 2021-03-11  616  {
b298241d7baaeb Imre Deak 2021-03-11  617  	const struct drm_framebuffer *drm_fb = &fb->base;
b298241d7baaeb Imre Deak 2021-03-11  618  	struct drm_i915_private *i915 = to_i915(drm_fb->dev);
b298241d7baaeb Imre Deak 2021-03-11  619  	unsigned int tile_width = dims->tile_width;
b298241d7baaeb Imre Deak 2021-03-11  620  	unsigned int tile_height = dims->tile_height;
b298241d7baaeb Imre Deak 2021-03-11  621  	unsigned int tile_size = intel_tile_size(i915);
ff830f46b50283 Imre Deak 2021-03-11  622  	unsigned int stride_tiles = plane_view_stride_tiles(fb, color_plane, dims);
ff830f46b50283 Imre Deak 2021-03-11  623  	unsigned int width_tiles = DIV_ROUND_UP(x + dims->width, dims->tile_width);
ff830f46b50283 Imre Deak 2021-03-11  624  	unsigned int height_tiles = plane_view_tile_rows(fb, color_plane, dims, y);
b298241d7baaeb Imre Deak 2021-03-11  625  	unsigned int pitch_tiles;
b298241d7baaeb Imre Deak 2021-03-11  626  	struct drm_rect r;
b298241d7baaeb Imre Deak 2021-03-11  627  
ff830f46b50283 Imre Deak 2021-03-11 @628  	drm_WARN_ON(&i915->drm,
ff830f46b50283 Imre Deak 2021-03-11  629  		    overflows_type(obj_offset, gtt_remap_info->offset) ||
ff830f46b50283 Imre Deak 2021-03-11  630  		    overflows_type(stride_tiles, gtt_remap_info->stride) ||
ff830f46b50283 Imre Deak 2021-03-11  631  		    overflows_type(width_tiles, gtt_remap_info->width) ||
ff830f46b50283 Imre Deak 2021-03-11  632  		    overflows_type(height_tiles, gtt_remap_info->height));
ff830f46b50283 Imre Deak 2021-03-11  633  
b298241d7baaeb Imre Deak 2021-03-11  634  	gtt_remap_info->offset = obj_offset;
ff830f46b50283 Imre Deak 2021-03-11  635  	gtt_remap_info->stride = stride_tiles;
ff830f46b50283 Imre Deak 2021-03-11  636  	gtt_remap_info->width = width_tiles;
ff830f46b50283 Imre Deak 2021-03-11  637  	gtt_remap_info->height = height_tiles;
b298241d7baaeb Imre Deak 2021-03-11  638  
b298241d7baaeb Imre Deak 2021-03-11  639  	if (view_type == I915_GGTT_VIEW_ROTATED) {
b298241d7baaeb Imre Deak 2021-03-11  640  		/* rotate the x/y offsets to match the GTT view */
b298241d7baaeb Imre Deak 2021-03-11  641  		drm_rect_init(&r, x, y, dims->width, dims->height);
b298241d7baaeb Imre Deak 2021-03-11  642  		drm_rect_rotate(&r,
b298241d7baaeb Imre Deak 2021-03-11  643  				gtt_remap_info->width * tile_width,
b298241d7baaeb Imre Deak 2021-03-11  644  				gtt_remap_info->height * tile_height,
b298241d7baaeb Imre Deak 2021-03-11  645  				DRM_MODE_ROTATE_270);
b298241d7baaeb Imre Deak 2021-03-11  646  
b298241d7baaeb Imre Deak 2021-03-11  647  		plane_remap_info->x = r.x1;
b298241d7baaeb Imre Deak 2021-03-11  648  		plane_remap_info->y = r.y1;
b298241d7baaeb Imre Deak 2021-03-11  649  
b298241d7baaeb Imre Deak 2021-03-11  650  		pitch_tiles = gtt_remap_info->height;
b298241d7baaeb Imre Deak 2021-03-11  651  		plane_remap_info->pitch = pitch_tiles * tile_height;
b298241d7baaeb Imre Deak 2021-03-11  652  		/* rotate the tile dimensions to match the GTT view */
b298241d7baaeb Imre Deak 2021-03-11  653  		swap(tile_width, tile_height);
b298241d7baaeb Imre Deak 2021-03-11  654  	} else {
b298241d7baaeb Imre Deak 2021-03-11  655  		drm_WARN_ON(&i915->drm, view_type != I915_GGTT_VIEW_REMAPPED);
b298241d7baaeb Imre Deak 2021-03-11  656  
b298241d7baaeb Imre Deak 2021-03-11  657  		plane_remap_info->x = x;
b298241d7baaeb Imre Deak 2021-03-11  658  		plane_remap_info->y = y;
b298241d7baaeb Imre Deak 2021-03-11  659  
b298241d7baaeb Imre Deak 2021-03-11  660  		pitch_tiles = gtt_remap_info->width;
b298241d7baaeb Imre Deak 2021-03-11  661  		plane_remap_info->pitch = pitch_tiles * tile_width * drm_fb->format->cpp[color_plane];
b298241d7baaeb Imre Deak 2021-03-11  662  	}
b298241d7baaeb Imre Deak 2021-03-11  663  
b298241d7baaeb Imre Deak 2021-03-11  664  	/*
b298241d7baaeb Imre Deak 2021-03-11  665  	 * We only keep the x/y offsets, so push all of the
b298241d7baaeb Imre Deak 2021-03-11  666  	 * gtt offset into the x/y offsets.
b298241d7baaeb Imre Deak 2021-03-11  667  	 * x,y will hold the first pixel of the framebuffer
b298241d7baaeb Imre Deak 2021-03-11  668  	 * plane from the start of the remapped/rotated gtt
b298241d7baaeb Imre Deak 2021-03-11  669  	 * mapping.
b298241d7baaeb Imre Deak 2021-03-11  670  	 */
b298241d7baaeb Imre Deak 2021-03-11  671  	intel_adjust_tile_offset(&plane_remap_info->x, &plane_remap_info->y,
b298241d7baaeb Imre Deak 2021-03-11  672  				 tile_width, tile_height,
b298241d7baaeb Imre Deak 2021-03-11  673  				 tile_size, pitch_tiles,
b298241d7baaeb Imre Deak 2021-03-11  674  				 gtt_offset * tile_size, 0);
b298241d7baaeb Imre Deak 2021-03-11  675  
b298241d7baaeb Imre Deak 2021-03-11  676  	return gtt_remap_info->width * gtt_remap_info->height;
b298241d7baaeb Imre Deak 2021-03-11  677  }
b298241d7baaeb Imre Deak 2021-03-11  678  

---
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: 41432 bytes --]

^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2021-03-15 14:44 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 22:17 [Intel-gfx] [PATCH 00/23] drm/i915: Add support for FBs requiring a POT stride padding Imre Deak
2021-03-10 22:17 ` [Intel-gfx] [PATCH 01/23] drm/i915: Fix rotation setup during plane HW readout Imre Deak
2021-03-11 16:04   ` Ville Syrjälä
2021-03-11 16:52     ` Imre Deak
2021-03-11 17:25       ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 02/23] drm/i915/selftest: Fix error handling in igt_vma_remapped_gtt() Imre Deak
2021-03-11 16:05   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 03/23] drm/i915/selftest: Fix debug message " Imre Deak
2021-03-11 16:06   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 04/23] drm/i915: Make sure i915_ggtt_view is inited when creating an FB Imre Deak
2021-03-11 16:07   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 05/23] drm/i915/selftest: Make sure to init i915_ggtt_view in igt_vma_rotate_remap() Imre Deak
2021-03-11 16:11   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 06/23] drm/i915: Remove duplicate intel_surf_alignment() declaration Imre Deak
2021-03-11 16:12   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 07/23] drm/i915/intel_fb: Pull FB plane functions from intel_display_types.h Imre Deak
2021-03-11 16:15   ` Ville Syrjälä
2021-03-11 16:31     ` Imre Deak
2021-03-10 22:17 ` [Intel-gfx] [PATCH 08/23] drm/i915/intel_fb: Pull FB plane functions from skl_universal_plane.c Imre Deak
2021-03-11 16:18   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 09/23] drm/i915/intel_fb: Pull is_surface_linear() from intel_display.c/skl_universal_plane.c Imre Deak
2021-03-11 16:19   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 10/23] drm/i915/intel_fb: Pull FB plane functions from intel_sprite.c Imre Deak
2021-03-11 16:20   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 11/23] drm/i915/intel_fb: Pull FB plane functions from intel_display.c Imre Deak
2021-03-11 16:23   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 12/23] drm/i915/intel_fb: Unexport intel_fb_check_stride() Imre Deak
2021-03-11 16:23   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 13/23] drm/i915/intel_fb: s/dev_priv/i915/ Imre Deak
2021-03-11 16:23   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 14/23] drm/i915/intel_fb: Factor out convert_plane_offset_to_xy() Imre Deak
2021-03-11 16:32   ` Ville Syrjälä
2021-03-11 16:37     ` Ville Syrjälä
2021-03-11 16:57     ` Imre Deak
2021-03-10 22:17 ` [Intel-gfx] [PATCH 15/23] drm/i915/intel_fb: Factor out calc_plane_aligned_offset() Imre Deak
2021-03-11 16:39   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 16/23] drm/i915/intel_fb: Factor out calc_plane_normal_size() Imre Deak
2021-03-11 16:52   ` Ville Syrjälä
2021-03-11 17:02     ` Imre Deak
2021-03-11 17:26       ` Ville Syrjälä
2021-03-11 17:47         ` Imre Deak
2021-03-11 17:58           ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 17/23] drm/i915/intel_fb: Factor out plane_calc_remap_info() Imre Deak
2021-03-11 17:21   ` Ville Syrjälä
2021-03-11 19:04     ` Imre Deak
2021-03-11 19:35       ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 18/23] drm/i915: Shrink the size of intel_remapped_plane_info struct Imre Deak
2021-03-11 19:45   ` Ville Syrjälä
2021-03-11 22:19     ` Imre Deak
2021-03-12 18:09       ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 19/23] drm/i915/selftest: Unify use of intel_remapped_plane_info in igt_vma_rotate_remap() Imre Deak
2021-03-11 21:17   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 20/23] drm/i915: s/stride/src_stride/ in the intel_remapped_plane_info struct Imre Deak
2021-03-12 17:51   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 21/23] drm/i915: Add support for FBs requiring a POT stride alignment Imre Deak
2021-03-12 18:02   ` Ville Syrjälä
2021-03-13 14:36     ` Imre Deak
2021-03-15 14:44       ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 22/23] drm/i915/selftest: Add remap/rotate vma subtests when dst_stride!=width/height Imre Deak
2021-03-12 18:03   ` Ville Syrjälä
2021-03-10 22:17 ` [Intel-gfx] [PATCH 23/23] drm/i915: For-CI: Force remapping the FB with a POT aligned stride Imre Deak
2021-03-10 23:53 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add support for FBs requiring a POT stride padding Patchwork
2021-03-10 23:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-11  0:22 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-03-11  2:19 [Intel-gfx] [PATCH 18/23] drm/i915: Shrink the size of intel_remapped_plane_info struct 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.