linux/drivers/gpu/drm
Hans de Goede 6b51e7d23a drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller
So far for devices using an external PWM controller (devices using
pwm_setup_backlight()), we have been hardcoding the period-time passed to
pwm_config() to 21333 ns.

I suspect this was done because many VBTs set the PWM frequency to 200
which corresponds to a period-time of 5000000 ns, which greatly exceeds
the PWM_MAX_PERIOD_NS define in the Crystal Cove PMIC PWM driver, which
used to be 21333.

This PWM_MAX_PERIOD_NS define was actually based on a bug in the PWM
driver where its period and duty-cycle times where off by a factor of 256.

Due to this bug the hardcoded CRC_PMIC_PWM_PERIOD_NS value of 21333 would
result in the PWM driver using its divider of 128, which would result in
a PWM output frequency of 6000000 Hz / 256 / 128 = 183 Hz. So actually
pretty close to the default VBT value of 200 Hz.

Now that this bug in the pwm-crc driver is fixed, we can actually use
the VBT defined frequency.

This is important because:

a) With the pwm-crc driver fixed it will now translate the hardcoded
CRC_PMIC_PWM_PERIOD_NS value of 21333 ns / 46 Khz to a PWM output
frequency of 23 KHz (the max it can do).

b) The pwm-lpss driver used on many models has always honored the
21333 ns / 46 Khz request

Some panels do not like such high output frequencies. E.g. on a Terra
Pad 1061 tablet, using the LPSS PWM controller, the backlight would go
from off to max, when changing the sysfs backlight brightness value from
90-100%, anything under aprox. 90% would turn the backlight fully off.

