[Intel-gfx] [PATCH v7 3/3] drm/i915/tgl: Add Clear Color support for TGL Render Decompression

Dan Carpenter dan.carpenter at oracle.com
Tue Jan 19 08:29:37 UTC 2021


Hi Imre,

url:    https://github.com/0day-ci/linux/commits/Imre-Deak/drm-i915-gen12-Add-display-render-clear-color-decompression-support/20210115-113136
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20210115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>

New smatch warnings:
drivers/gpu/drm/i915/display/intel_display.c:15299 intel_atomic_prepare_plane_clear_colors() warn: taking sizeof binop

vim +15299 drivers/gpu/drm/i915/display/intel_display.c

d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15273  static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *state)
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15274  {
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15275  	struct drm_device *dev = state->base.dev;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15276  	struct drm_i915_private *i915 = to_i915(dev);
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15277  	struct intel_plane *plane;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15278  	struct intel_plane_state *plane_state;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15279  	int i;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15280  
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15281  	for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15282  		struct drm_framebuffer *fb = plane_state->hw.fb;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15283  		struct drm_i915_gem_object *obj;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15284  		int ret;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15285  
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15286  		if (!fb ||
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15287  		    fb->modifier != I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC)
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15288  			continue;
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15289  
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15290  		obj = intel_fb_obj(fb);
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15291  		/*
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15292  		 * The layout of the fast clear color value expected by HW:
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15293  		 * - 4 x 4 bytes per-channel value (in surface type specific float/int format)
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15294  		 * - 8 bytes native color value used by the display (converted/written by GPU during
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15295  		 *   a fast clear operation using the above per-channel values)
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15296  		 */
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15297  		ret = i915_gem_object_read_from_page(obj,
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15298  						     fb->offsets[2] + 16,
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14 @15299  						     sizeof(&plane_state->ccval),
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15300  						     &plane_state->ccval);

This is a bug in Smatch and it's quite complicated to fix...  But the
sizeof() is still probably wrong.  It should be the size of the u64
instead of the address.

d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15301  		/*
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15302  		 * The obj is pinned and synced against GPU writes already, so
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15303  		 * the above can't normally fail.
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15304  		 */
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15305  		drm_WARN_ON(&i915->drm, ret);
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15306  	}
d5de4516a9de74 drivers/gpu/drm/i915/display/intel_display.c Radhakrishna Sripada 2021-01-14  15307  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 34082 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20210119/e4f7a385/attachment-0001.gz>


More information about the Intel-gfx mailing list