Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-misc-next-2024-08-16' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next

drm-misc-next for v6.12:

Core Changes:

ci:
- Update dependencies

docs:
- Cleanups

edid:
- Improve debug logging
- Clean up interface

fbdev emulation:
- Remove old fbdev hooks
- Update documentation

panic:
- Cleanups

Driver Changes:

amdgpu:
- Remove usage of old fbdev hooks
- Use backlight constants

ast:
- Fix timeout loop for DP link training

hisilicon:
- hibmc: Cleanups

mipi-dsi:
- Improve error handling
- startek-kd070fhfid015: Use new error handling

nouveau:
- Remove usage of old fbdev hooks

panel:
- Use backlight constants

radeon:
- Use backlight constants

rockchip:
- Improve DP sink-capability reporting
- Cleanups
- dw_hdmi: Support 4k@60Hz; Cleanups
- vop: Support RGB display on Rockchip RK3066; Support 4096px width

tilcdc:
- Use backlight constants

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240816084109.GA229316@localhost.localdomain

+476 -421
-1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 1484 1484 1485 1485 int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags); 1486 1486 void amdgpu_driver_unload_kms(struct drm_device *dev); 1487 - void amdgpu_driver_lastclose_kms(struct drm_device *dev); 1488 1487 int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv); 1489 1488 void amdgpu_driver_postclose_kms(struct drm_device *dev, 1490 1489 struct drm_file *file_priv);
-2
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 2953 2953 DRIVER_SYNCOBJ_TIMELINE, 2954 2954 .open = amdgpu_driver_open_kms, 2955 2955 .postclose = amdgpu_driver_postclose_kms, 2956 - .lastclose = amdgpu_driver_lastclose_kms, 2957 2956 .ioctls = amdgpu_ioctls_kms, 2958 2957 .num_ioctls = ARRAY_SIZE(amdgpu_ioctls_kms), 2959 2958 .dumb_create = amdgpu_mode_dumb_create, ··· 2979 2980 DRIVER_SYNCOBJ_TIMELINE, 2980 2981 .open = amdgpu_driver_open_kms, 2981 2982 .postclose = amdgpu_driver_postclose_kms, 2982 - .lastclose = amdgpu_driver_lastclose_kms, 2983 2983 .ioctls = amdgpu_ioctls_kms, 2984 2984 .num_ioctls = ARRAY_SIZE(amdgpu_ioctls_kms), 2985 2985 .dumb_create = amdgpu_mode_dumb_create,
-17
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 1269 1269 return 0; 1270 1270 } 1271 1271 1272 - 1273 - /* 1274 - * Outdated mess for old drm with Xorg being in charge (void function now). 1275 - */ 1276 - /** 1277 - * amdgpu_driver_lastclose_kms - drm callback for last close 1278 - * 1279 - * @dev: drm dev pointer 1280 - * 1281 - * Switch vga_switcheroo state after last close (all asics). 1282 - */ 1283 - void amdgpu_driver_lastclose_kms(struct drm_device *dev) 1284 - { 1285 - drm_fb_helper_lastclose(dev); 1286 - vga_switcheroo_process_delayed_switch(); 1287 - } 1288 - 1289 1272 /** 1290 1273 * amdgpu_driver_open_kms - drm callback for open 1291 1274 *
+1 -1
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
··· 215 215 dig->bl_dev = bd; 216 216 217 217 bd->props.brightness = amdgpu_atombios_encoder_get_backlight_brightness(bd); 218 - bd->props.power = FB_BLANK_UNBLANK; 218 + bd->props.power = BACKLIGHT_POWER_ON; 219 219 backlight_update_status(bd); 220 220 221 221 DRM_INFO("amdgpu atom DIG backlight initialized\n");
+8 -7
drivers/gpu/drm/ast/ast_dp.c
··· 146 146 void ast_dp_link_training(struct ast_device *ast) 147 147 { 148 148 struct drm_device *dev = &ast->base; 149 - unsigned int i = 10; 149 + int i; 150 150 151 - while (i--) { 152 - u8 vgacrdc = ast_get_index_reg(ast, AST_IO_VGACRI, 0xdc); 151 + for (i = 0; i < 10; i++) { 152 + u8 vgacrdc; 153 153 154 - if (vgacrdc & AST_IO_VGACRDC_LINK_SUCCESS) 155 - break; 156 154 if (i) 157 155 msleep(100); 156 + 157 + vgacrdc = ast_get_index_reg(ast, AST_IO_VGACRI, 0xdc); 158 + if (vgacrdc & AST_IO_VGACRDC_LINK_SUCCESS) 159 + return; 158 160 } 159 - if (!i) 160 - drm_err(dev, "Link training failed\n"); 161 + drm_err(dev, "Link training failed\n"); 161 162 } 162 163 163 164 void ast_dp_set_on_off(struct drm_device *dev, bool on)
+8
drivers/gpu/drm/ci/container.yml
··· 28 28 rules: 29 29 - when: never 30 30 31 + debian/arm64_test-vk: 32 + rules: 33 + - when: never 34 + 35 + debian/arm64_test-gl: 36 + rules: 37 + - when: never 38 + 31 39 fedora/x86_64_build: 32 40 rules: 33 41 - when: never
+17 -15
drivers/gpu/drm/ci/gitlab-ci.yml
··· 1 1 variables: 2 2 DRM_CI_PROJECT_PATH: &drm-ci-project-path mesa/mesa 3 - DRM_CI_COMMIT_SHA: &drm-ci-commit-sha e2b9c5a9e3e4f9b532067af8022eaef8d6fc6c00 3 + DRM_CI_COMMIT_SHA: &drm-ci-commit-sha d9849ac46623797a9f56fb9d46dc52460ac477de 4 4 5 5 UPSTREAM_REPO: https://gitlab.freedesktop.org/drm/kernel.git 6 6 TARGET_BRANCH: drm-next 7 7 8 8 IGT_VERSION: f13702b8e4e847c56da3ef6f0969065d686049c5 9 9 10 - DEQP_RUNNER_GIT_URL: https://gitlab.freedesktop.org/anholt/deqp-runner.git 10 + DEQP_RUNNER_GIT_URL: https://gitlab.freedesktop.org/mesa/deqp-runner.git 11 11 DEQP_RUNNER_GIT_TAG: v0.15.0 12 12 13 13 FDO_UPSTREAM_REPO: helen.fornazier/linux # The repo where the git-archive daily runs ··· 85 85 - project: *drm-ci-project-path 86 86 ref: *drm-ci-commit-sha 87 87 file: 88 - - '/.gitlab-ci/farm-rules.yml' 89 - - '/.gitlab-ci/test-source-dep.yml' 90 88 - '/.gitlab-ci/container/gitlab-ci.yml' 91 - - '/.gitlab-ci/test/gitlab-ci.yml' 89 + - '/.gitlab-ci/farm-rules.yml' 92 90 - '/.gitlab-ci/lava/lava-gitlab-ci.yml' 93 - - '/src/microsoft/ci/gitlab-ci-inc.yml' 94 - - '/src/gallium/drivers/zink/ci/gitlab-ci-inc.yml' 95 - - '/src/gallium/drivers/crocus/ci/gitlab-ci-inc.yml' 96 - - '/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml' 97 - - '/src/gallium/drivers/llvmpipe/ci/gitlab-ci-inc.yml' 98 - - '/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml' 99 - - '/src/gallium/drivers/nouveau/ci/gitlab-ci-inc.yml' 100 - - '/src/gallium/frontends/lavapipe/ci/gitlab-ci-inc.yml' 101 - - '/src/intel/ci/gitlab-ci-inc.yml' 102 - - '/src/freedreno/ci/gitlab-ci-inc.yml' 91 + - '/.gitlab-ci/test-source-dep.yml' 92 + - '/.gitlab-ci/test/gitlab-ci.yml' 103 93 - '/src/amd/ci/gitlab-ci-inc.yml' 94 + - '/src/freedreno/ci/gitlab-ci-inc.yml' 95 + - '/src/gallium/drivers/crocus/ci/gitlab-ci-inc.yml' 96 + - '/src/gallium/drivers/llvmpipe/ci/gitlab-ci-inc.yml' 97 + - '/src/gallium/drivers/nouveau/ci/gitlab-ci-inc.yml' 98 + - '/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml' 99 + - '/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml' 100 + - '/src/gallium/drivers/zink/ci/gitlab-ci-inc.yml' 101 + - '/src/gallium/frontends/lavapipe/ci/gitlab-ci-inc.yml' 102 + - '/src/gallium/frontends/rusticl/ci/gitlab-ci.yml' 103 + - '/src/intel/ci/gitlab-ci-inc.yml' 104 + - '/src/microsoft/ci/gitlab-ci-inc.yml' 105 + - '/src/nouveau/ci/gitlab-ci-inc.yml' 104 106 - '/src/virtio/ci/gitlab-ci-inc.yml' 105 107 - drivers/gpu/drm/ci/image-tags.yml 106 108 - drivers/gpu/drm/ci/container.yml
+4 -4
drivers/gpu/drm/ci/image-tags.yml
··· 1 1 variables: 2 - CONTAINER_TAG: "2024-05-09-mesa-uprev" 2 + CONTAINER_TAG: "2024-08-07-mesa-uprev" 3 3 DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base" 4 4 DEBIAN_BASE_TAG: "${CONTAINER_TAG}" 5 5 6 6 DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build" 7 - DEBIAN_BUILD_TAG: "2024-06-10-vkms" 7 + DEBIAN_BUILD_TAG: "${CONTAINER_TAG}" 8 8 9 - KERNEL_ROOTFS_TAG: "2023-10-06-amd" 9 + KERNEL_ROOTFS_TAG: "${CONTAINER_TAG}" 10 10 11 11 DEBIAN_X86_64_TEST_BASE_IMAGE: "debian/x86_64_test-base" 12 12 DEBIAN_X86_64_TEST_IMAGE_GL_PATH: "debian/x86_64_test-gl" 13 - DEBIAN_X86_64_TEST_GL_TAG: "${CONTAINER_TAG}" 13 + DEBIAN_TEST_GL_TAG: "${CONTAINER_TAG}" 14 14 15 15 ALPINE_X86_64_LAVA_SSH_TAG: "${CONTAINER_TAG}"
+1
drivers/gpu/drm/ci/lava-submit.sh
··· 44 44 --first-stage-init artifacts/ci-common/init-stage1.sh \ 45 45 --ci-project-dir "${CI_PROJECT_DIR}" \ 46 46 --device-type "${DEVICE_TYPE}" \ 47 + --farm "${FARM}" \ 47 48 --dtb-filename "${DTB}" \ 48 49 --jwt-file "${S3_JWT_FILE}" \ 49 50 --kernel-image-name "${KERNEL_IMAGE_NAME}" \
+2 -2
drivers/gpu/drm/ci/test.yml
··· 69 69 .baremetal-igt-arm64: 70 70 extends: 71 71 - .baremetal-test-arm64 72 - - .use-debian/arm64_test 72 + - .use-debian/baremetal_arm64_test 73 73 - .test-rules 74 74 variables: 75 75 FDO_CI_CONCURRENT: 10 ··· 79 79 BM_CMDLINE: "ip=dhcp console=ttyMSM0,115200n8 $BM_KERNEL_EXTRA_ARGS root=/dev/nfs rw nfsrootdebug nfsroot=,tcp,nfsvers=4.2 init=/init $BM_KERNELARGS" 80 80 FARM: google 81 81 needs: 82 - - debian/arm64_test 82 + - debian/baremetal_arm64_test 83 83 - job: testing:arm64 84 84 artifacts: false 85 85 - igt:arm64
+1 -1
drivers/gpu/drm/ci/xfails/requirements.txt
··· 11 11 requests-toolbelt==1.0.0 12 12 ruamel.yaml==0.17.32 13 13 ruamel.yaml.clib==0.2.7 14 - setuptools==68.0.0 14 + setuptools==70.0.0 15 15 tenacity==8.2.3 16 16 urllib3==2.0.7 17 17 wheel==0.41.1
+4
drivers/gpu/drm/drm_connector.c
··· 2342 2342 * 2343 2343 * Default: 2344 2344 * The behavior is driver-specific. 2345 + * 2345 2346 * BT2020_RGB: 2347 + * 2346 2348 * BT2020_YCC: 2347 2349 * User space configures the pixel operation properties to produce 2348 2350 * RGB content with Rec. ITU-R BT.2020 colorimetry, Rec. ··· 2368 2366 * range. 2369 2367 * The variants BT2020_RGB and BT2020_YCC are equivalent and the 2370 2368 * driver chooses between RGB and YCbCr on its own. 2369 + * 2371 2370 * SMPTE_170M_YCC: 2372 2371 * BT709_YCC: 2373 2372 * XVYCC_601: ··· 2381 2378 * DCI-P3_RGB_Theater: 2382 2379 * RGB_WIDE_FIXED: 2383 2380 * RGB_WIDE_FLOAT: 2381 + * 2384 2382 * BT601_YCC: 2385 2383 * The behavior is undefined. 2386 2384 *
+4
drivers/gpu/drm/drm_crtc_internal.h
··· 318 318 /* drm_panic.c */ 319 319 #ifdef CONFIG_DRM_PANIC 320 320 bool drm_panic_is_enabled(struct drm_device *dev); 321 + void drm_panic_register(struct drm_device *dev); 322 + void drm_panic_unregister(struct drm_device *dev); 321 323 #else 322 324 static inline bool drm_panic_is_enabled(struct drm_device *dev) { return false; } 325 + static inline void drm_panic_register(struct drm_device *dev) {} 326 + static inline void drm_panic_unregister(struct drm_device *dev) {} 323 327 #endif 324 328 325 329 #endif /* __DRM_CRTC_INTERNAL_H__ */
-3
drivers/gpu/drm/drm_displayid.c
··· 33 33 if (IS_ERR(base)) 34 34 return base; 35 35 36 - DRM_DEBUG_KMS("base revision 0x%x, length %d, %d %d\n", 37 - base->rev, base->bytes, base->prod_id, base->ext_count); 38 - 39 36 /* +1 for DispID checksum */ 40 37 dispid_length = sizeof(*base) + base->bytes + 1; 41 38 if (dispid_length > length - idx)
+9 -13
drivers/gpu/drm/drm_edid.c
··· 1966 1966 block, EDID_LENGTH, false); 1967 1967 } 1968 1968 1969 - /** 1970 - * drm_edid_block_valid - Sanity check the EDID block (base or extension) 1971 - * @_block: pointer to raw EDID block 1972 - * @block_num: type of block to validate (0 for base, extension otherwise) 1973 - * @print_bad_edid: if true, dump bad EDID blocks to the console 1974 - * @edid_corrupt: if true, the header or checksum is invalid 1975 - * 1969 + /* 1976 1970 * Validate a base or extension EDID block and optionally dump bad blocks to 1977 1971 * the console. 1978 - * 1979 - * Return: True if the block is valid, false otherwise. 1980 1972 */ 1981 - bool drm_edid_block_valid(u8 *_block, int block_num, bool print_bad_edid, 1982 - bool *edid_corrupt) 1973 + static bool drm_edid_block_valid(void *_block, int block_num, bool print_bad_edid, 1974 + bool *edid_corrupt) 1983 1975 { 1984 - struct edid *block = (struct edid *)_block; 1976 + struct edid *block = _block; 1985 1977 enum edid_block_status status; 1986 1978 bool is_base_block = block_num == 0; 1987 1979 bool valid; ··· 2016 2024 2017 2025 return valid; 2018 2026 } 2019 - EXPORT_SYMBOL(drm_edid_block_valid); 2020 2027 2021 2028 /** 2022 2029 * drm_edid_is_valid - sanity check EDID data ··· 6620 6629 6621 6630 displayid_iter_edid_begin(drm_edid, &iter); 6622 6631 displayid_iter_for_each(block, &iter) { 6632 + drm_dbg_kms(connector->dev, 6633 + "[CONNECTOR:%d:%s] DisplayID extension version 0x%02x, primary use 0x%02x\n", 6634 + connector->base.id, connector->name, 6635 + displayid_version(&iter), 6636 + displayid_primary_use(&iter)); 6623 6637 if (displayid_version(&iter) == DISPLAY_ID_STRUCTURE_VER_20 && 6624 6638 (displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_VR || 6625 6639 displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_AR))
+7 -30
drivers/gpu/drm/drm_fb_helper.c
··· 89 89 * interfaces. Drivers that use one of the shared memory managers, TTM, SHMEM, 90 90 * DMA, should instead use the corresponding fbdev emulation. 91 91 * 92 - * Existing fbdev implementations should restore the fbdev console by using 93 - * drm_fb_helper_lastclose() as their &drm_driver.lastclose callback. 94 - * They should also notify the fb helper code from updates to the output 95 - * configuration by using drm_fb_helper_output_poll_changed() as their 96 - * &drm_mode_config_funcs.output_poll_changed callback. New implementations 97 - * of fbdev should be build on top of struct &drm_client_funcs, which handles 98 - * this automatically. Setting the old callbacks should be avoided. 99 - * 100 92 * For suspend/resume consider using drm_mode_config_helper_suspend() and 101 93 * drm_mode_config_helper_resume() which takes care of fbdev as well. 102 94 * ··· 252 260 * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration 253 261 * @fb_helper: driver-allocated fbdev helper, can be NULL 254 262 * 255 - * This should be called from driver's drm &drm_driver.lastclose callback 256 - * when implementing an fbcon on top of kms using this helper. This ensures that 257 - * the user isn't greeted with a black screen when e.g. X dies. 263 + * This helper should be called from fbdev emulation's &drm_client_funcs.restore 264 + * callback. It ensures that the user isn't greeted with a black screen when the 265 + * userspace compositor releases the display device. 258 266 * 259 - * RETURNS: 260 - * Zero if everything went ok, negative error code otherwise. 267 + * Returns: 268 + * 0 on success, or a negative errno code otherwise. 261 269 */ 262 270 int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper) 263 271 { ··· 1995 2003 * drm_fb_helper_lastclose - DRM driver lastclose helper for fbdev emulation 1996 2004 * @dev: DRM device 1997 2005 * 1998 - * This function can be used as the &drm_driver->lastclose callback for drivers 1999 - * that only need to call drm_fb_helper_restore_fbdev_mode_unlocked(). 2006 + * This function is obsolete. Call drm_fb_helper_restore_fbdev_mode_unlocked() 2007 + * instead. 2000 2008 */ 2001 2009 void drm_fb_helper_lastclose(struct drm_device *dev) 2002 2010 { 2003 2011 drm_fb_helper_restore_fbdev_mode_unlocked(dev->fb_helper); 2004 2012 } 2005 2013 EXPORT_SYMBOL(drm_fb_helper_lastclose); 2006 - 2007 - /** 2008 - * drm_fb_helper_output_poll_changed - DRM mode config \.output_poll_changed 2009 - * helper for fbdev emulation 2010 - * @dev: DRM device 2011 - * 2012 - * This function can be used as the 2013 - * &drm_mode_config_funcs.output_poll_changed callback for drivers that only 2014 - * need to call drm_fbdev.hotplug_event(). 2015 - */ 2016 - void drm_fb_helper_output_poll_changed(struct drm_device *dev) 2017 - { 2018 - drm_fb_helper_hotplug_event(dev->fb_helper); 2019 - } 2020 - EXPORT_SYMBOL(drm_fb_helper_output_poll_changed);
+10 -22
drivers/gpu/drm/drm_file.c
··· 38 38 #include <linux/pci.h> 39 39 #include <linux/poll.h> 40 40 #include <linux/slab.h> 41 + #include <linux/vga_switcheroo.h> 41 42 42 43 #include <drm/drm_client.h> 43 44 #include <drm/drm_drv.h> ··· 61 60 * Similar hilarity holds for the unload callback. 62 61 */ 63 62 if (dev->driver->load || dev->driver->unload) 64 - return true; 65 - 66 - /* 67 - * Drivers with the lastclose callback assume that it's synchronized 68 - * against concurrent opens, which again needs the BKL. The proper fix 69 - * is to use the drm_client infrastructure with proper locking for each 70 - * client. 71 - */ 72 - if (dev->driver->lastclose) 73 63 return true; 74 64 75 65 return false; ··· 387 395 } 388 396 EXPORT_SYMBOL(drm_open); 389 397 390 - void drm_lastclose(struct drm_device * dev) 398 + static void drm_lastclose(struct drm_device *dev) 391 399 { 392 - drm_dbg_core(dev, "\n"); 393 - 394 - if (dev->driver->lastclose) 395 - dev->driver->lastclose(dev); 396 - drm_dbg_core(dev, "driver lastclose completed\n"); 397 - 398 400 drm_client_dev_restore(dev); 401 + 402 + if (dev_is_pci(dev->dev)) 403 + vga_switcheroo_process_delayed_switch(); 399 404 } 400 405 401 406 /** ··· 401 412 * @filp: file pointer. 402 413 * 403 414 * This function must be used by drivers as their &file_operations.release 404 - * method. It frees any resources associated with the open file, and calls the 405 - * &drm_driver.postclose driver callback. If this is the last open file for the 406 - * DRM device also proceeds to call the &drm_driver.lastclose driver callback. 415 + * method. It frees any resources associated with the open file. If this 416 + * is the last open file for the DRM device, it also restores the active 417 + * in-kernel DRM client. 407 418 * 408 419 * RETURNS: 409 420 * ··· 473 484 * 474 485 * This function may be used by drivers as their &file_operations.release 475 486 * method. It frees any resources associated with the open file prior to taking 476 - * the drm_global_mutex, which then calls the &drm_driver.postclose driver 477 - * callback. If this is the last open file for the DRM device also proceeds to 478 - * call the &drm_driver.lastclose driver callback. 487 + * the drm_global_mutex. If this is the last open file for the DRM device, it 488 + * then restores the active in-kernel DRM client. 479 489 * 480 490 * RETURNS: 481 491 *
-1
drivers/gpu/drm/drm_internal.h
··· 53 53 bool drm_dev_needs_global_mutex(struct drm_device *dev); 54 54 struct drm_file *drm_file_alloc(struct drm_minor *minor); 55 55 void drm_file_free(struct drm_file *file); 56 - void drm_lastclose(struct drm_device *dev); 57 56 58 57 #ifdef CONFIG_PCI 59 58
+194
drivers/gpu/drm/drm_mipi_dsi.c
··· 603 603 * mipi_dsi_turn_on_peripheral() - sends a Turn On Peripheral command 604 604 * @dsi: DSI peripheral device 605 605 * 606 + * This function is deprecated. Use mipi_dsi_turn_on_peripheral_multi() instead. 607 + * 606 608 * Return: 0 on success or a negative error code on failure. 607 609 */ 608 610 int mipi_dsi_turn_on_peripheral(struct mipi_dsi_device *dsi) ··· 654 652 * @pps_selector: Select PPS from the table of pre-stored or uploaded PPS entries 655 653 * 656 654 * Enable or disable Display Stream Compression on the peripheral. 655 + * This function is deprecated. Use mipi_dsi_compression_mode_ext_multi() instead. 657 656 * 658 657 * Return: 0 on success or a negative error code on failure. 659 658 */ ··· 706 703 * @pps: VESA DSC 1.1 Picture Parameter Set 707 704 * 708 705 * Transmit the VESA DSC 1.1 Picture Parameter Set to the peripheral. 706 + * This function is deprecated. Use mipi_dsi_picture_parameter_set_multi() instead. 709 707 * 710 708 * Return: 0 on success or a negative error code on failure. 711 709 */ ··· 1041 1037 * mipi_dsi_dcs_nop() - send DCS nop packet 1042 1038 * @dsi: DSI peripheral device 1043 1039 * 1040 + * This function is deprecated. Use mipi_dsi_dcs_nop_multi() instead. 1041 + * 1044 1042 * Return: 0 on success or a negative error code on failure. 1045 1043 */ 1046 1044 int mipi_dsi_dcs_nop(struct mipi_dsi_device *dsi) ··· 1060 1054 /** 1061 1055 * mipi_dsi_dcs_soft_reset() - perform a software reset of the display module 1062 1056 * @dsi: DSI peripheral device 1057 + * 1058 + * This function is deprecated. Use mipi_dsi_dcs_soft_reset_multi() instead. 1063 1059 * 1064 1060 * Return: 0 on success or a negative error code on failure. 1065 1061 */ ··· 1132 1124 * display module except interface communication 1133 1125 * @dsi: DSI peripheral device 1134 1126 * 1127 + * This function is deprecated. Use mipi_dsi_dcs_enter_sleep_mode_multi() instead. 1128 + * 1135 1129 * Return: 0 on success or a negative error code on failure. 1136 1130 */ 1137 1131 int mipi_dsi_dcs_enter_sleep_mode(struct mipi_dsi_device *dsi) ··· 1152 1142 * mipi_dsi_dcs_exit_sleep_mode() - enable all blocks inside the display 1153 1143 * module 1154 1144 * @dsi: DSI peripheral device 1145 + * 1146 + * This function is deprecated. Use mipi_dsi_dcs_exit_sleep_mode_multi() instead. 1155 1147 * 1156 1148 * Return: 0 on success or a negative error code on failure. 1157 1149 */ ··· 1174 1162 * display device 1175 1163 * @dsi: DSI peripheral device 1176 1164 * 1165 + * This function is deprecated. Use mipi_dsi_dcs_set_display_off_multi() instead. 1166 + * 1177 1167 * Return: 0 on success or a negative error code on failure. 1178 1168 */ 1179 1169 int mipi_dsi_dcs_set_display_off(struct mipi_dsi_device *dsi) ··· 1194 1180 * mipi_dsi_dcs_set_display_on() - start displaying the image data on the 1195 1181 * display device 1196 1182 * @dsi: DSI peripheral device 1183 + * 1184 + * This function is deprecated. Use mipi_dsi_dcs_set_display_on_multi() instead. 1197 1185 * 1198 1186 * Return: 0 on success or a negative error code on failure 1199 1187 */ ··· 1217 1201 * @dsi: DSI peripheral device 1218 1202 * @start: first column of frame memory 1219 1203 * @end: last column of frame memory 1204 + * 1205 + * This function is deprecated. Use mipi_dsi_dcs_set_column_address_multi() 1206 + * instead. 1220 1207 * 1221 1208 * Return: 0 on success or a negative error code on failure. 1222 1209 */ ··· 1244 1225 * @dsi: DSI peripheral device 1245 1226 * @start: first page of frame memory 1246 1227 * @end: last page of frame memory 1228 + * 1229 + * This function is deprecated. Use mipi_dsi_dcs_set_page_address_multi() 1230 + * instead. 1247 1231 * 1248 1232 * Return: 0 on success or a negative error code on failure. 1249 1233 */ ··· 1290 1268 * @dsi: DSI peripheral device 1291 1269 * @mode: the Tearing Effect Output Line mode 1292 1270 * 1271 + * This function is deprecated. Use mipi_dsi_dcs_set_tear_on_multi() instead. 1272 + * 1293 1273 * Return: 0 on success or a negative error code on failure 1294 1274 */ 1295 1275 int mipi_dsi_dcs_set_tear_on(struct mipi_dsi_device *dsi, ··· 1314 1290 * data used by the interface 1315 1291 * @dsi: DSI peripheral device 1316 1292 * @format: pixel format 1293 + * 1294 + * This function is deprecated. Use mipi_dsi_dcs_set_pixel_format_multi() 1295 + * instead. 1317 1296 * 1318 1297 * Return: 0 on success or a negative error code on failure. 1319 1298 */ ··· 1360 1333 * display 1361 1334 * @dsi: DSI peripheral device 1362 1335 * @brightness: brightness value 1336 + * 1337 + * This function is deprecated. Use mipi_dsi_dcs_set_display_brightness_multi() 1338 + * instead. 1363 1339 * 1364 1340 * Return: 0 on success or a negative error code on failure. 1365 1341 */ ··· 1668 1638 } 1669 1639 } 1670 1640 EXPORT_SYMBOL(mipi_dsi_dcs_set_tear_on_multi); 1641 + 1642 + /** 1643 + * mipi_dsi_turn_on_peripheral_multi() - sends a Turn On Peripheral command 1644 + * @ctx: Context for multiple DSI transactions 1645 + * 1646 + * Like mipi_dsi_turn_on_peripheral() but deals with errors in a way that 1647 + * makes it convenient to make several calls in a row. 1648 + */ 1649 + void mipi_dsi_turn_on_peripheral_multi(struct mipi_dsi_multi_context *ctx) 1650 + { 1651 + struct mipi_dsi_device *dsi = ctx->dsi; 1652 + struct device *dev = &dsi->dev; 1653 + int ret; 1654 + 1655 + if (ctx->accum_err) 1656 + return; 1657 + 1658 + ret = mipi_dsi_turn_on_peripheral(dsi); 1659 + if (ret < 0) { 1660 + ctx->accum_err = ret; 1661 + dev_err(dev, "Failed to turn on peripheral: %d\n", 1662 + ctx->accum_err); 1663 + } 1664 + } 1665 + EXPORT_SYMBOL(mipi_dsi_turn_on_peripheral_multi); 1666 + 1667 + /** 1668 + * mipi_dsi_dcs_soft_reset_multi() - perform a software reset of the display module 1669 + * @ctx: Context for multiple DSI transactions 1670 + * 1671 + * Like mipi_dsi_dcs_soft_reset() but deals with errors in a way that 1672 + * makes it convenient to make several calls in a row. 1673 + */ 1674 + void mipi_dsi_dcs_soft_reset_multi(struct mipi_dsi_multi_context *ctx) 1675 + { 1676 + struct mipi_dsi_device *dsi = ctx->dsi; 1677 + struct device *dev = &dsi->dev; 1678 + int ret; 1679 + 1680 + if (ctx->accum_err) 1681 + return; 1682 + 1683 + ret = mipi_dsi_dcs_soft_reset(dsi); 1684 + if (ret < 0) { 1685 + ctx->accum_err = ret; 1686 + dev_err(dev, "Failed to mipi_dsi_dcs_soft_reset: %d\n", 1687 + ctx->accum_err); 1688 + } 1689 + } 1690 + EXPORT_SYMBOL(mipi_dsi_dcs_soft_reset_multi); 1691 + 1692 + /** 1693 + * mipi_dsi_dcs_set_display_brightness_multi() - sets the brightness value of 1694 + * the display 1695 + * @ctx: Context for multiple DSI transactions 1696 + * @brightness: brightness value 1697 + * 1698 + * Like mipi_dsi_dcs_set_display_brightness() but deals with errors in a way that 1699 + * makes it convenient to make several calls in a row. 1700 + */ 1701 + void mipi_dsi_dcs_set_display_brightness_multi(struct mipi_dsi_multi_context *ctx, 1702 + u16 brightness) 1703 + { 1704 + struct mipi_dsi_device *dsi = ctx->dsi; 1705 + struct device *dev = &dsi->dev; 1706 + int ret; 1707 + 1708 + if (ctx->accum_err) 1709 + return; 1710 + 1711 + ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness); 1712 + if (ret < 0) { 1713 + ctx->accum_err = ret; 1714 + dev_err(dev, "Failed to write display brightness: %d\n", 1715 + ctx->accum_err); 1716 + } 1717 + } 1718 + EXPORT_SYMBOL(mipi_dsi_dcs_set_display_brightness_multi); 1719 + 1720 + /** 1721 + * mipi_dsi_dcs_set_pixel_format_multi() - sets the pixel format for the RGB image 1722 + * data used by the interface 1723 + * @ctx: Context for multiple DSI transactions 1724 + * @format: pixel format 1725 + * 1726 + * Like mipi_dsi_dcs_set_pixel_format() but deals with errors in a way that 1727 + * makes it convenient to make several calls in a row. 1728 + */ 1729 + void mipi_dsi_dcs_set_pixel_format_multi(struct mipi_dsi_multi_context *ctx, 1730 + u8 format) 1731 + { 1732 + struct mipi_dsi_device *dsi = ctx->dsi; 1733 + struct device *dev = &dsi->dev; 1734 + int ret; 1735 + 1736 + if (ctx->accum_err) 1737 + return; 1738 + 1739 + ret = mipi_dsi_dcs_set_pixel_format(dsi, format); 1740 + if (ret < 0) { 1741 + ctx->accum_err = ret; 1742 + dev_err(dev, "Failed to set pixel format: %d\n", 1743 + ctx->accum_err); 1744 + } 1745 + } 1746 + EXPORT_SYMBOL(mipi_dsi_dcs_set_pixel_format_multi); 1747 + 1748 + /** 1749 + * mipi_dsi_dcs_set_column_address_multi() - define the column extent of the 1750 + * frame memory accessed by the host processor 1751 + * @ctx: Context for multiple DSI transactions 1752 + * @start: first column of frame memory 1753 + * @end: last column of frame memory 1754 + * 1755 + * Like mipi_dsi_dcs_set_column_address() but deals with errors in a way that 1756 + * makes it convenient to make several calls in a row. 1757 + */ 1758 + void mipi_dsi_dcs_set_column_address_multi(struct mipi_dsi_multi_context *ctx, 1759 + u16 start, u16 end) 1760 + { 1761 + struct mipi_dsi_device *dsi = ctx->dsi; 1762 + struct device *dev = &dsi->dev; 1763 + int ret; 1764 + 1765 + if (ctx->accum_err) 1766 + return; 1767 + 1768 + ret = mipi_dsi_dcs_set_column_address(dsi, start, end); 1769 + if (ret < 0) { 1770 + ctx->accum_err = ret; 1771 + dev_err(dev, "Failed to set column address: %d\n", 1772 + ctx->accum_err); 1773 + } 1774 + } 1775 + EXPORT_SYMBOL(mipi_dsi_dcs_set_column_address_multi); 1776 + 1777 + /** 1778 + * mipi_dsi_dcs_set_page_address_multi() - define the page extent of the 1779 + * frame memory accessed by the host processor 1780 + * @ctx: Context for multiple DSI transactions 1781 + * @start: first page of frame memory 1782 + * @end: last page of frame memory 1783 + * 1784 + * Like mipi_dsi_dcs_set_page_address() but deals with errors in a way that 1785 + * makes it convenient to make several calls in a row. 1786 + */ 1787 + void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx, 1788 + u16 start, u16 end) 1789 + { 1790 + struct mipi_dsi_device *dsi = ctx->dsi; 1791 + struct device *dev = &dsi->dev; 1792 + int ret; 1793 + 1794 + if (ctx->accum_err) 1795 + return; 1796 + 1797 + ret = mipi_dsi_dcs_set_page_address(dsi, start, end); 1798 + if (ret < 0) { 1799 + ctx->accum_err = ret; 1800 + dev_err(dev, "Failed to set page address: %d\n", 1801 + ctx->accum_err); 1802 + } 1803 + } 1804 + EXPORT_SYMBOL(mipi_dsi_dcs_set_page_address_multi); 1671 1805 1672 1806 static int mipi_dsi_drv_probe(struct device *dev) 1673 1807 {
+46 -16
drivers/gpu/drm/drm_panic.c
··· 78 78 #define PANIC_LINE(s) {.len = sizeof(s) - 1, .txt = s} 79 79 80 80 static struct drm_panic_line panic_msg[] = { 81 - PANIC_LINE("KERNEL PANIC !"), 81 + PANIC_LINE("KERNEL PANIC!"), 82 82 PANIC_LINE(""), 83 83 PANIC_LINE("Please reboot your computer."), 84 + PANIC_LINE(""), 85 + PANIC_LINE(""), /* will be replaced by the panic description */ 84 86 }; 87 + 88 + #define PANIC_MSG_LINES ARRAY_SIZE(panic_msg) 85 89 86 90 static const struct drm_panic_line logo_ascii[] = { 87 91 PANIC_LINE(" .--. _"), ··· 96 92 PANIC_LINE(" /'\\_ _/`\\ (_)"), 97 93 PANIC_LINE(" \\___)=(___/"), 98 94 }; 95 + 96 + #define PANIC_LOGO_LINES ARRAY_SIZE(logo_ascii) 99 97 100 98 #if defined(CONFIG_LOGO) && !defined(MODULE) 101 99 static const struct linux_logo *logo_mono; ··· 493 487 494 488 static void draw_panic_static_user(struct drm_scanout_buffer *sb) 495 489 { 496 - size_t msg_lines = ARRAY_SIZE(panic_msg); 497 - size_t logo_ascii_lines = ARRAY_SIZE(logo_ascii); 498 490 u32 fg_color = convert_from_xrgb8888(CONFIG_DRM_PANIC_FOREGROUND_COLOR, sb->format->format); 499 491 u32 bg_color = convert_from_xrgb8888(CONFIG_DRM_PANIC_BACKGROUND_COLOR, sb->format->format); 500 492 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); 501 493 struct drm_rect r_screen, r_logo, r_msg; 502 494 unsigned int logo_width, logo_height; 495 + unsigned int msg_width, msg_height; 503 496 504 497 if (!font) 505 498 return; ··· 509 504 logo_width = logo_mono->width; 510 505 logo_height = logo_mono->height; 511 506 } else { 512 - logo_width = get_max_line_len(logo_ascii, logo_ascii_lines) * font->width; 513 - logo_height = logo_ascii_lines * font->height; 507 + logo_width = get_max_line_len(logo_ascii, PANIC_LOGO_LINES) * font->width; 508 + logo_height = PANIC_LOGO_LINES * font->height; 514 509 } 515 - 516 510 r_logo = DRM_RECT_INIT(0, 0, logo_width, logo_height); 517 - r_msg = DRM_RECT_INIT(0, 0, 518 - min(get_max_line_len(panic_msg, msg_lines) * font->width, sb->width), 519 - min(msg_lines * font->height, sb->height)); 511 + 512 + msg_width = min(get_max_line_len(panic_msg, PANIC_MSG_LINES) * font->width, sb->width); 513 + msg_height = min(PANIC_MSG_LINES * font->height, sb->height); 514 + r_msg = DRM_RECT_INIT(0, 0, msg_width, msg_height); 520 515 521 516 /* Center the panic message */ 522 517 drm_rect_translate(&r_msg, (sb->width - r_msg.x2) / 2, (sb->height - r_msg.y2) / 2); ··· 530 525 drm_panic_blit(sb, &r_logo, logo_mono->data, DIV_ROUND_UP(logo_width, 8), 531 526 fg_color); 532 527 else 533 - draw_txt_rectangle(sb, font, logo_ascii, logo_ascii_lines, false, &r_logo, 528 + draw_txt_rectangle(sb, font, logo_ascii, PANIC_LOGO_LINES, false, &r_logo, 534 529 fg_color); 535 530 } 536 - draw_txt_rectangle(sb, font, panic_msg, msg_lines, true, &r_msg, fg_color); 531 + draw_txt_rectangle(sb, font, panic_msg, PANIC_MSG_LINES, true, &r_msg, fg_color); 537 532 } 538 533 539 534 /* ··· 638 633 } 639 634 } 640 635 641 - static void draw_panic_plane(struct drm_plane *plane) 636 + static void drm_panic_set_description(const char *description) 637 + { 638 + u32 len; 639 + 640 + if (description) { 641 + struct drm_panic_line *desc_line = &panic_msg[PANIC_MSG_LINES - 1]; 642 + 643 + desc_line->txt = description; 644 + len = strlen(description); 645 + /* ignore the last newline character */ 646 + if (len && description[len - 1] == '\n') 647 + len -= 1; 648 + desc_line->len = len; 649 + } 650 + } 651 + 652 + static void drm_panic_clear_description(void) 653 + { 654 + struct drm_panic_line *desc_line = &panic_msg[PANIC_MSG_LINES - 1]; 655 + 656 + desc_line->len = 0; 657 + desc_line->txt = NULL; 658 + } 659 + 660 + static void draw_panic_plane(struct drm_plane *plane, const char *description) 642 661 { 643 662 struct drm_scanout_buffer sb = { }; 644 663 int ret; ··· 671 642 if (!drm_panic_trylock(plane->dev, flags)) 672 643 return; 673 644 645 + drm_panic_set_description(description); 646 + 674 647 ret = plane->helper_private->get_scanout_buffer(plane, &sb); 675 648 676 649 if (!ret && drm_panic_is_format_supported(sb.format)) { ··· 680 649 if (plane->helper_private->panic_flush) 681 650 plane->helper_private->panic_flush(plane); 682 651 } 652 + drm_panic_clear_description(); 683 653 drm_panic_unlock(plane->dev, flags); 684 654 } 685 655 ··· 694 662 struct drm_plane *plane = to_drm_plane(dumper); 695 663 696 664 if (detail->reason == KMSG_DUMP_PANIC) 697 - draw_panic_plane(plane); 665 + draw_panic_plane(plane, detail->description); 698 666 } 699 667 700 668 ··· 714 682 if (kstrtobool_from_user(user_buf, count, &run) == 0 && run) { 715 683 struct drm_plane *plane = file->private_data; 716 684 717 - draw_panic_plane(plane); 685 + draw_panic_plane(plane, "Test from debugfs"); 718 686 } 719 687 return count; 720 688 } ··· 784 752 if (registered_plane) 785 753 drm_info(dev, "Registered %d planes with drm panic\n", registered_plane); 786 754 } 787 - EXPORT_SYMBOL(drm_panic_register); 788 755 789 756 /** 790 757 * drm_panic_unregister() ··· 802 771 kmsg_dump_unregister(&plane->kmsg_panic); 803 772 } 804 773 } 805 - EXPORT_SYMBOL(drm_panic_unregister);
+1 -9
drivers/gpu/drm/drm_probe_helper.c
··· 714 714 * @dev: drm_device whose connector state changed 715 715 * 716 716 * This function fires off the uevent for userspace and also calls the 717 - * output_poll_changed function, which is most commonly used to inform the fbdev 717 + * client hotplug function, which is most commonly used to inform the fbdev 718 718 * emulation code and allow it to update the fbcon output configuration. 719 719 * 720 720 * Drivers should call this from their hotplug handling code when a change is ··· 730 730 */ 731 731 void drm_kms_helper_hotplug_event(struct drm_device *dev) 732 732 { 733 - /* send a uevent + call fbdev */ 734 733 drm_sysfs_hotplug_event(dev); 735 - if (dev->mode_config.funcs->output_poll_changed) 736 - dev->mode_config.funcs->output_poll_changed(dev); 737 - 738 734 drm_client_dev_hotplug(dev); 739 735 } 740 736 EXPORT_SYMBOL(drm_kms_helper_hotplug_event); ··· 746 750 { 747 751 struct drm_device *dev = connector->dev; 748 752 749 - /* send a uevent + call fbdev */ 750 753 drm_sysfs_connector_hotplug_event(connector); 751 - if (dev->mode_config.funcs->output_poll_changed) 752 - dev->mode_config.funcs->output_poll_changed(dev); 753 - 754 754 drm_client_dev_hotplug(dev); 755 755 } 756 756 EXPORT_SYMBOL(drm_kms_helper_connector_hotplug_event);
-1
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h
··· 57 57 int hibmc_de_init(struct hibmc_drm_private *priv); 58 58 int hibmc_vdac_init(struct hibmc_drm_private *priv); 59 59 60 - int hibmc_mm_init(struct hibmc_drm_private *hibmc); 61 60 int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_connector *connector); 62 61 63 62 #endif
+13 -5
drivers/gpu/drm/i915/gvt/kvmgt.c
··· 425 425 .release = intel_vgpu_reg_release_opregion, 426 426 }; 427 427 428 + static bool edid_valid(const void *edid, size_t size) 429 + { 430 + const struct drm_edid *drm_edid; 431 + bool is_valid; 432 + 433 + drm_edid = drm_edid_alloc(edid, size); 434 + is_valid = drm_edid_valid(drm_edid); 435 + drm_edid_free(drm_edid); 436 + 437 + return is_valid; 438 + } 439 + 428 440 static int handle_edid_regs(struct intel_vgpu *vgpu, 429 441 struct vfio_edid_region *region, char *buf, 430 442 size_t count, u16 offset, bool is_write) ··· 455 443 switch (offset) { 456 444 case offsetof(struct vfio_region_gfx_edid, link_state): 457 445 if (data == VFIO_DEVICE_GFX_LINK_STATE_UP) { 458 - if (!drm_edid_block_valid( 459 - (u8 *)region->edid_blob, 460 - 0, 461 - true, 462 - NULL)) { 446 + if (!edid_valid(region->edid_blob, EDID_SIZE)) { 463 447 gvt_vgpu_err("invalid EDID blob\n"); 464 448 return -EINVAL; 465 449 }
-1
drivers/gpu/drm/nouveau/dispnv50/disp.c
··· 2648 2648 static const struct drm_mode_config_funcs 2649 2649 nv50_disp_func = { 2650 2650 .fb_create = nouveau_user_framebuffer_create, 2651 - .output_poll_changed = drm_fb_helper_output_poll_changed, 2652 2651 .atomic_check = nv50_disp_atomic_check, 2653 2652 .atomic_commit = nv50_disp_atomic_commit, 2654 2653 .atomic_state_alloc = nv50_disp_atomic_state_alloc,
-1
drivers/gpu/drm/nouveau/nouveau_display.c
··· 391 391 392 392 static const struct drm_mode_config_funcs nouveau_mode_config_funcs = { 393 393 .fb_create = nouveau_user_framebuffer_create, 394 - .output_poll_changed = drm_fb_helper_output_poll_changed, 395 394 }; 396 395 397 396
-1
drivers/gpu/drm/nouveau/nouveau_drm.c
··· 1303 1303 DRIVER_RENDER, 1304 1304 .open = nouveau_drm_open, 1305 1305 .postclose = nouveau_drm_postclose, 1306 - .lastclose = nouveau_vga_lastclose, 1307 1306 1308 1307 #if defined(CONFIG_DEBUG_FS) 1309 1308 .debugfs_init = nouveau_drm_debugfs_init,
+2 -8
drivers/gpu/drm/nouveau/nouveau_vga.c
··· 58 58 nouveau_switcheroo_reprobe(struct pci_dev *pdev) 59 59 { 60 60 struct nouveau_drm *drm = pci_get_drvdata(pdev); 61 + struct drm_device *dev = drm->dev; 61 62 62 - drm_fb_helper_output_poll_changed(drm->dev); 63 + drm_client_dev_hotplug(dev); 63 64 } 64 65 65 66 static bool ··· 127 126 vga_switcheroo_unregister_client(pdev); 128 127 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus()) 129 128 vga_switcheroo_fini_domain_pm_ops(drm->dev->dev); 130 - } 131 - 132 - 133 - void 134 - nouveau_vga_lastclose(struct drm_device *dev) 135 - { 136 - vga_switcheroo_process_delayed_switch(); 137 129 }
-1
drivers/gpu/drm/nouveau/nouveau_vga.h
··· 4 4 5 5 void nouveau_vga_init(struct nouveau_drm *); 6 6 void nouveau_vga_fini(struct nouveau_drm *); 7 - void nouveau_vga_lastclose(struct drm_device *dev); 8 7 9 8 #endif
+1 -1
drivers/gpu/drm/panel/panel-novatek-nt35510.c
··· 1166 1166 bl->props.brightness = nt->conf->wrdisbv; 1167 1167 else 1168 1168 bl->props.brightness = 255; 1169 - bl->props.power = FB_BLANK_POWERDOWN; 1169 + bl->props.power = BACKLIGHT_POWER_OFF; 1170 1170 nt->panel.backlight = bl; 1171 1171 } 1172 1172
+2 -2
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
··· 389 389 return -ENXIO; 390 390 } 391 391 392 - if (bd->props.power <= FB_BLANK_NORMAL) { 392 + if (bd->props.power <= BACKLIGHT_POWER_REDUCED) { 393 393 /* Power on the backlight with the requested brightness 394 394 * Note We can not use mipi_dsi_dcs_set_display_brightness() 395 395 * as otm8009a driver support only 8-bit brightness (1 param). ··· 465 465 466 466 ctx->bl_dev->props.max_brightness = OTM8009A_BACKLIGHT_MAX; 467 467 ctx->bl_dev->props.brightness = OTM8009A_BACKLIGHT_DEFAULT; 468 - ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; 468 + ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; 469 469 ctx->bl_dev->props.type = BACKLIGHT_RAW; 470 470 471 471 drm_panel_add(&ctx->panel);
+5 -5
drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
··· 458 458 return -EINVAL; 459 459 } 460 460 461 - if (bl_dev->props.power > FB_BLANK_NORMAL) 461 + if (bl_dev->props.power > BACKLIGHT_POWER_REDUCED) 462 462 return -EPERM; 463 463 464 464 s6e3ha2_call_write_func(ret, s6e3ha2_test_key_on_f0(ctx)); ··· 508 508 s6e3ha2_call_write_func(ret, mipi_dsi_dcs_set_display_off(dsi)); 509 509 510 510 msleep(40); 511 - ctx->bl_dev->props.power = FB_BLANK_NORMAL; 511 + ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; 512 512 513 513 return 0; 514 514 } ··· 554 554 if (ret < 0) 555 555 goto err; 556 556 557 - ctx->bl_dev->props.power = FB_BLANK_NORMAL; 557 + ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; 558 558 559 559 return 0; 560 560 ··· 601 601 s6e3ha2_call_write_func(ret, s6e3ha2_test_key_off_f0(ctx)); 602 602 603 603 s6e3ha2_call_write_func(ret, mipi_dsi_dcs_set_display_on(dsi)); 604 - ctx->bl_dev->props.power = FB_BLANK_UNBLANK; 604 + ctx->bl_dev->props.power = BACKLIGHT_POWER_ON; 605 605 606 606 return 0; 607 607 } ··· 729 729 730 730 ctx->bl_dev->props.max_brightness = S6E3HA2_MAX_BRIGHTNESS; 731 731 ctx->bl_dev->props.brightness = S6E3HA2_DEFAULT_BRIGHTNESS; 732 - ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; 732 + ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; 733 733 734 734 drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs, 735 735 DRM_MODE_CONNECTOR_DSI);
+5 -5
drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
··· 225 225 if (ret < 0) 226 226 return ret; 227 227 228 - ctx->bl_dev->props.power = FB_BLANK_NORMAL; 228 + ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; 229 229 230 230 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 231 231 if (ret < 0) ··· 245 245 if (ret < 0) 246 246 return ret; 247 247 248 - ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; 248 + ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; 249 249 250 250 return 0; 251 251 } ··· 332 332 if (ret < 0) 333 333 goto err; 334 334 335 - ctx->bl_dev->props.power = FB_BLANK_NORMAL; 335 + ctx->bl_dev->props.power = BACKLIGHT_POWER_REDUCED; 336 336 337 337 return 0; 338 338 ··· 393 393 if (ret < 0) 394 394 return ret; 395 395 396 - ctx->bl_dev->props.power = FB_BLANK_UNBLANK; 396 + ctx->bl_dev->props.power = BACKLIGHT_POWER_ON; 397 397 398 398 return 0; 399 399 } ··· 473 473 474 474 ctx->bl_dev->props.max_brightness = MAX_BRIGHTNESS; 475 475 ctx->bl_dev->props.brightness = DEFAULT_BRIGHTNESS; 476 - ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; 476 + ctx->bl_dev->props.power = BACKLIGHT_POWER_OFF; 477 477 478 478 drm_panel_add(&ctx->panel); 479 479
+1 -1
drivers/gpu/drm/panel/panel-sony-acx565akm.c
··· 342 342 static int acx565akm_backlight_init(struct acx565akm_panel *lcd) 343 343 { 344 344 struct backlight_properties props = { 345 - .power = FB_BLANK_UNBLANK, 345 + .power = BACKLIGHT_POWER_ON, 346 346 .type = BACKLIGHT_RAW, 347 347 }; 348 348 int ret;
+35 -80
drivers/gpu/drm/panel/panel-startek-kd070fhfid015.c
··· 24 24 #include <drm/drm_modes.h> 25 25 #include <drm/drm_panel.h> 26 26 27 - #define DSI_REG_MCAP 0xB0 28 - #define DSI_REG_IS 0xB3 /* Interface Setting */ 29 - #define DSI_REG_IIS 0xB4 /* Interface ID Setting */ 30 - #define DSI_REG_CTRL 0xB6 27 + #define DSI_REG_MCAP 0xb0 28 + #define DSI_REG_IS 0xb3 /* Interface Setting */ 29 + #define DSI_REG_IIS 0xb4 /* Interface ID Setting */ 30 + #define DSI_REG_CTRL 0xb6 31 31 32 32 enum { 33 33 IOVCC = 0, ··· 52 52 static int stk_panel_init(struct stk_panel *stk) 53 53 { 54 54 struct mipi_dsi_device *dsi = stk->dsi; 55 - struct device *dev = &stk->dsi->dev; 56 - int ret; 55 + struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi}; 57 56 58 - ret = mipi_dsi_dcs_soft_reset(dsi); 59 - if (ret < 0) { 60 - dev_err(dev, "failed to mipi_dsi_dcs_soft_reset: %d\n", ret); 61 - return ret; 62 - } 63 - mdelay(5); 57 + mipi_dsi_dcs_soft_reset_multi(&dsi_ctx); 58 + mipi_dsi_msleep(&dsi_ctx, 5); 59 + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx); 60 + mipi_dsi_msleep(&dsi_ctx, 120); 64 61 65 - ret = mipi_dsi_dcs_exit_sleep_mode(dsi); 66 - if (ret < 0) { 67 - dev_err(dev, "failed to set exit sleep mode: %d\n", ret); 68 - return ret; 69 - } 70 - msleep(120); 71 - 72 - mipi_dsi_generic_write_seq(dsi, DSI_REG_MCAP, 0x04); 62 + mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_MCAP, 0x04); 73 63 74 64 /* Interface setting, video mode */ 75 - mipi_dsi_generic_write_seq(dsi, DSI_REG_IS, 0x14, 0x08, 0x00, 0x22, 0x00); 76 - mipi_dsi_generic_write_seq(dsi, DSI_REG_IIS, 0x0C, 0x00); 77 - mipi_dsi_generic_write_seq(dsi, DSI_REG_CTRL, 0x3A, 0xD3); 65 + mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_IS, 0x14, 0x08, 0x00, 0x22, 0x00); 66 + mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_IIS, 0x0c, 0x00); 67 + mipi_dsi_generic_write_seq_multi(&dsi_ctx, DSI_REG_CTRL, 0x3a, 0xd3); 78 68 79 - ret = mipi_dsi_dcs_set_display_brightness(dsi, 0x77); 80 - if (ret < 0) { 81 - dev_err(dev, "failed to write display brightness: %d\n", ret); 82 - return ret; 83 - } 69 + mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0x77); 84 70 85 - mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 86 - MIPI_DCS_WRITE_MEMORY_START); 71 + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 72 + MIPI_DCS_WRITE_MEMORY_START); 87 73 88 - ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x77); 89 - if (ret < 0) { 90 - dev_err(dev, "failed to set pixel format: %d\n", ret); 91 - return ret; 92 - } 74 + mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx, 0x77); 75 + mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0, stk->mode->hdisplay - 1); 76 + mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0, stk->mode->vdisplay - 1); 93 77 94 - ret = mipi_dsi_dcs_set_column_address(dsi, 0, stk->mode->hdisplay - 1); 95 - if (ret < 0) { 96 - dev_err(dev, "failed to set column address: %d\n", ret); 97 - return ret; 98 - } 99 - 100 - ret = mipi_dsi_dcs_set_page_address(dsi, 0, stk->mode->vdisplay - 1); 101 - if (ret < 0) { 102 - dev_err(dev, "failed to set page address: %d\n", ret); 103 - return ret; 104 - } 105 - 106 - return 0; 78 + return dsi_ctx.accum_err; 107 79 } 108 80 109 81 static int stk_panel_on(struct stk_panel *stk) 110 82 { 111 83 struct mipi_dsi_device *dsi = stk->dsi; 112 - struct device *dev = &stk->dsi->dev; 113 - int ret; 84 + struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi}; 114 85 115 - ret = mipi_dsi_dcs_set_display_on(dsi); 116 - if (ret < 0) 117 - dev_err(dev, "failed to set display on: %d\n", ret); 86 + mipi_dsi_dcs_set_display_on_multi(&dsi_ctx); 118 87 119 - mdelay(20); 88 + mipi_dsi_msleep(&dsi_ctx, 20); 120 89 121 - return ret; 90 + return dsi_ctx.accum_err; 122 91 } 123 92 124 93 static void stk_panel_off(struct stk_panel *stk) 125 94 { 126 95 struct mipi_dsi_device *dsi = stk->dsi; 127 - struct device *dev = &stk->dsi->dev; 128 - int ret; 96 + struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi}; 129 97 130 98 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; 131 99 132 - ret = mipi_dsi_dcs_set_display_off(dsi); 133 - if (ret < 0) 134 - dev_err(dev, "failed to set display off: %d\n", ret); 100 + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); 101 + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); 135 102 136 - ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 137 - if (ret < 0) 138 - dev_err(dev, "failed to enter sleep mode: %d\n", ret); 139 - 140 - msleep(100); 103 + mipi_dsi_msleep(&dsi_ctx, 100); 141 104 } 142 105 143 106 static int stk_panel_unprepare(struct drm_panel *panel) ··· 118 155 static int stk_panel_prepare(struct drm_panel *panel) 119 156 { 120 157 struct stk_panel *stk = to_stk_panel(panel); 121 - struct device *dev = &stk->dsi->dev; 122 158 int ret; 123 159 124 160 gpiod_set_value(stk->reset_gpio, 0); ··· 137 175 gpiod_set_value(stk->reset_gpio, 1); 138 176 mdelay(10); 139 177 ret = stk_panel_init(stk); 140 - if (ret < 0) { 141 - dev_err(dev, "failed to init panel: %d\n", ret); 178 + if (ret < 0) 142 179 goto poweroff; 143 - } 144 180 145 181 ret = stk_panel_on(stk); 146 - if (ret < 0) { 147 - dev_err(dev, "failed to set panel on: %d\n", ret); 182 + if (ret < 0) 148 183 goto poweroff; 149 - } 150 184 151 185 return 0; 152 186 ··· 208 250 static int dsi_dcs_bl_update_status(struct backlight_device *bl) 209 251 { 210 252 struct mipi_dsi_device *dsi = bl_get_data(bl); 211 - struct device *dev = &dsi->dev; 212 - int ret; 253 + struct mipi_dsi_multi_context dsi_ctx = {.dsi = dsi}; 213 254 214 255 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; 215 - ret = mipi_dsi_dcs_set_display_brightness(dsi, bl->props.brightness); 216 - if (ret < 0) { 217 - dev_err(dev, "failed to set DSI control: %d\n", ret); 218 - return ret; 219 - } 256 + mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, bl->props.brightness); 257 + if (dsi_ctx.accum_err) 258 + return dsi_ctx.accum_err; 220 259 221 260 dsi->mode_flags |= MIPI_DSI_MODE_LPM; 222 - return 0; 261 + return dsi_ctx.accum_err; 223 262 } 224 263 225 264 static const struct backlight_ops dsi_bl_ops = {
+1 -1
drivers/gpu/drm/radeon/atombios_encoders.c
··· 249 249 */ 250 250 if (bd->props.brightness == 0) 251 251 bd->props.brightness = RADEON_MAX_BL_LEVEL; 252 - bd->props.power = FB_BLANK_UNBLANK; 252 + bd->props.power = BACKLIGHT_POWER_ON; 253 253 backlight_update_status(bd); 254 254 255 255 DRM_INFO("radeon atom DIG backlight initialized\n");
+1 -1
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
··· 450 450 } 451 451 452 452 bd->props.brightness = radeon_legacy_backlight_get_brightness(bd); 453 - bd->props.power = FB_BLANK_UNBLANK; 453 + bd->props.power = BACKLIGHT_POWER_ON; 454 454 backlight_update_status(bd); 455 455 456 456 DRM_INFO("radeon legacy LVDS backlight initialized\n");
+1 -1
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
··· 262 262 return 0; 263 263 } 264 264 265 - static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = { 265 + static const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = { 266 266 .mode_fixup = rockchip_dp_drm_encoder_mode_fixup, 267 267 .mode_set = rockchip_dp_drm_encoder_mode_set, 268 268 .atomic_enable = rockchip_dp_drm_encoder_enable,
+13 -19
drivers/gpu/drm/rockchip/cdn-dp-core.c
··· 266 266 267 267 mutex_lock(&dp->lock); 268 268 269 - if (dp->drm_edid) { 270 - /* FIXME: get rid of drm_edid_raw() */ 271 - const struct edid *edid = drm_edid_raw(dp->drm_edid); 272 - 273 - DRM_DEV_DEBUG_KMS(dp->dev, "got edid: width[%d] x height[%d]\n", 274 - edid->width_cm, edid->height_cm); 275 - 276 - } 277 - 278 269 ret = drm_edid_connector_add_modes(connector); 279 270 280 271 mutex_unlock(&dp->lock); ··· 360 369 361 370 static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp) 362 371 { 372 + const struct drm_display_info *info = &dp->connector.display_info; 363 373 int ret; 364 374 365 375 if (!cdn_dp_check_sink_connection(dp)) ··· 378 386 cdn_dp_get_edid_block, dp); 379 387 drm_edid_connector_update(&dp->connector, dp->drm_edid); 380 388 381 - dp->sink_has_audio = dp->connector.display_info.has_audio; 389 + dp->sink_has_audio = info->has_audio; 390 + 391 + if (dp->drm_edid) 392 + DRM_DEV_DEBUG_KMS(dp->dev, "got edid: width[%d] x height[%d]\n", 393 + info->width_mm / 10, info->height_mm / 10); 382 394 383 395 return 0; 384 396 } ··· 965 969 966 970 /* Not connected, notify userspace to disable the block */ 967 971 if (!cdn_dp_connected_port(dp)) { 968 - DRM_DEV_INFO(dp->dev, "Not connected. Disabling cdn\n"); 972 + DRM_DEV_INFO(dp->dev, "Not connected; disabling cdn\n"); 969 973 dp->connected = false; 970 974 971 975 /* Connected but not enabled, enable the block */ 972 976 } else if (!dp->active) { 973 - DRM_DEV_INFO(dp->dev, "Connected, not enabled. Enabling cdn\n"); 977 + DRM_DEV_INFO(dp->dev, "Connected, not enabled; enabling cdn\n"); 974 978 ret = cdn_dp_enable(dp); 975 979 if (ret) { 976 - DRM_DEV_ERROR(dp->dev, "Enable dp failed %d\n", ret); 980 + DRM_DEV_ERROR(dp->dev, "Enabling dp failed: %d\n", ret); 977 981 dp->connected = false; 978 982 } 979 983 980 984 /* Enabled and connected to a dongle without a sink, notify userspace */ 981 985 } else if (!cdn_dp_check_sink_connection(dp)) { 982 - DRM_DEV_INFO(dp->dev, "Connected without sink. Assert hpd\n"); 986 + DRM_DEV_INFO(dp->dev, "Connected without sink; assert hpd\n"); 983 987 dp->connected = false; 984 988 985 989 /* Enabled and connected with a sink, re-train if requested */ ··· 988 992 unsigned int lanes = dp->max_lanes; 989 993 struct drm_display_mode *mode = &dp->mode; 990 994 991 - DRM_DEV_INFO(dp->dev, "Connected with sink. Re-train link\n"); 995 + DRM_DEV_INFO(dp->dev, "Connected with sink; re-train link\n"); 992 996 ret = cdn_dp_train_link(dp); 993 997 if (ret) { 994 998 dp->connected = false; 995 - DRM_DEV_ERROR(dp->dev, "Train link failed %d\n", ret); 999 + DRM_DEV_ERROR(dp->dev, "Training link failed: %d\n", ret); 996 1000 goto out; 997 1001 } 998 1002 ··· 1002 1006 ret = cdn_dp_config_video(dp); 1003 1007 if (ret) { 1004 1008 dp->connected = false; 1005 - DRM_DEV_ERROR(dp->dev, 1006 - "Failed to config video %d\n", 1007 - ret); 1009 + DRM_DEV_ERROR(dp->dev, "Failed to configure video: %d\n", ret); 1008 1010 } 1009 1011 } 1010 1012 }
+41 -66
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
··· 61 61 * @lcdsel_grf_reg: grf register offset of lcdc select 62 62 * @lcdsel_big: reg value of selecting vop big for HDMI 63 63 * @lcdsel_lit: reg value of selecting vop little for HDMI 64 + * @max_tmds_clock: maximum TMDS clock rate supported 64 65 */ 65 66 struct rockchip_hdmi_chip_data { 66 67 int lcdsel_grf_reg; 67 68 u32 lcdsel_big; 68 69 u32 lcdsel_lit; 70 + int max_tmds_clock; 69 71 }; 70 72 71 73 struct rockchip_hdmi { ··· 79 77 struct clk *ref_clk; 80 78 struct clk *grf_clk; 81 79 struct dw_hdmi *hdmi; 82 - struct regulator *avdd_0v9; 83 - struct regulator *avdd_1v8; 84 80 struct phy *phy; 85 81 }; 86 82 ··· 209 209 static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi) 210 210 { 211 211 struct device_node *np = hdmi->dev->of_node; 212 + int ret; 212 213 213 214 hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 214 215 if (IS_ERR(hdmi->regmap)) { 215 - DRM_DEV_ERROR(hdmi->dev, "Unable to get rockchip,grf\n"); 216 + drm_err(hdmi, "Unable to get rockchip,grf\n"); 216 217 return PTR_ERR(hdmi->regmap); 217 218 } 218 219 219 - hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "ref"); 220 + hdmi->ref_clk = devm_clk_get_optional_enabled(hdmi->dev, "ref"); 220 221 if (!hdmi->ref_clk) 221 - hdmi->ref_clk = devm_clk_get_optional(hdmi->dev, "vpll"); 222 + hdmi->ref_clk = devm_clk_get_optional_enabled(hdmi->dev, "vpll"); 222 223 223 - if (PTR_ERR(hdmi->ref_clk) == -EPROBE_DEFER) { 224 - return -EPROBE_DEFER; 225 - } else if (IS_ERR(hdmi->ref_clk)) { 226 - DRM_DEV_ERROR(hdmi->dev, "failed to get reference clock\n"); 227 - return PTR_ERR(hdmi->ref_clk); 224 + if (IS_ERR(hdmi->ref_clk)) { 225 + ret = PTR_ERR(hdmi->ref_clk); 226 + if (ret != -EPROBE_DEFER) 227 + drm_err(hdmi, "failed to get reference clock\n"); 228 + return ret; 228 229 } 229 230 230 - hdmi->grf_clk = devm_clk_get(hdmi->dev, "grf"); 231 - if (PTR_ERR(hdmi->grf_clk) == -ENOENT) { 232 - hdmi->grf_clk = NULL; 233 - } else if (PTR_ERR(hdmi->grf_clk) == -EPROBE_DEFER) { 234 - return -EPROBE_DEFER; 235 - } else if (IS_ERR(hdmi->grf_clk)) { 236 - DRM_DEV_ERROR(hdmi->dev, "failed to get grf clock\n"); 237 - return PTR_ERR(hdmi->grf_clk); 231 + hdmi->grf_clk = devm_clk_get_optional(hdmi->dev, "grf"); 232 + if (IS_ERR(hdmi->grf_clk)) { 233 + ret = PTR_ERR(hdmi->grf_clk); 234 + if (ret != -EPROBE_DEFER) 235 + drm_err(hdmi, "failed to get grf clock\n"); 236 + return ret; 238 237 } 239 238 240 - hdmi->avdd_0v9 = devm_regulator_get(hdmi->dev, "avdd-0v9"); 241 - if (IS_ERR(hdmi->avdd_0v9)) 242 - return PTR_ERR(hdmi->avdd_0v9); 239 + ret = devm_regulator_get_enable(hdmi->dev, "avdd-0v9"); 240 + if (ret) 241 + return ret; 243 242 244 - hdmi->avdd_1v8 = devm_regulator_get(hdmi->dev, "avdd-1v8"); 245 - if (IS_ERR(hdmi->avdd_1v8)) 246 - return PTR_ERR(hdmi->avdd_1v8); 243 + ret = devm_regulator_get_enable(hdmi->dev, "avdd-1v8"); 247 244 248 - return 0; 245 + return ret; 249 246 } 250 247 251 248 static enum drm_mode_status ··· 255 258 int pclk = mode->clock * 1000; 256 259 bool exact_match = hdmi->plat_data->phy_force_vendor; 257 260 int i; 261 + 262 + if (hdmi->chip_data->max_tmds_clock && 263 + mode->clock > hdmi->chip_data->max_tmds_clock) 264 + return MODE_CLOCK_HIGH; 258 265 259 266 if (hdmi->ref_clk) { 260 267 int rpclk = clk_round_rate(hdmi->ref_clk, pclk); ··· 323 322 324 323 ret = clk_prepare_enable(hdmi->grf_clk); 325 324 if (ret < 0) { 326 - DRM_DEV_ERROR(hdmi->dev, "failed to enable grfclk %d\n", ret); 325 + drm_err(hdmi, "failed to enable grfclk %d\n", ret); 327 326 return; 328 327 } 329 328 330 329 ret = regmap_write(hdmi->regmap, hdmi->chip_data->lcdsel_grf_reg, val); 331 330 if (ret != 0) 332 - DRM_DEV_ERROR(hdmi->dev, "Could not write to GRF: %d\n", ret); 331 + drm_err(hdmi, "Could not write to GRF: %d\n", ret); 333 332 334 333 clk_disable_unprepare(hdmi->grf_clk); 335 - DRM_DEV_DEBUG(hdmi->dev, "vop %s output to hdmi\n", 336 - ret ? "LIT" : "BIG"); 334 + drm_dbg(hdmi, "vop %s output to hdmi\n", ret ? "LIT" : "BIG"); 337 335 } 338 336 339 337 static int ··· 361 361 const struct drm_display_mode *mode) 362 362 { 363 363 struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data; 364 + 365 + dw_hdmi_set_high_tmds_clock_ratio(dw_hdmi, display); 364 366 365 367 return phy_power_on(hdmi->phy); 366 368 } ··· 436 434 HIWORD_UPDATE(RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK, 437 435 RK3328_HDMI_SDAIN_MSK | RK3328_HDMI_SCLIN_MSK | 438 436 RK3328_HDMI_HPD_IOE)); 437 + 438 + dw_hdmi_rk3328_read_hpd(dw_hdmi, data); 439 439 } 440 440 441 441 static const struct dw_hdmi_phy_ops rk3228_hdmi_phy_ops = { ··· 450 446 451 447 static struct rockchip_hdmi_chip_data rk3228_chip_data = { 452 448 .lcdsel_grf_reg = -1, 449 + .max_tmds_clock = 594000, 453 450 }; 454 451 455 452 static const struct dw_hdmi_plat_data rk3228_hdmi_drv_data = { 456 453 .mode_valid = dw_hdmi_rockchip_mode_valid, 457 - .mpll_cfg = rockchip_mpll_cfg, 458 - .cur_ctr = rockchip_cur_ctr, 459 - .phy_config = rockchip_phy_config, 460 454 .phy_data = &rk3228_chip_data, 461 455 .phy_ops = &rk3228_hdmi_phy_ops, 462 456 .phy_name = "inno_dw_hdmi_phy2", ··· 465 463 .lcdsel_grf_reg = RK3288_GRF_SOC_CON6, 466 464 .lcdsel_big = HIWORD_UPDATE(0, RK3288_HDMI_LCDC_SEL), 467 465 .lcdsel_lit = HIWORD_UPDATE(RK3288_HDMI_LCDC_SEL, RK3288_HDMI_LCDC_SEL), 466 + .max_tmds_clock = 340000, 468 467 }; 469 468 470 469 static const struct dw_hdmi_plat_data rk3288_hdmi_drv_data = { ··· 486 483 487 484 static struct rockchip_hdmi_chip_data rk3328_chip_data = { 488 485 .lcdsel_grf_reg = -1, 486 + .max_tmds_clock = 594000, 489 487 }; 490 488 491 489 static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { 492 490 .mode_valid = dw_hdmi_rockchip_mode_valid, 493 - .mpll_cfg = rockchip_mpll_cfg, 494 - .cur_ctr = rockchip_cur_ctr, 495 - .phy_config = rockchip_phy_config, 496 491 .phy_data = &rk3328_chip_data, 497 492 .phy_ops = &rk3328_hdmi_phy_ops, 498 493 .phy_name = "inno_dw_hdmi_phy2", ··· 502 501 .lcdsel_grf_reg = RK3399_GRF_SOC_CON20, 503 502 .lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL), 504 503 .lcdsel_lit = HIWORD_UPDATE(RK3399_HDMI_LCDC_SEL, RK3399_HDMI_LCDC_SEL), 504 + .max_tmds_clock = 340000, 505 505 }; 506 506 507 507 static const struct dw_hdmi_plat_data rk3399_hdmi_drv_data = { ··· 516 514 517 515 static struct rockchip_hdmi_chip_data rk3568_chip_data = { 518 516 .lcdsel_grf_reg = -1, 517 + .max_tmds_clock = 340000, 519 518 }; 520 519 521 520 static const struct dw_hdmi_plat_data rk3568_hdmi_drv_data = { ··· 595 592 ret = rockchip_hdmi_parse_dt(hdmi); 596 593 if (ret) { 597 594 if (ret != -EPROBE_DEFER) 598 - DRM_DEV_ERROR(hdmi->dev, "Unable to parse OF data\n"); 595 + drm_err(hdmi, "Unable to parse OF data\n"); 599 596 return ret; 600 597 } 601 598 ··· 603 600 if (IS_ERR(hdmi->phy)) { 604 601 ret = PTR_ERR(hdmi->phy); 605 602 if (ret != -EPROBE_DEFER) 606 - DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n"); 603 + drm_err(hdmi, "failed to get phy\n"); 607 604 return ret; 608 - } 609 - 610 - ret = regulator_enable(hdmi->avdd_0v9); 611 - if (ret) { 612 - DRM_DEV_ERROR(hdmi->dev, "failed to enable avdd0v9: %d\n", ret); 613 - goto err_avdd_0v9; 614 - } 615 - 616 - ret = regulator_enable(hdmi->avdd_1v8); 617 - if (ret) { 618 - DRM_DEV_ERROR(hdmi->dev, "failed to enable avdd1v8: %d\n", ret); 619 - goto err_avdd_1v8; 620 - } 621 - 622 - ret = clk_prepare_enable(hdmi->ref_clk); 623 - if (ret) { 624 - DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI reference clock: %d\n", 625 - ret); 626 - goto err_clk; 627 605 } 628 606 629 607 if (hdmi->chip_data == &rk3568_chip_data) { ··· 635 651 636 652 err_bind: 637 653 drm_encoder_cleanup(encoder); 638 - clk_disable_unprepare(hdmi->ref_clk); 639 - err_clk: 640 - regulator_disable(hdmi->avdd_1v8); 641 - err_avdd_1v8: 642 - regulator_disable(hdmi->avdd_0v9); 643 - err_avdd_0v9: 654 + 644 655 return ret; 645 656 } 646 657 ··· 646 667 647 668 dw_hdmi_unbind(hdmi->hdmi); 648 669 drm_encoder_cleanup(&hdmi->encoder.encoder); 649 - clk_disable_unprepare(hdmi->ref_clk); 650 - 651 - regulator_disable(hdmi->avdd_1v8); 652 - regulator_disable(hdmi->avdd_0v9); 653 670 } 654 671 655 672 static const struct component_ops dw_hdmi_rockchip_ops = {
+1 -1
drivers/gpu/drm/rockchip/inno_hdmi.c
··· 545 545 return 0; 546 546 } 547 547 548 - static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { 548 + static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = { 549 549 .atomic_check = inno_hdmi_encoder_atomic_check, 550 550 .atomic_enable = inno_hdmi_encoder_enable, 551 551 .atomic_disable = inno_hdmi_encoder_disable,
+2 -1
drivers/gpu/drm/rockchip/rockchip_drm_drv.h
··· 12 12 #include <drm/drm_atomic_helper.h> 13 13 #include <drm/drm_gem.h> 14 14 15 + #include <linux/bits.h> 16 + #include <linux/component.h> 15 17 #include <linux/i2c.h> 16 18 #include <linux/module.h> 17 - #include <linux/component.h> 18 19 19 20 #define ROCKCHIP_MAX_FB_BUFFER 3 20 21 #define ROCKCHIP_MAX_CONNECTOR 2
+6 -2
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
··· 396 396 if (info->is_yuv) 397 397 is_yuv = true; 398 398 399 - if (dst_w > 3840) { 400 - DRM_DEV_ERROR(vop->dev, "Maximum dst width (3840) exceeded\n"); 399 + if (dst_w > 4096) { 400 + DRM_DEV_ERROR(vop->dev, "Maximum dst width (4096) exceeded\n"); 401 401 return; 402 402 } 403 403 ··· 1582 1582 s = to_rockchip_crtc_state(crtc->state); 1583 1583 VOP_AFBC_SET(vop, enable, s->enable_afbc); 1584 1584 vop_cfg_done(vop); 1585 + 1586 + /* Ack the DMA transfer of the previous frame (RK3066). */ 1587 + if (VOP_HAS_REG(vop, common, dma_stop)) 1588 + VOP_REG_SET(vop, common, dma_stop, 0); 1585 1589 1586 1590 spin_unlock(&vop->reg_lock); 1587 1591
+1
drivers/gpu/drm/rockchip/rockchip_drm_vop.h
··· 122 122 struct vop_reg lut_buffer_index; 123 123 struct vop_reg gate_en; 124 124 struct vop_reg mmu_en; 125 + struct vop_reg dma_stop; 125 126 struct vop_reg out_mode; 126 127 struct vop_reg standby; 127 128 };
+2
drivers/gpu/drm/rockchip/rockchip_vop_reg.c
··· 466 466 }; 467 467 468 468 static const struct vop_common rk3066_common = { 469 + .dma_stop = VOP_REG(RK3066_SYS_CTRL0, 0x1, 0), 469 470 .standby = VOP_REG(RK3066_SYS_CTRL0, 0x1, 1), 470 471 .out_mode = VOP_REG(RK3066_DSP_CTRL0, 0xf, 0), 471 472 .cfg_done = VOP_REG(RK3066_REG_CFG_DONE, 0x1, 0), ··· 515 514 .output = &rk3066_output, 516 515 .win = rk3066_vop_win_data, 517 516 .win_size = ARRAY_SIZE(rk3066_vop_win_data), 517 + .feature = VOP_FEATURE_INTERNAL_RGB, 518 518 .max_output = { 1920, 1080 }, 519 519 }; 520 520
+1 -1
drivers/gpu/drm/tilcdc/tilcdc_panel.c
··· 49 49 50 50 if (backlight) { 51 51 backlight->props.power = mode == DRM_MODE_DPMS_ON ? 52 - FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; 52 + BACKLIGHT_POWER_ON : BACKLIGHT_POWER_OFF; 53 53 backlight_update_status(backlight); 54 54 } 55 55
+4 -2
drivers/gpu/drm/vkms/vkms_drv.c
··· 164 164 dev->mode_config.max_height = YRES_MAX; 165 165 dev->mode_config.cursor_width = 512; 166 166 dev->mode_config.cursor_height = 512; 167 - /* FIXME: There's a confusion between bpp and depth between this and 167 + /* 168 + * FIXME: There's a confusion between bpp and depth between this and 168 169 * fbdev helpers. We have to go with 0, meaning "pick the default", 169 - * which ix XRGB8888 in all cases. */ 170 + * which is XRGB8888 in all cases. 171 + */ 170 172 dev->mode_config.preferred_depth = 0; 171 173 dev->mode_config.helper_private = &vkms_mode_config_helpers; 172 174
+1 -2
drivers/gpu/vga/vga_switcheroo.c
··· 926 926 /** 927 927 * vga_switcheroo_process_delayed_switch() - helper for delayed switching 928 928 * 929 - * Process a delayed switch if one is pending. DRM drivers should call this 930 - * from their ->lastclose callback. 929 + * Process a delayed switch if one is pending. 931 930 * 932 931 * Return: 0 on success. -EINVAL if no delayed switch is pending, if the client 933 932 * has unregistered in the meantime or if there are other clients blocking the
-28
include/drm/drm_drv.h
··· 229 229 void (*postclose) (struct drm_device *, struct drm_file *); 230 230 231 231 /** 232 - * @lastclose: 233 - * 234 - * Called when the last &struct drm_file has been closed and there's 235 - * currently no userspace client for the &struct drm_device. 236 - * 237 - * Modern drivers should only use this to force-restore the fbdev 238 - * framebuffer using drm_fb_helper_restore_fbdev_mode_unlocked(). 239 - * Anything else would indicate there's something seriously wrong. 240 - * Modern drivers can also use this to execute delayed power switching 241 - * state changes, e.g. in conjunction with the :ref:`vga_switcheroo` 242 - * infrastructure. 243 - * 244 - * This is called after @postclose hook has been called. 245 - * 246 - * NOTE: 247 - * 248 - * All legacy drivers use this callback to de-initialize the hardware. 249 - * This is purely because of the shadow-attach model, where the DRM 250 - * kernel driver does not really own the hardware. Instead ownershipe is 251 - * handled with the help of userspace through an inheritedly racy dance 252 - * to set/unset the VT into raw mode. 253 - * 254 - * Legacy drivers initialize the hardware in the @firstopen callback, 255 - * which isn't even called for modern drivers. 256 - */ 257 - void (*lastclose) (struct drm_device *); 258 - 259 - /** 260 232 * @unload: 261 233 * 262 234 * Reverse the effects of the driver load callback. Ideally,
-2
include/drm/drm_edid.h
··· 440 440 int hdisplay, int vdisplay); 441 441 442 442 int drm_edid_header_is_valid(const void *edid); 443 - bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, 444 - bool *edid_corrupt); 445 443 bool drm_edid_is_valid(struct edid *edid); 446 444 void drm_edid_get_monitor_name(const struct edid *edid, char *name, 447 445 int buflen);
-6
include/drm/drm_fb_helper.h
··· 271 271 int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper); 272 272 int drm_fb_helper_debug_enter(struct fb_info *info); 273 273 int drm_fb_helper_debug_leave(struct fb_info *info); 274 - 275 274 void drm_fb_helper_lastclose(struct drm_device *dev); 276 - void drm_fb_helper_output_poll_changed(struct drm_device *dev); 277 275 #else 278 276 static inline void drm_fb_helper_prepare(struct drm_device *dev, 279 277 struct drm_fb_helper *helper, ··· 397 399 } 398 400 399 401 static inline void drm_fb_helper_lastclose(struct drm_device *dev) 400 - { 401 - } 402 - 403 - static inline void drm_fb_helper_output_poll_changed(struct drm_device *dev) 404 402 { 405 403 } 406 404 #endif
+2 -1
include/drm/drm_fixed.h
··· 25 25 #ifndef DRM_FIXED_H 26 26 #define DRM_FIXED_H 27 27 28 - #include <linux/kernel.h> 29 28 #include <linux/math64.h> 29 + #include <linux/types.h> 30 + #include <linux/wordpart.h> 30 31 31 32 typedef union dfixed { 32 33 u32 full;
+10
include/drm/drm_mipi_dsi.h
··· 365 365 void mipi_dsi_dcs_set_display_on_multi(struct mipi_dsi_multi_context *ctx); 366 366 void mipi_dsi_dcs_set_tear_on_multi(struct mipi_dsi_multi_context *ctx, 367 367 enum mipi_dsi_dcs_tear_mode mode); 368 + void mipi_dsi_turn_on_peripheral_multi(struct mipi_dsi_multi_context *ctx); 369 + void mipi_dsi_dcs_soft_reset_multi(struct mipi_dsi_multi_context *ctx); 370 + void mipi_dsi_dcs_set_display_brightness_multi(struct mipi_dsi_multi_context *ctx, 371 + u16 brightness); 372 + void mipi_dsi_dcs_set_pixel_format_multi(struct mipi_dsi_multi_context *ctx, 373 + u8 format); 374 + void mipi_dsi_dcs_set_column_address_multi(struct mipi_dsi_multi_context *ctx, 375 + u16 start, u16 end); 376 + void mipi_dsi_dcs_set_page_address_multi(struct mipi_dsi_multi_context *ctx, 377 + u16 start, u16 end); 368 378 369 379 /** 370 380 * mipi_dsi_generic_write_seq - transmit data using a generic write packet
-16
include/drm/drm_mode_config.h
··· 98 98 const struct drm_format_info *(*get_format_info)(const struct drm_mode_fb_cmd2 *mode_cmd); 99 99 100 100 /** 101 - * @output_poll_changed: 102 - * 103 - * Callback used by helpers to inform the driver of output configuration 104 - * changes. 105 - * 106 - * Drivers implementing fbdev emulation use drm_kms_helper_hotplug_event() 107 - * to call this hook to inform the fbdev helper of output changes. 108 - * 109 - * This hook is deprecated, drivers should instead implement fbdev 110 - * support with struct drm_client, which takes care of any necessary 111 - * hotplug event forwarding already without further involvement by 112 - * the driver. 113 - */ 114 - void (*output_poll_changed)(struct drm_device *dev); 115 - 116 - /** 117 101 * @mode_valid: 118 102 * 119 103 * Device specific validation of display modes. Can be used to reject
+6 -15
include/drm/drm_panic.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 or MIT */ 2 + 3 + /* 4 + * Copyright (c) 2024 Intel 5 + * Copyright (c) 2024 Red Hat 6 + */ 7 + 2 8 #ifndef __DRM_PANIC_H__ 3 9 #define __DRM_PANIC_H__ 4 10 ··· 14 8 15 9 #include <drm/drm_device.h> 16 10 #include <drm/drm_fourcc.h> 17 - /* 18 - * Copyright (c) 2024 Intel 19 - */ 20 11 21 12 /** 22 13 * struct drm_scanout_buffer - DRM scanout buffer ··· 148 145 */ 149 146 #define drm_panic_unlock(dev, flags) \ 150 147 raw_spin_unlock_irqrestore(&(dev)->mode_config.panic_lock, flags) 151 - 152 - #ifdef CONFIG_DRM_PANIC 153 - 154 - void drm_panic_register(struct drm_device *dev); 155 - void drm_panic_unregister(struct drm_device *dev); 156 - 157 - #else 158 - 159 - static inline void drm_panic_register(struct drm_device *dev) {} 160 - static inline void drm_panic_unregister(struct drm_device *dev) {} 161 - 162 - #endif 163 148 164 149 #endif /* __DRM_PANIC_H__ */
+2
include/uapi/drm/drm_mode.h
··· 859 859 860 860 /** 861 861 * struct drm_plane_size_hint - Plane size hints 862 + * @width: The width of the plane in pixel 863 + * @height: The height of the plane in pixel 862 864 * 863 865 * The plane SIZE_HINTS property blob contains an 864 866 * array of struct drm_plane_size_hint.