Honoring the VBT specified PWM frequency will also hopefully fix the
various bug reports which we have received about users perceiving the
backlight to flicker after a suspend/resume cycle.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-16-hdegoede@redhat.com
2020-09-06 15:53:08 +02:00
..
amd Merge tag 'amd-drm-fixes-5.9-2020-08-07' of git://people.freedesktop.org/~agd5f/linux into drm-next 2020-08-11 13:08:45 +10:00
arc drm/arc: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:02:03 +02:00
arm drm/atomic-helper: reset vblank on crtc reset 2020-07-02 20:25:51 +02:00
armada drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
aspeed Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
ast drm/ast: Use managed MM initialization 2020-07-20 09:16:23 +02:00
atmel-hlcdc drm/atomic-helper: reset vblank on crtc reset 2020-07-02 20:25:51 +02:00
bochs Linux 5.8 2020-08-11 11:58:31 +10:00
bridge Linux 5.8 2020-08-11 11:58:31 +10:00
etnaviv Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next 2020-07-23 15:28:10 +10:00
exynos Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
fsl-dcu drm/fsl-dcu: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:02:52 +02:00
gma500
hisilicon Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
i2c drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() 2020-06-23 19:53:27 +02:00
i810 drm/i810: switch from 'pci_' to 'dma_' API 2020-07-20 09:34:24 +02:00
i915 drm/i915: panel: Honor the VBT PWM frequency for devs with an external PWM controller 2020-09-06 15:53:08 +02:00
imx drm/imx: error path fixes and cleanups 2020-07-23 15:21:45 +10:00
ingenic drm/ingenic: Silence uninitialized-variable warning 2020-07-19 13:03:15 +02:00
lib
lima Linux 5.8 2020-08-11 11:58:31 +10:00
mcde Linux 5.8 2020-08-11 11:58:31 +10:00
mediatek Mediatek DRM Next for Linux 5.9 2020-07-24 09:41:57 +10:00
meson Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
mga
mgag200 drm/mgag200: Inline mga_crtc_{prepare, commit}() into enable function 2020-07-14 09:14:06 +02:00
msm drm/msm: use kthread_create_worker instead of kthread_run 2020-07-31 06:46:17 -07:00
mxsfb drm/mxsfb: drop unused function parameter 2020-07-20 10:59:10 +02:00
nouveau Linux 5.8 2020-08-11 11:58:31 +10:00
omapdrm * backmerge from drm-fixes at v5.8-rc7 2020-08-11 12:00:30 +10:00
panel Linux 5.8 2020-08-11 11:58:31 +10:00
panfrost drm/panfrost: Use kvfree() to free bo->sgts 2020-06-19 11:00:02 +01:00
pl111 drm: pl111: Absorb the external register header 2020-06-30 00:32:59 +02:00
qxl drm/ttm: make ttm_tt unbind function return void. 2020-07-29 09:43:06 +10:00
r128
radeon drm/ttm: make ttm_tt unbind function return void. 2020-07-29 09:43:06 +10:00
rcar-du Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
rockchip drm: bridge: dw-hdmi: Pass drm_display_info to dw_hdmi_support_scdc() 2020-06-23 19:57:06 +02:00
savage
scheduler Backmerge remote-tracking branch 'drm/drm-next' into drm-misc-next 2020-06-29 12:16:26 +02:00
selftests drm/mst: Add support for QUERY_STREAM_ENCRYPTION_STATUS MST sideband message 2020-09-01 13:02:33 +05:30
shmobile drm/shmobile: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:05:18 +02:00
sis
sti drm/sti: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:05:45 +02:00
stm drm/stm: repair runtime power management 2020-07-08 11:47:01 +02:00
sun4i Linux 5.8 2020-08-11 11:58:31 +10:00
tdfx
tegra drm/tegra: Changes for v5.9-rc1 2020-07-24 09:38:55 +10:00
tidss * backmerge from drm-fixes at v5.8-rc7 2020-08-11 12:00:30 +10:00
tilcdc drm/tilcdc: Use standard drm_atomic_helper_commit 2020-07-14 10:32:33 +02:00
tiny drm/mipi-dbi: Remove ->enabled 2020-06-24 09:17:34 +02:00
ttm drm/ttm: revert "drm/ttm: make TT creation purely optional v3" 2020-08-12 13:26:28 +10:00
tve200 drm/tve200: Set GEM CMA functions with DRM_GEM_CMA_DRIVER_OPS 2020-06-10 09:06:11 +02:00
udl drm/udl: Use GEM vmap/mmap function from SHMEM helpers 2020-06-10 10:17:21 +02:00
v3d
vboxvideo drm/vboxvideo: Replace HTTP links with HTTPS ones 2020-07-16 22:12:50 +02:00
vc4 drm/vc4: crtc: Remove the feed_txp tests 2020-07-07 10:51:58 +02:00
vgem drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset() 2020-07-08 22:00:21 +01:00
via
virtio drm/virtio: Remove open-coded commit-tail function 2020-07-14 10:47:16 +02:00
vkms drm/vkms: change the max cursor width/height 2020-07-12 18:09:13 -04:00
vmwgfx drm/vmwgfx: fix spelling mistake "Cant" -> "Can't" 2020-08-11 03:16:03 +02:00
xen
xlnx drm: xlnx: zynqmp: Use switch - case for link rate downshift 2020-08-01 01:56:10 +00:00
zte drm/zte: remove unneeded semicolon 2020-06-29 09:39:04 +02:00
drm_agpsupport.c
drm_atomic.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_atomic_helper.c drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() 2020-06-23 19:53:27 +02:00
drm_atomic_state_helper.c drm/atomic-helper: reset vblank on crtc reset 2020-07-02 20:25:51 +02:00
drm_atomic_uapi.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_auth.c drm/auth: make drm_{set,drop}master_ioctl symmetrical 2020-06-15 14:49:50 +01:00
drm_blend.c
drm_bridge.c drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() 2020-06-23 19:53:27 +02:00
drm_bridge_connector.c
drm_bufs.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_cache.c
drm_client.c
drm_client_modeset.c
drm_color_mgmt.c
drm_connector.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_context.c
drm_crtc.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_crtc_helper.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_crtc_helper_internal.h drm/probe_helper: Add drm_connector_helper_funcs.mode_valid_ctx 2020-07-13 13:29:20 -04:00
drm_crtc_internal.h
drm_damage_helper.c
drm_debugfs.c drm/debug: Expose connector VRR monitor range via debugfs 2020-06-25 15:47:14 -07:00
drm_debugfs_crc.c
drm_dma.c
drm_dp_aux_dev.c
drm_dp_cec.c
drm_dp_dual_mode_helper.c
drm_dp_helper.c drm/dp: Include the AUX CH name in the debug messages 2020-07-09 21:20:33 +03:00
drm_dp_mst_topology.c drm/mst: Add support for QUERY_STREAM_ENCRYPTION_STATUS MST sideband message 2020-09-01 13:02:33 +05:30
drm_dp_mst_topology_internal.h
drm_drv.c drm: Remove redundant NULL check 2020-07-27 22:06:13 +02:00
drm_dsc.c
drm_dumb_buffers.c
drm_edid.c drm: core: Convert device logging to drm_* functions. 2020-07-20 09:34:24 +02:00
drm_edid_load.c
drm_encoder.c
drm_encoder_slave.c drm: encoder_slave: use new I2C API 2020-06-19 09:20:21 +02:00
drm_fb_cma_helper.c
drm_fb_helper.c Linux 5.8 2020-08-11 11:58:31 +10:00
drm_file.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_flip_work.c
drm_format_helper.c
drm_fourcc.c drm: drm_fourcc: add NV15, Q410, Q401 YUV formats 2020-06-19 13:33:40 +01:00
drm_framebuffer.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_gem.c * backmerge from drm-fixes at v5.8-rc7 2020-08-11 12:00:30 +10:00
drm_gem_cma_helper.c drm: core: Convert device logging to drm_* functions. 2020-07-20 09:34:24 +02:00
drm_gem_framebuffer_helper.c
drm_gem_shmem_helper.c drm/shmem-helper: Only dma-buf imports are private obj 2020-06-16 19:11:51 +02:00
drm_gem_ttm_helper.c
drm_gem_vram_helper.c drm: remove optional dummy function from drivers using TTM 2020-07-21 16:03:28 +02:00
drm_hashtab.c
drm_hdcp.c
drm_internal.h drm/vblank: Add vblank works 2020-07-16 18:16:31 -04:00
drm_ioc32.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_ioctl.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_irq.c drm: use drm_dev_has_vblank more 2020-05-29 12:58:11 +02:00
drm_kms_helper_common.c
drm_lease.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_legacy.h
drm_legacy_misc.c
drm_lock.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_managed.c
drm_memory.c
drm_mipi_dbi.c Linux 5.8 2020-08-11 11:58:31 +10:00
drm_mipi_dsi.c drm: mipi-dsi: Convert logging to drm_* functions. 2020-07-10 20:21:45 +02:00
drm_mm.c drm/mm: cleanup and improve next_hole_*_addr() 2020-06-23 15:46:40 +02:00
drm_mode_config.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_mode_object.c
drm_modes.c drm: Replace HTTP links with HTTPS ones 2020-07-20 11:47:28 +02:00
drm_modeset_helper.c
drm_modeset_lock.c
drm_of.c Linux 5.8 2020-08-11 11:58:31 +10:00
drm_panel.c
drm_panel_orientation_quirks.c drm: Added orientation quirk for ASUS tablet model T103HAF 2020-08-04 11:45:23 +02:00
drm_pci.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_plane.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_plane_helper.c
drm_prime.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_print.c
drm_probe_helper.c Merge tag 'drm-intel-next-2020-07-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-next 2020-07-31 14:42:37 +10:00
drm_property.c
drm_rect.c
drm_scatter.c gpu/drm: remove the powerpc hack in drm_legacy_sg_alloc 2020-06-02 10:59:11 -07:00
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm : Insert blank lines after declarations. 2020-07-02 15:26:00 +02:00
drm_sysfs.c drm/connector: notify userspace on hotplug after register complete 2020-06-03 10:24:23 +02:00
drm_trace.h
drm_trace_points.c
drm_vblank.c drm/vblank: Use spin_(un)lock_irq() in drm_crtc_queue_sequence_ioctl() 2020-07-21 11:08:35 -04:00
drm_vblank_work.c drm/vblank: Add vblank works 2020-07-16 18:16:31 -04:00
drm_vm.c drm-misc-next for v5.9: 2020-06-24 15:45:51 +10:00
drm_vma_manager.c
drm_writeback.c
Kconfig drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem 2020-07-18 02:59:16 +03:00
Makefile Xilinx ZynqMP DisplayPort Subsystem driver 2020-07-23 15:31:38 +10:00