From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v7 2/3] drm: Add support for the LogiCVC display controller
Date: Sat, 14 Nov 2020 14:50:42 +0800 [thread overview]
Message-ID: <202011141425.deEiQBfp-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9613 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201102155308.142691-3-paul.kocialkowski@bootlin.com>
References: <20201102155308.142691-3-paul.kocialkowski@bootlin.com>
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
TO: dri-devel(a)lists.freedesktop.org
TO: devicetree(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Rob Herring <robh+dt@kernel.org>
CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Hi Paul,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-exynos/exynos-drm-next]
[also build test WARNING on tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.10-rc3 next-20201113]
[cannot apply to drm-intel/for-linux-next drm/drm-next]
[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/Paul-Kocialkowski/drm-LogiCVC-display-controller-support/20201102-235352
base: https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
:::::: branch date: 12 days ago
:::::: commit date: 12 days ago
config: x86_64-randconfig-m001-20201114 (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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/logicvc/logicvc_layer.c:312 logicvc_layer_buffer_find_setup() warn: impossible condition '(hoffset > (((((1))) << (16)) - 1)) => (0-u16max > u16max)'
vim +312 drivers/gpu/drm/logicvc/logicvc_layer.c
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 249
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 250 int logicvc_layer_buffer_find_setup(struct logicvc_drm *logicvc,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 251 struct logicvc_layer *layer,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 252 struct drm_plane_state *state,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 253 struct logicvc_layer_buffer_setup *setup)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 254 {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 255 struct drm_device *drm_dev = &logicvc->drm_dev;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 256 struct drm_framebuffer *fb = state->fb;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 257 /* All the supported formats have a single data plane. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 258 u32 layer_bytespp = fb->format->cpp[0];
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 259 u32 layer_stride = layer_bytespp * logicvc->config.row_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 260 u32 base_offset = layer->config.base_offset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 261 u32 buffer_offset = layer->config.buffer_offset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 262 u8 buffer_sel = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 263 u16 voffset = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 264 u16 hoffset = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 265 phys_addr_t fb_addr;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 266 u32 fb_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 267 u32 gap;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 268
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 269 if (!logicvc->reserved_mem_base) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 270 drm_err(drm_dev, "No reserved memory base was registered!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 271 return -ENOMEM;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 272 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 273
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 274 fb_addr = drm_fb_cma_get_gem_addr(fb, state, 0);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 275 if (fb_addr < logicvc->reserved_mem_base) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 276 drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 277 "Framebuffer memory below reserved memory base!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 278 return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 279 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 280
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 281 fb_offset = (u32) (fb_addr - logicvc->reserved_mem_base);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 282
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 283 if (fb_offset < base_offset) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 284 drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 285 "Framebuffer offset below layer base offset!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 286 return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 287 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 288
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 289 gap = fb_offset - base_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 290
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 291 /* Use the possible video buffers selection. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 292 if (gap && buffer_offset) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 293 buffer_sel = gap / buffer_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 294 if (buffer_sel > LOGICVC_BUFFER_SEL_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 295 buffer_sel = LOGICVC_BUFFER_SEL_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 296
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 297 gap -= buffer_sel * buffer_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 298 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 299
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 300 /* Use the vertical offset. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 301 if (gap && layer_stride && logicvc->config.layers_configurable) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 302 voffset = gap / layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 303 if (voffset > LOGICVC_LAYER_VOFFSET_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 304 voffset = LOGICVC_LAYER_VOFFSET_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 305
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 306 gap -= voffset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 307 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 308
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 309 /* Use the horizontal offset. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 310 if (gap && layer_bytespp && logicvc->config.layers_configurable) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 311 hoffset = gap / layer_bytespp;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 @312 if (hoffset > LOGICVC_DIMENSIONS_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 313 hoffset = LOGICVC_DIMENSIONS_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 314
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 315 gap -= hoffset * layer_bytespp;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 316 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 317
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 318 if (gap) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 319 drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 320 "Unable to find layer %d buffer setup for 0x%x byte gap\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 321 layer->index, fb_offset - base_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 322 return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 323 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 324
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 325 DRM_DEBUG_DRIVER("Found layer %d buffer setup for 0x%x byte gap:\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 326 layer->index, fb_offset - base_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 327
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 328 DRM_DEBUG_DRIVER("- buffer_sel = 0x%x chunks of 0x%x bytes\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 329 buffer_sel, buffer_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 330 DRM_DEBUG_DRIVER("- voffset = 0x%x chunks of 0x%x bytes\n", voffset,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 331 layer_stride);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 332 DRM_DEBUG_DRIVER("- hoffset = 0x%x chunks of 0x%x bytes\n", hoffset,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 333 layer_bytespp);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 334
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 335 if (setup) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 336 setup->buffer_sel = buffer_sel;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 337 setup->voffset = voffset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 338 setup->hoffset = hoffset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 339 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 340
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 341 return 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 342 }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 343
---
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: 27764 bytes --]
next reply other threads:[~2020-11-14 6:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-14 6:50 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-11-02 15:53 [PATCH v7 0/3] drm: LogiCVC display controller support Paul Kocialkowski
2020-11-02 15:53 ` [PATCH v7 2/3] drm: Add support for the LogiCVC display controller Paul Kocialkowski
2020-11-02 15:53 ` Paul Kocialkowski
2020-11-03 9:46 ` Maxime Ripard
2020-11-03 9:46 ` Maxime Ripard
2020-12-02 16:06 ` Paul Kocialkowski
2020-12-02 16:06 ` Paul Kocialkowski
2020-12-07 10:42 ` Maxime Ripard
2020-12-07 10:42 ` Maxime Ripard
2020-12-11 13:17 ` Paul Kocialkowski
2020-12-11 13:17 ` Paul Kocialkowski
2020-11-04 21:22 ` Sam Ravnborg
2020-11-04 21:22 ` Sam Ravnborg
2020-12-02 15:36 ` Paul Kocialkowski
2020-12-02 15:36 ` Paul Kocialkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202011141425.deEiQBfp-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.