* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
@ 2020-08-26 21:34 kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2020-08-26 21:34 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 8295 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200826123506.19560-4-p.zabel@pengutronix.de>
References: <20200826123506.19560-4-p.zabel@pengutronix.de>
TO: Philipp Zabel <p.zabel@pengutronix.de>
TO: dri-devel(a)lists.freedesktop.org
CC: kernel(a)pengutronix.de
CC: Thomas Zimmermann <tzimmermann@suse.de>
Hi Philipp,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip linus/master v5.9-rc2 next-20200826]
[cannot apply to tegra-drm/drm/tegra/for-next drm-exynos/exynos-drm-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/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: x86_64-randconfig-m001-20200826 (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/drm_crtc.c:343 drm_crtc_init_with_planes() error: uninitialized symbol 'ap'.
drivers/gpu/drm/drm_crtc.c:383 __drmm_crtc_alloc_with_planes() error: uninitialized symbol 'ap'.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +/ap +343 drivers/gpu/drm/drm_crtc.c
236b7bc44ae0fd Philipp Zabel 2020-08-26 311
236b7bc44ae0fd Philipp Zabel 2020-08-26 312 /**
236b7bc44ae0fd Philipp Zabel 2020-08-26 313 * drm_crtc_init_with_planes - Initialise a new CRTC object with
236b7bc44ae0fd Philipp Zabel 2020-08-26 314 * specified primary and cursor planes.
236b7bc44ae0fd Philipp Zabel 2020-08-26 315 * @dev: DRM device
236b7bc44ae0fd Philipp Zabel 2020-08-26 316 * @crtc: CRTC object to init
236b7bc44ae0fd Philipp Zabel 2020-08-26 317 * @primary: Primary plane for CRTC
236b7bc44ae0fd Philipp Zabel 2020-08-26 318 * @cursor: Cursor plane for CRTC
236b7bc44ae0fd Philipp Zabel 2020-08-26 319 * @funcs: callbacks for the new CRTC
236b7bc44ae0fd Philipp Zabel 2020-08-26 320 * @name: printf style format string for the CRTC name, or NULL for default name
236b7bc44ae0fd Philipp Zabel 2020-08-26 321 *
236b7bc44ae0fd Philipp Zabel 2020-08-26 322 * Inits a new object created as base part of a driver crtc object. Drivers
236b7bc44ae0fd Philipp Zabel 2020-08-26 323 * should use this function instead of drm_crtc_init(), which is only provided
236b7bc44ae0fd Philipp Zabel 2020-08-26 324 * for backwards compatibility with drivers which do not yet support universal
236b7bc44ae0fd Philipp Zabel 2020-08-26 325 * planes). For really simple hardware which has only 1 plane look at
236b7bc44ae0fd Philipp Zabel 2020-08-26 326 * drm_simple_display_pipe_init() instead.
236b7bc44ae0fd Philipp Zabel 2020-08-26 327 *
236b7bc44ae0fd Philipp Zabel 2020-08-26 328 * Returns:
236b7bc44ae0fd Philipp Zabel 2020-08-26 329 * Zero on success, error code on failure.
236b7bc44ae0fd Philipp Zabel 2020-08-26 330 */
236b7bc44ae0fd Philipp Zabel 2020-08-26 331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
236b7bc44ae0fd Philipp Zabel 2020-08-26 332 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 333 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 334 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 335 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 336 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 337 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 338 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 339
236b7bc44ae0fd Philipp Zabel 2020-08-26 340 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 341 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @343 name, ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 344 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 345 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 346
236b7bc44ae0fd Philipp Zabel 2020-08-26 347 return ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 348 }
e13161af80c185 Matt Roper 2014-04-01 349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
f453ba0460742a Dave Airlie 2008-11-07 350
236b7bc44ae0fd Philipp Zabel 2020-08-26 351 static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 352 void *ptr)
236b7bc44ae0fd Philipp Zabel 2020-08-26 353 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 354 struct drm_crtc *crtc = ptr;
236b7bc44ae0fd Philipp Zabel 2020-08-26 355
236b7bc44ae0fd Philipp Zabel 2020-08-26 356 drm_crtc_cleanup(crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 357 }
236b7bc44ae0fd Philipp Zabel 2020-08-26 358
236b7bc44ae0fd Philipp Zabel 2020-08-26 359 void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 360 size_t size, size_t offset,
236b7bc44ae0fd Philipp Zabel 2020-08-26 361 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 362 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 363 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 364 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 365 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 366 void *container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 367 struct drm_crtc *crtc;
236b7bc44ae0fd Philipp Zabel 2020-08-26 368 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 369 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 370
236b7bc44ae0fd Philipp Zabel 2020-08-26 371 if (!funcs || funcs->destroy)
236b7bc44ae0fd Philipp Zabel 2020-08-26 372 return ERR_PTR(-EINVAL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 373
236b7bc44ae0fd Philipp Zabel 2020-08-26 374 container = drmm_kzalloc(dev, size, GFP_KERNEL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 375 if (!container)
236b7bc44ae0fd Philipp Zabel 2020-08-26 376 return ERR_PTR(-ENOMEM);
236b7bc44ae0fd Philipp Zabel 2020-08-26 377
236b7bc44ae0fd Philipp Zabel 2020-08-26 378 crtc = container + offset;
236b7bc44ae0fd Philipp Zabel 2020-08-26 379
236b7bc44ae0fd Philipp Zabel 2020-08-26 380 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 381 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 382 ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @383 name, ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 384 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 385 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 386 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 387 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 388
236b7bc44ae0fd Philipp Zabel 2020-08-26 389 ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
236b7bc44ae0fd Philipp Zabel 2020-08-26 390 crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 391 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 392 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 393
236b7bc44ae0fd Philipp Zabel 2020-08-26 394 return container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 395 }
236b7bc44ae0fd Philipp Zabel 2020-08-26 396 EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes);
236b7bc44ae0fd Philipp Zabel 2020-08-26 397
---
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: 40635 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
2020-08-26 12:35 ` [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes() Philipp Zabel
2020-08-26 18:04 ` kernel test robot
@ 2020-08-31 9:39 ` Dan Carpenter
2020-08-31 9:39 ` Dan Carpenter
2 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2020-08-31 9:39 UTC (permalink / raw)
To: kbuild, Philipp Zabel, dri-devel
Cc: Thomas Zimmermann, kbuild-all, lkp, kernel
[-- Attachment #1: Type: text/plain, Size: 5645 bytes --]
Hi Philipp,
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20200826 (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/drm_crtc.c:343 drm_crtc_init_with_planes() error: uninitialized symbol 'ap'.
drivers/gpu/drm/drm_crtc.c:383 __drmm_crtc_alloc_with_planes() error: uninitialized symbol 'ap'.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +/ap +343 drivers/gpu/drm/drm_crtc.c
236b7bc44ae0fd Philipp Zabel 2020-08-26 331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
236b7bc44ae0fd Philipp Zabel 2020-08-26 332 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 333 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 334 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 335 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 336 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 337 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 338 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 339
236b7bc44ae0fd Philipp Zabel 2020-08-26 340 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 341 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @343 name, ap);
^^
236b7bc44ae0fd Philipp Zabel 2020-08-26 344 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 345 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 346
236b7bc44ae0fd Philipp Zabel 2020-08-26 347 return ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 348 }
e13161af80c185 Matt Roper 2014-04-01 349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
f453ba0460742a Dave Airlie 2008-11-07 350
236b7bc44ae0fd Philipp Zabel 2020-08-26 351 static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 352 void *ptr)
236b7bc44ae0fd Philipp Zabel 2020-08-26 353 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 354 struct drm_crtc *crtc = ptr;
236b7bc44ae0fd Philipp Zabel 2020-08-26 355
236b7bc44ae0fd Philipp Zabel 2020-08-26 356 drm_crtc_cleanup(crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 357 }
236b7bc44ae0fd Philipp Zabel 2020-08-26 358
236b7bc44ae0fd Philipp Zabel 2020-08-26 359 void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 360 size_t size, size_t offset,
236b7bc44ae0fd Philipp Zabel 2020-08-26 361 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 362 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 363 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 364 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 365 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 366 void *container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 367 struct drm_crtc *crtc;
236b7bc44ae0fd Philipp Zabel 2020-08-26 368 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 369 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 370
236b7bc44ae0fd Philipp Zabel 2020-08-26 371 if (!funcs || funcs->destroy)
236b7bc44ae0fd Philipp Zabel 2020-08-26 372 return ERR_PTR(-EINVAL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 373
236b7bc44ae0fd Philipp Zabel 2020-08-26 374 container = drmm_kzalloc(dev, size, GFP_KERNEL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 375 if (!container)
236b7bc44ae0fd Philipp Zabel 2020-08-26 376 return ERR_PTR(-ENOMEM);
236b7bc44ae0fd Philipp Zabel 2020-08-26 377
236b7bc44ae0fd Philipp Zabel 2020-08-26 378 crtc = container + offset;
236b7bc44ae0fd Philipp Zabel 2020-08-26 379
236b7bc44ae0fd Philipp Zabel 2020-08-26 380 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 381 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 382 ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @383 name, ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 384 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 385 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 386 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 387 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 388
236b7bc44ae0fd Philipp Zabel 2020-08-26 389 ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
236b7bc44ae0fd Philipp Zabel 2020-08-26 390 crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 391 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 392 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 393
236b7bc44ae0fd Philipp Zabel 2020-08-26 394 return container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 395 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40635 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
@ 2020-08-31 9:39 ` Dan Carpenter
0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2020-08-31 9:39 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5741 bytes --]
Hi Philipp,
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20200826 (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/drm_crtc.c:343 drm_crtc_init_with_planes() error: uninitialized symbol 'ap'.
drivers/gpu/drm/drm_crtc.c:383 __drmm_crtc_alloc_with_planes() error: uninitialized symbol 'ap'.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +/ap +343 drivers/gpu/drm/drm_crtc.c
236b7bc44ae0fd Philipp Zabel 2020-08-26 331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
236b7bc44ae0fd Philipp Zabel 2020-08-26 332 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 333 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 334 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 335 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 336 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 337 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 338 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 339
236b7bc44ae0fd Philipp Zabel 2020-08-26 340 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 341 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @343 name, ap);
^^
236b7bc44ae0fd Philipp Zabel 2020-08-26 344 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 345 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 346
236b7bc44ae0fd Philipp Zabel 2020-08-26 347 return ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 348 }
e13161af80c185 Matt Roper 2014-04-01 349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
f453ba0460742a Dave Airlie 2008-11-07 350
236b7bc44ae0fd Philipp Zabel 2020-08-26 351 static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 352 void *ptr)
236b7bc44ae0fd Philipp Zabel 2020-08-26 353 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 354 struct drm_crtc *crtc = ptr;
236b7bc44ae0fd Philipp Zabel 2020-08-26 355
236b7bc44ae0fd Philipp Zabel 2020-08-26 356 drm_crtc_cleanup(crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 357 }
236b7bc44ae0fd Philipp Zabel 2020-08-26 358
236b7bc44ae0fd Philipp Zabel 2020-08-26 359 void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 360 size_t size, size_t offset,
236b7bc44ae0fd Philipp Zabel 2020-08-26 361 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 362 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 363 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 364 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 365 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 366 void *container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 367 struct drm_crtc *crtc;
236b7bc44ae0fd Philipp Zabel 2020-08-26 368 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 369 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 370
236b7bc44ae0fd Philipp Zabel 2020-08-26 371 if (!funcs || funcs->destroy)
236b7bc44ae0fd Philipp Zabel 2020-08-26 372 return ERR_PTR(-EINVAL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 373
236b7bc44ae0fd Philipp Zabel 2020-08-26 374 container = drmm_kzalloc(dev, size, GFP_KERNEL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 375 if (!container)
236b7bc44ae0fd Philipp Zabel 2020-08-26 376 return ERR_PTR(-ENOMEM);
236b7bc44ae0fd Philipp Zabel 2020-08-26 377
236b7bc44ae0fd Philipp Zabel 2020-08-26 378 crtc = container + offset;
236b7bc44ae0fd Philipp Zabel 2020-08-26 379
236b7bc44ae0fd Philipp Zabel 2020-08-26 380 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 381 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 382 ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @383 name, ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 384 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 385 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 386 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 387 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 388
236b7bc44ae0fd Philipp Zabel 2020-08-26 389 ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
236b7bc44ae0fd Philipp Zabel 2020-08-26 390 crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 391 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 392 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 393
236b7bc44ae0fd Philipp Zabel 2020-08-26 394 return container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 395 }
---
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: 40635 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
@ 2020-08-31 9:39 ` Dan Carpenter
0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2020-08-31 9:39 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5741 bytes --]
Hi Philipp,
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-m001-20200826 (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/drm_crtc.c:343 drm_crtc_init_with_planes() error: uninitialized symbol 'ap'.
drivers/gpu/drm/drm_crtc.c:383 __drmm_crtc_alloc_with_planes() error: uninitialized symbol 'ap'.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +/ap +343 drivers/gpu/drm/drm_crtc.c
236b7bc44ae0fd Philipp Zabel 2020-08-26 331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
236b7bc44ae0fd Philipp Zabel 2020-08-26 332 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 333 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 334 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 335 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 336 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 337 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 338 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 339
236b7bc44ae0fd Philipp Zabel 2020-08-26 340 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 341 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @343 name, ap);
^^
236b7bc44ae0fd Philipp Zabel 2020-08-26 344 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 345 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 346
236b7bc44ae0fd Philipp Zabel 2020-08-26 347 return ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 348 }
e13161af80c185 Matt Roper 2014-04-01 349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
f453ba0460742a Dave Airlie 2008-11-07 350
236b7bc44ae0fd Philipp Zabel 2020-08-26 351 static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 352 void *ptr)
236b7bc44ae0fd Philipp Zabel 2020-08-26 353 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 354 struct drm_crtc *crtc = ptr;
236b7bc44ae0fd Philipp Zabel 2020-08-26 355
236b7bc44ae0fd Philipp Zabel 2020-08-26 356 drm_crtc_cleanup(crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 357 }
236b7bc44ae0fd Philipp Zabel 2020-08-26 358
236b7bc44ae0fd Philipp Zabel 2020-08-26 359 void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
236b7bc44ae0fd Philipp Zabel 2020-08-26 360 size_t size, size_t offset,
236b7bc44ae0fd Philipp Zabel 2020-08-26 361 struct drm_plane *primary,
236b7bc44ae0fd Philipp Zabel 2020-08-26 362 struct drm_plane *cursor,
236b7bc44ae0fd Philipp Zabel 2020-08-26 363 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 364 const char *name, ...)
236b7bc44ae0fd Philipp Zabel 2020-08-26 365 {
236b7bc44ae0fd Philipp Zabel 2020-08-26 366 void *container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 367 struct drm_crtc *crtc;
236b7bc44ae0fd Philipp Zabel 2020-08-26 368 va_list ap;
236b7bc44ae0fd Philipp Zabel 2020-08-26 369 int ret;
236b7bc44ae0fd Philipp Zabel 2020-08-26 370
236b7bc44ae0fd Philipp Zabel 2020-08-26 371 if (!funcs || funcs->destroy)
236b7bc44ae0fd Philipp Zabel 2020-08-26 372 return ERR_PTR(-EINVAL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 373
236b7bc44ae0fd Philipp Zabel 2020-08-26 374 container = drmm_kzalloc(dev, size, GFP_KERNEL);
236b7bc44ae0fd Philipp Zabel 2020-08-26 375 if (!container)
236b7bc44ae0fd Philipp Zabel 2020-08-26 376 return ERR_PTR(-ENOMEM);
236b7bc44ae0fd Philipp Zabel 2020-08-26 377
236b7bc44ae0fd Philipp Zabel 2020-08-26 378 crtc = container + offset;
236b7bc44ae0fd Philipp Zabel 2020-08-26 379
236b7bc44ae0fd Philipp Zabel 2020-08-26 380 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 381 va_start(ap, name);
236b7bc44ae0fd Philipp Zabel 2020-08-26 382 ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
236b7bc44ae0fd Philipp Zabel 2020-08-26 @383 name, ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 384 if (name)
236b7bc44ae0fd Philipp Zabel 2020-08-26 385 va_end(ap);
236b7bc44ae0fd Philipp Zabel 2020-08-26 386 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 387 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 388
236b7bc44ae0fd Philipp Zabel 2020-08-26 389 ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
236b7bc44ae0fd Philipp Zabel 2020-08-26 390 crtc);
236b7bc44ae0fd Philipp Zabel 2020-08-26 391 if (ret)
236b7bc44ae0fd Philipp Zabel 2020-08-26 392 return ERR_PTR(ret);
236b7bc44ae0fd Philipp Zabel 2020-08-26 393
236b7bc44ae0fd Philipp Zabel 2020-08-26 394 return container;
236b7bc44ae0fd Philipp Zabel 2020-08-26 395 }
---
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: 40635 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
2020-08-26 12:35 ` [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes() Philipp Zabel
@ 2020-08-26 21:29 ` kernel test robot
2020-08-26 21:29 ` kernel test robot
2020-08-31 9:39 ` Dan Carpenter
2 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2020-08-26 21:29 UTC (permalink / raw)
To: Philipp Zabel, dri-devel
Cc: clang-built-linux, kbuild-all, Thomas Zimmermann, kernel
[-- Attachment #1: Type: text/plain, Size: 3477 bytes --]
Hi Philipp,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip linus/master v5.9-rc2 next-20200826]
[cannot apply to tegra-drm/drm/tegra/for-next drm-exynos/exynos-drm-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/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a003-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7cfcecece0e0430937cf529ce74d3a071a4dedc6)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/drm_crtc.c:336:1: warning: all paths through this function will call itself [-Winfinite-recursion]
{
^
1 warning generated.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +336 drivers/gpu/drm/drm_crtc.c
311
312 /**
313 * drm_crtc_init_with_planes - Initialise a new CRTC object with
314 * specified primary and cursor planes.
315 * @dev: DRM device
316 * @crtc: CRTC object to init
317 * @primary: Primary plane for CRTC
318 * @cursor: Cursor plane for CRTC
319 * @funcs: callbacks for the new CRTC
320 * @name: printf style format string for the CRTC name, or NULL for default name
321 *
322 * Inits a new object created as base part of a driver crtc object. Drivers
323 * should use this function instead of drm_crtc_init(), which is only provided
324 * for backwards compatibility with drivers which do not yet support universal
325 * planes). For really simple hardware which has only 1 plane look at
326 * drm_simple_display_pipe_init() instead.
327 *
328 * Returns:
329 * Zero on success, error code on failure.
330 */
331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
332 struct drm_plane *primary,
333 struct drm_plane *cursor,
334 const struct drm_crtc_funcs *funcs,
335 const char *name, ...)
> 336 {
337 va_list ap;
338 int ret;
339
340 if (name)
341 va_start(ap, name);
342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
343 name, ap);
344 if (name)
345 va_end(ap);
346
347 return ret;
348 }
349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
350
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47458 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
@ 2020-08-26 21:29 ` kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2020-08-26 21:29 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3562 bytes --]
Hi Philipp,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip linus/master v5.9-rc2 next-20200826]
[cannot apply to tegra-drm/drm/tegra/for-next drm-exynos/exynos-drm-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/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-randconfig-a003-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7cfcecece0e0430937cf529ce74d3a071a4dedc6)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/drm_crtc.c:336:1: warning: all paths through this function will call itself [-Winfinite-recursion]
{
^
1 warning generated.
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +336 drivers/gpu/drm/drm_crtc.c
311
312 /**
313 * drm_crtc_init_with_planes - Initialise a new CRTC object with
314 * specified primary and cursor planes.
315 * @dev: DRM device
316 * @crtc: CRTC object to init
317 * @primary: Primary plane for CRTC
318 * @cursor: Cursor plane for CRTC
319 * @funcs: callbacks for the new CRTC
320 * @name: printf style format string for the CRTC name, or NULL for default name
321 *
322 * Inits a new object created as base part of a driver crtc object. Drivers
323 * should use this function instead of drm_crtc_init(), which is only provided
324 * for backwards compatibility with drivers which do not yet support universal
325 * planes). For really simple hardware which has only 1 plane look at
326 * drm_simple_display_pipe_init() instead.
327 *
328 * Returns:
329 * Zero on success, error code on failure.
330 */
331 int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
332 struct drm_plane *primary,
333 struct drm_plane *cursor,
334 const struct drm_crtc_funcs *funcs,
335 const char *name, ...)
> 336 {
337 va_list ap;
338 int ret;
339
340 if (name)
341 va_start(ap, name);
342 ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
343 name, ap);
344 if (name)
345 va_end(ap);
346
347 return ret;
348 }
349 EXPORT_SYMBOL(drm_crtc_init_with_planes);
350
---
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: 47458 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
2020-08-26 12:35 ` [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes() Philipp Zabel
@ 2020-08-26 18:04 ` kernel test robot
2020-08-26 21:29 ` kernel test robot
2020-08-31 9:39 ` Dan Carpenter
2 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2020-08-26 18:04 UTC (permalink / raw)
To: Philipp Zabel, dri-devel; +Cc: kbuild-all, Thomas Zimmermann, kernel
[-- Attachment #1: Type: text/plain, Size: 10838 bytes --]
Hi Philipp,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip linus/master v5.9-rc2 next-20200826]
[cannot apply to tegra-drm/drm/tegra/for-next drm-exynos/exynos-drm-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/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm-randconfig-r001-20200826 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/drm_crtc.c: In function '__drm_crtc_init_with_planes':
>> drivers/gpu/drm/drm_crtc.c:267:3: warning: function '__drm_crtc_init_with_planes' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
267 | crtc->name = kvasprintf(GFP_KERNEL, name, ap);
| ^~~~
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +267 drivers/gpu/drm/drm_crtc.c
35f8cc3b9a92c66 Gustavo Padovan 2016-12-06 207
e954f77f6330028 Simon Ser 2020-05-21 208 /**
e954f77f6330028 Simon Ser 2020-05-21 209 * DOC: standard CRTC properties
e954f77f6330028 Simon Ser 2020-05-21 210 *
e954f77f6330028 Simon Ser 2020-05-21 211 * DRM CRTCs have a few standardized properties:
e954f77f6330028 Simon Ser 2020-05-21 212 *
e954f77f6330028 Simon Ser 2020-05-21 213 * ACTIVE:
e954f77f6330028 Simon Ser 2020-05-21 214 * Atomic property for setting the power state of the CRTC. When set to 1
e954f77f6330028 Simon Ser 2020-05-21 215 * the CRTC will actively display content. When set to 0 the CRTC will be
e954f77f6330028 Simon Ser 2020-05-21 216 * powered off. There is no expectation that user-space will reset CRTC
e954f77f6330028 Simon Ser 2020-05-21 217 * resources like the mode and planes when setting ACTIVE to 0.
e954f77f6330028 Simon Ser 2020-05-21 218 *
e954f77f6330028 Simon Ser 2020-05-21 219 * User-space can rely on an ACTIVE change to 1 to never fail an atomic
e954f77f6330028 Simon Ser 2020-05-21 220 * test as long as no other property has changed. If a change to ACTIVE
e954f77f6330028 Simon Ser 2020-05-21 221 * fails an atomic test, this is a driver bug. For this reason setting
e954f77f6330028 Simon Ser 2020-05-21 222 * ACTIVE to 0 must not release internal resources (like reserved memory
e954f77f6330028 Simon Ser 2020-05-21 223 * bandwidth or clock generators).
e954f77f6330028 Simon Ser 2020-05-21 224 *
e954f77f6330028 Simon Ser 2020-05-21 225 * Note that the legacy DPMS property on connectors is internally routed
e954f77f6330028 Simon Ser 2020-05-21 226 * to control this property for atomic drivers.
e954f77f6330028 Simon Ser 2020-05-21 227 * MODE_ID:
e954f77f6330028 Simon Ser 2020-05-21 228 * Atomic property for setting the CRTC display timings. The value is the
e954f77f6330028 Simon Ser 2020-05-21 229 * ID of a blob containing the DRM mode info. To disable the CRTC,
e954f77f6330028 Simon Ser 2020-05-21 230 * user-space must set this property to 0.
e954f77f6330028 Simon Ser 2020-05-21 231 *
e954f77f6330028 Simon Ser 2020-05-21 232 * Setting MODE_ID to 0 will release reserved resources for the CRTC.
e954f77f6330028 Simon Ser 2020-05-21 233 */
e954f77f6330028 Simon Ser 2020-05-21 234
236b7bc44ae0fde Philipp Zabel 2020-08-26 235 static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
e13161af80c185e Matt Roper 2014-04-01 236 struct drm_plane *primary,
fc1d3e44ef7c1db Matt Roper 2014-06-10 237 struct drm_plane *cursor,
f98828769c8838f Ville Syrjälä 2015-12-09 238 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fde Philipp Zabel 2020-08-26 239 const char *name, va_list ap)
f453ba0460742ad Dave Airlie 2008-11-07 240 {
51fd371bbaf9401 Rob Clark 2013-11-19 241 struct drm_mode_config *config = &dev->mode_config;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 242 int ret;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 243
522cf91f30cb010 Benjamin Gaignard 2015-03-17 244 WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY);
522cf91f30cb010 Benjamin Gaignard 2015-03-17 245 WARN_ON(cursor && cursor->type != DRM_PLANE_TYPE_CURSOR);
522cf91f30cb010 Benjamin Gaignard 2015-03-17 246
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 247 /* crtc index is used with 32bit bitmasks */
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 248 if (WARN_ON(config->num_crtc >= 32))
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 249 return -EINVAL;
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 250
ba1f665f161ce11 Haneen Mohammed 2018-05-25 251 WARN_ON(drm_drv_uses_atomic_modeset(dev) &&
ba1f665f161ce11 Haneen Mohammed 2018-05-25 252 (!funcs->atomic_destroy_state ||
ba1f665f161ce11 Haneen Mohammed 2018-05-25 253 !funcs->atomic_duplicate_state));
ba1f665f161ce11 Haneen Mohammed 2018-05-25 254
f453ba0460742ad Dave Airlie 2008-11-07 255 crtc->dev = dev;
f453ba0460742ad Dave Airlie 2008-11-07 256 crtc->funcs = funcs;
f453ba0460742ad Dave Airlie 2008-11-07 257
3b24f7d67581659 Daniel Vetter 2016-06-08 258 INIT_LIST_HEAD(&crtc->commit_list);
3b24f7d67581659 Daniel Vetter 2016-06-08 259 spin_lock_init(&crtc->commit_lock);
3b24f7d67581659 Daniel Vetter 2016-06-08 260
51fd371bbaf9401 Rob Clark 2013-11-19 261 drm_modeset_lock_init(&crtc->mutex);
2135ea7aafa26b6 Thierry Reding 2017-02-28 262 ret = drm_mode_object_add(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
6bfc56aa89f963b Ville Syrjälä 2012-03-13 263 if (ret)
baf698b0496e93f Daniel Vetter 2014-11-12 264 return ret;
f453ba0460742ad Dave Airlie 2008-11-07 265
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 266 if (name) {
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 @267 crtc->name = kvasprintf(GFP_KERNEL, name, ap);
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 268 } else {
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 269 crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 270 drm_num_crtcs(dev));
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 271 }
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 272 if (!crtc->name) {
7c8f6d2577c7565 Dave Airlie 2016-04-15 273 drm_mode_object_unregister(dev, &crtc->base);
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 274 return -ENOMEM;
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 275 }
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 276
6d6003c4b613c93 Gustavo Padovan 2016-11-15 277 crtc->fence_context = dma_fence_context_alloc(1);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 278 spin_lock_init(&crtc->fence_lock);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 279 snprintf(crtc->timeline_name, sizeof(crtc->timeline_name),
6d6003c4b613c93 Gustavo Padovan 2016-11-15 280 "CRTC:%d-%s", crtc->base.id, crtc->name);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 281
bffd9de02977025 Paulo Zanoni 2012-05-15 282 crtc->base.properties = &crtc->properties;
bffd9de02977025 Paulo Zanoni 2012-05-15 283
51fd371bbaf9401 Rob Clark 2013-11-19 284 list_add_tail(&crtc->head, &config->crtc_list);
490d3d1b91201fd Chris Wilson 2016-05-27 285 crtc->index = config->num_crtc++;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 286
e13161af80c185e Matt Roper 2014-04-01 287 crtc->primary = primary;
fc1d3e44ef7c1db Matt Roper 2014-06-10 288 crtc->cursor = cursor;
7abc7d47510c75d Rob Clark 2016-11-05 289 if (primary && !primary->possible_crtcs)
6a52193bd0dd683 Ville Syrjälä 2018-06-26 290 primary->possible_crtcs = drm_crtc_mask(crtc);
7abc7d47510c75d Rob Clark 2016-11-05 291 if (cursor && !cursor->possible_crtcs)
6a52193bd0dd683 Ville Syrjälä 2018-06-26 292 cursor->possible_crtcs = drm_crtc_mask(crtc);
e13161af80c185e Matt Roper 2014-04-01 293
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 294 ret = drm_crtc_crc_init(crtc);
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 295 if (ret) {
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 296 drm_mode_object_unregister(dev, &crtc->base);
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 297 return ret;
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 298 }
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 299
eab3bbeffd15212 Daniel Vetter 2015-01-22 300 if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
eab3bbeffd15212 Daniel Vetter 2015-01-22 301 drm_object_attach_property(&crtc->base, config->prop_active, 0);
955f3c334f0fb2b Daniel Stone 2015-05-25 302 drm_object_attach_property(&crtc->base, config->prop_mode_id, 0);
beaf5af48034c9e Gustavo Padovan 2016-11-16 303 drm_object_attach_property(&crtc->base,
beaf5af48034c9e Gustavo Padovan 2016-11-16 304 config->prop_out_fence_ptr, 0);
1398958cfd8d331 Nicholas Kazlauskas 2018-10-04 305 drm_object_attach_property(&crtc->base,
1398958cfd8d331 Nicholas Kazlauskas 2018-10-04 306 config->prop_vrr_enabled, 0);
eab3bbeffd15212 Daniel Vetter 2015-01-22 307 }
eab3bbeffd15212 Daniel Vetter 2015-01-22 308
baf698b0496e93f Daniel Vetter 2014-11-12 309 return 0;
f453ba0460742ad Dave Airlie 2008-11-07 310 }
236b7bc44ae0fde Philipp Zabel 2020-08-26 311
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33490 bytes --]
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
@ 2020-08-26 18:04 ` kernel test robot
0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2020-08-26 18:04 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 11028 bytes --]
Hi Philipp,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip linus/master v5.9-rc2 next-20200826]
[cannot apply to tegra-drm/drm/tegra/for-next drm-exynos/exynos-drm-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/Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: arm-randconfig-r001-20200826 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/drm_crtc.c: In function '__drm_crtc_init_with_planes':
>> drivers/gpu/drm/drm_crtc.c:267:3: warning: function '__drm_crtc_init_with_planes' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
267 | crtc->name = kvasprintf(GFP_KERNEL, name, ap);
| ^~~~
# https://github.com/0day-ci/linux/commit/236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Philipp-Zabel/drm-add-drmm_encoder_alloc/20200826-203629
git checkout 236b7bc44ae0fdecc8e80c5aba0655ca14fdfb23
vim +267 drivers/gpu/drm/drm_crtc.c
35f8cc3b9a92c66 Gustavo Padovan 2016-12-06 207
e954f77f6330028 Simon Ser 2020-05-21 208 /**
e954f77f6330028 Simon Ser 2020-05-21 209 * DOC: standard CRTC properties
e954f77f6330028 Simon Ser 2020-05-21 210 *
e954f77f6330028 Simon Ser 2020-05-21 211 * DRM CRTCs have a few standardized properties:
e954f77f6330028 Simon Ser 2020-05-21 212 *
e954f77f6330028 Simon Ser 2020-05-21 213 * ACTIVE:
e954f77f6330028 Simon Ser 2020-05-21 214 * Atomic property for setting the power state of the CRTC. When set to 1
e954f77f6330028 Simon Ser 2020-05-21 215 * the CRTC will actively display content. When set to 0 the CRTC will be
e954f77f6330028 Simon Ser 2020-05-21 216 * powered off. There is no expectation that user-space will reset CRTC
e954f77f6330028 Simon Ser 2020-05-21 217 * resources like the mode and planes when setting ACTIVE to 0.
e954f77f6330028 Simon Ser 2020-05-21 218 *
e954f77f6330028 Simon Ser 2020-05-21 219 * User-space can rely on an ACTIVE change to 1 to never fail an atomic
e954f77f6330028 Simon Ser 2020-05-21 220 * test as long as no other property has changed. If a change to ACTIVE
e954f77f6330028 Simon Ser 2020-05-21 221 * fails an atomic test, this is a driver bug. For this reason setting
e954f77f6330028 Simon Ser 2020-05-21 222 * ACTIVE to 0 must not release internal resources (like reserved memory
e954f77f6330028 Simon Ser 2020-05-21 223 * bandwidth or clock generators).
e954f77f6330028 Simon Ser 2020-05-21 224 *
e954f77f6330028 Simon Ser 2020-05-21 225 * Note that the legacy DPMS property on connectors is internally routed
e954f77f6330028 Simon Ser 2020-05-21 226 * to control this property for atomic drivers.
e954f77f6330028 Simon Ser 2020-05-21 227 * MODE_ID:
e954f77f6330028 Simon Ser 2020-05-21 228 * Atomic property for setting the CRTC display timings. The value is the
e954f77f6330028 Simon Ser 2020-05-21 229 * ID of a blob containing the DRM mode info. To disable the CRTC,
e954f77f6330028 Simon Ser 2020-05-21 230 * user-space must set this property to 0.
e954f77f6330028 Simon Ser 2020-05-21 231 *
e954f77f6330028 Simon Ser 2020-05-21 232 * Setting MODE_ID to 0 will release reserved resources for the CRTC.
e954f77f6330028 Simon Ser 2020-05-21 233 */
e954f77f6330028 Simon Ser 2020-05-21 234
236b7bc44ae0fde Philipp Zabel 2020-08-26 235 static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
e13161af80c185e Matt Roper 2014-04-01 236 struct drm_plane *primary,
fc1d3e44ef7c1db Matt Roper 2014-06-10 237 struct drm_plane *cursor,
f98828769c8838f Ville Syrjälä 2015-12-09 238 const struct drm_crtc_funcs *funcs,
236b7bc44ae0fde Philipp Zabel 2020-08-26 239 const char *name, va_list ap)
f453ba0460742ad Dave Airlie 2008-11-07 240 {
51fd371bbaf9401 Rob Clark 2013-11-19 241 struct drm_mode_config *config = &dev->mode_config;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 242 int ret;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 243
522cf91f30cb010 Benjamin Gaignard 2015-03-17 244 WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY);
522cf91f30cb010 Benjamin Gaignard 2015-03-17 245 WARN_ON(cursor && cursor->type != DRM_PLANE_TYPE_CURSOR);
522cf91f30cb010 Benjamin Gaignard 2015-03-17 246
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 247 /* crtc index is used with 32bit bitmasks */
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 248 if (WARN_ON(config->num_crtc >= 32))
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 249 return -EINVAL;
2a8d3eac3d6e116 Ville Syrjälä 2018-01-25 250
ba1f665f161ce11 Haneen Mohammed 2018-05-25 251 WARN_ON(drm_drv_uses_atomic_modeset(dev) &&
ba1f665f161ce11 Haneen Mohammed 2018-05-25 252 (!funcs->atomic_destroy_state ||
ba1f665f161ce11 Haneen Mohammed 2018-05-25 253 !funcs->atomic_duplicate_state));
ba1f665f161ce11 Haneen Mohammed 2018-05-25 254
f453ba0460742ad Dave Airlie 2008-11-07 255 crtc->dev = dev;
f453ba0460742ad Dave Airlie 2008-11-07 256 crtc->funcs = funcs;
f453ba0460742ad Dave Airlie 2008-11-07 257
3b24f7d67581659 Daniel Vetter 2016-06-08 258 INIT_LIST_HEAD(&crtc->commit_list);
3b24f7d67581659 Daniel Vetter 2016-06-08 259 spin_lock_init(&crtc->commit_lock);
3b24f7d67581659 Daniel Vetter 2016-06-08 260
51fd371bbaf9401 Rob Clark 2013-11-19 261 drm_modeset_lock_init(&crtc->mutex);
2135ea7aafa26b6 Thierry Reding 2017-02-28 262 ret = drm_mode_object_add(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
6bfc56aa89f963b Ville Syrjälä 2012-03-13 263 if (ret)
baf698b0496e93f Daniel Vetter 2014-11-12 264 return ret;
f453ba0460742ad Dave Airlie 2008-11-07 265
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 266 if (name) {
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 @267 crtc->name = kvasprintf(GFP_KERNEL, name, ap);
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 268 } else {
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 269 crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 270 drm_num_crtcs(dev));
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 271 }
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 272 if (!crtc->name) {
7c8f6d2577c7565 Dave Airlie 2016-04-15 273 drm_mode_object_unregister(dev, &crtc->base);
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 274 return -ENOMEM;
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 275 }
fa3ab4c2113c74a Ville Syrjälä 2015-12-08 276
6d6003c4b613c93 Gustavo Padovan 2016-11-15 277 crtc->fence_context = dma_fence_context_alloc(1);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 278 spin_lock_init(&crtc->fence_lock);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 279 snprintf(crtc->timeline_name, sizeof(crtc->timeline_name),
6d6003c4b613c93 Gustavo Padovan 2016-11-15 280 "CRTC:%d-%s", crtc->base.id, crtc->name);
6d6003c4b613c93 Gustavo Padovan 2016-11-15 281
bffd9de02977025 Paulo Zanoni 2012-05-15 282 crtc->base.properties = &crtc->properties;
bffd9de02977025 Paulo Zanoni 2012-05-15 283
51fd371bbaf9401 Rob Clark 2013-11-19 284 list_add_tail(&crtc->head, &config->crtc_list);
490d3d1b91201fd Chris Wilson 2016-05-27 285 crtc->index = config->num_crtc++;
6bfc56aa89f963b Ville Syrjälä 2012-03-13 286
e13161af80c185e Matt Roper 2014-04-01 287 crtc->primary = primary;
fc1d3e44ef7c1db Matt Roper 2014-06-10 288 crtc->cursor = cursor;
7abc7d47510c75d Rob Clark 2016-11-05 289 if (primary && !primary->possible_crtcs)
6a52193bd0dd683 Ville Syrjälä 2018-06-26 290 primary->possible_crtcs = drm_crtc_mask(crtc);
7abc7d47510c75d Rob Clark 2016-11-05 291 if (cursor && !cursor->possible_crtcs)
6a52193bd0dd683 Ville Syrjälä 2018-06-26 292 cursor->possible_crtcs = drm_crtc_mask(crtc);
e13161af80c185e Matt Roper 2014-04-01 293
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 294 ret = drm_crtc_crc_init(crtc);
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 295 if (ret) {
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 296 drm_mode_object_unregister(dev, &crtc->base);
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 297 return ret;
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 298 }
9edbf1fa600a2ef Tomeu Vizoso 2016-10-06 299
eab3bbeffd15212 Daniel Vetter 2015-01-22 300 if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
eab3bbeffd15212 Daniel Vetter 2015-01-22 301 drm_object_attach_property(&crtc->base, config->prop_active, 0);
955f3c334f0fb2b Daniel Stone 2015-05-25 302 drm_object_attach_property(&crtc->base, config->prop_mode_id, 0);
beaf5af48034c9e Gustavo Padovan 2016-11-16 303 drm_object_attach_property(&crtc->base,
beaf5af48034c9e Gustavo Padovan 2016-11-16 304 config->prop_out_fence_ptr, 0);
1398958cfd8d331 Nicholas Kazlauskas 2018-10-04 305 drm_object_attach_property(&crtc->base,
1398958cfd8d331 Nicholas Kazlauskas 2018-10-04 306 config->prop_vrr_enabled, 0);
eab3bbeffd15212 Daniel Vetter 2015-01-22 307 }
eab3bbeffd15212 Daniel Vetter 2015-01-22 308
baf698b0496e93f Daniel Vetter 2014-11-12 309 return 0;
f453ba0460742ad Dave Airlie 2008-11-07 310 }
236b7bc44ae0fde Philipp Zabel 2020-08-26 311
---
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: 33490 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes()
2020-08-26 12:35 [PATCH 1/4] drm: add drmm_encoder_alloc() Philipp Zabel
@ 2020-08-26 12:35 ` Philipp Zabel
2020-08-26 18:04 ` kernel test robot
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Philipp Zabel @ 2020-08-26 12:35 UTC (permalink / raw)
To: dri-devel; +Cc: kernel, Thomas Zimmermann
Add an alternative to drm_crtc_init_with_planes() that allocates
and initializes a crtc and registers drm_crtc_cleanup() with
drmm_add_action_or_reset().
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/gpu/drm/drm_crtc.c | 119 ++++++++++++++++++++++++++++---------
include/drm/drm_crtc.h | 33 ++++++++++
2 files changed, 124 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 283bcc4362ca..a31dcfa6b579 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -38,6 +38,7 @@
#include <drm/drm_crtc.h>
#include <drm/drm_edid.h>
#include <drm/drm_fourcc.h>
+#include <drm/drm_managed.h>
#include <drm/drm_modeset_lock.h>
#include <drm/drm_atomic.h>
#include <drm/drm_auth.h>
@@ -231,30 +232,11 @@ struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc)
* Setting MODE_ID to 0 will release reserved resources for the CRTC.
*/
-/**
- * drm_crtc_init_with_planes - Initialise a new CRTC object with
- * specified primary and cursor planes.
- * @dev: DRM device
- * @crtc: CRTC object to init
- * @primary: Primary plane for CRTC
- * @cursor: Cursor plane for CRTC
- * @funcs: callbacks for the new CRTC
- * @name: printf style format string for the CRTC name, or NULL for default name
- *
- * Inits a new object created as base part of a driver crtc object. Drivers
- * should use this function instead of drm_crtc_init(), which is only provided
- * for backwards compatibility with drivers which do not yet support universal
- * planes). For really simple hardware which has only 1 plane look at
- * drm_simple_display_pipe_init() instead.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
- struct drm_plane *primary,
- struct drm_plane *cursor,
- const struct drm_crtc_funcs *funcs,
- const char *name, ...)
+static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
+ struct drm_plane *primary,
+ struct drm_plane *cursor,
+ const struct drm_crtc_funcs *funcs,
+ const char *name, va_list ap)
{
struct drm_mode_config *config = &dev->mode_config;
int ret;
@@ -282,11 +264,7 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
return ret;
if (name) {
- va_list ap;
-
- va_start(ap, name);
crtc->name = kvasprintf(GFP_KERNEL, name, ap);
- va_end(ap);
} else {
crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
drm_num_crtcs(dev));
@@ -330,8 +308,93 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
return 0;
}
+
+/**
+ * drm_crtc_init_with_planes - Initialise a new CRTC object with
+ * specified primary and cursor planes.
+ * @dev: DRM device
+ * @crtc: CRTC object to init
+ * @primary: Primary plane for CRTC
+ * @cursor: Cursor plane for CRTC
+ * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
+ *
+ * Inits a new object created as base part of a driver crtc object. Drivers
+ * should use this function instead of drm_crtc_init(), which is only provided
+ * for backwards compatibility with drivers which do not yet support universal
+ * planes). For really simple hardware which has only 1 plane look at
+ * drm_simple_display_pipe_init() instead.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
+ struct drm_plane *primary,
+ struct drm_plane *cursor,
+ const struct drm_crtc_funcs *funcs,
+ const char *name, ...)
+{
+ va_list ap;
+ int ret;
+
+ if (name)
+ va_start(ap, name);
+ ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+ name, ap);
+ if (name)
+ va_end(ap);
+
+ return ret;
+}
EXPORT_SYMBOL(drm_crtc_init_with_planes);
+static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
+ void *ptr)
+{
+ struct drm_crtc *crtc = ptr;
+
+ drm_crtc_cleanup(crtc);
+}
+
+void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
+ size_t size, size_t offset,
+ struct drm_plane *primary,
+ struct drm_plane *cursor,
+ const struct drm_crtc_funcs *funcs,
+ const char *name, ...)
+{
+ void *container;
+ struct drm_crtc *crtc;
+ va_list ap;
+ int ret;
+
+ if (!funcs || funcs->destroy)
+ return ERR_PTR(-EINVAL);
+
+ container = drmm_kzalloc(dev, size, GFP_KERNEL);
+ if (!container)
+ return ERR_PTR(-ENOMEM);
+
+ crtc = container + offset;
+
+ if (name)
+ va_start(ap, name);
+ ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+ name, ap);
+ if (name)
+ va_end(ap);
+ if (ret)
+ return ERR_PTR(ret);
+
+ ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
+ crtc);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return container;
+}
+EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes);
+
/**
* drm_crtc_cleanup - Clean up the core crtc usage
* @crtc: CRTC to cleanup
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 59b51a09cae6..b71c0a3d4126 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1210,6 +1210,39 @@ int drm_crtc_init_with_planes(struct drm_device *dev,
const char *name, ...);
void drm_crtc_cleanup(struct drm_crtc *crtc);
+__printf(7, 8)
+void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
+ size_t size, size_t offset,
+ struct drm_plane *primary,
+ struct drm_plane *cursor,
+ const struct drm_crtc_funcs *funcs,
+ const char *name, ...);
+
+/**
+ * drm_crtc_alloc_with_planes - Allocate and initialize a new CRTC object with
+ * specified primary and cursor planes.
+ * @dev: DRM device
+ * @type: the type of the struct which contains struct &drm_crtc
+ * @member: the name of the &drm_crtc within @type.
+ * @primary: Primary plane for CRTC
+ * @cursor: Cursor plane for CRTC
+ * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
+ *
+ * Allocates and initializes a new crtc object. Cleanup is automatically
+ * handled through registering drmm_crtc_cleanup() with drmm_add_action().
+ *
+ * The @drm_crtc_funcs.destroy hook must be NULL.
+ *
+ * Returns:
+ * Pointer to new crtc, or ERR_PTR on failure.
+ */
+#define drmm_crtc_alloc_with_planes(dev, type, member, primary, cursor, funcs, name, ...) \
+ ((type *)__drmm_crtc_alloc_with_planes(dev, sizeof(type), \
+ offsetof(type, member), \
+ primary, cursor, funcs, \
+ name, ##__VA_ARGS__))
+
/**
* drm_crtc_index - find the index of a registered CRTC
* @crtc: CRTC to find index for
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-08-31 9:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 21:34 [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes() kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-08-26 12:35 [PATCH 1/4] drm: add drmm_encoder_alloc() Philipp Zabel
2020-08-26 12:35 ` [PATCH 4/4] drm/crtc: add drmm_crtc_alloc_with_planes() Philipp Zabel
2020-08-26 18:04 ` kernel test robot
2020-08-26 18:04 ` kernel test robot
2020-08-26 21:29 ` kernel test robot
2020-08-26 21:29 ` kernel test robot
2020-08-31 9:39 ` Dan Carpenter
2020-08-31 9:39 ` Dan Carpenter
2020-08-31 9:39 ` Dan Carpenter
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.