From 4dbf0ad32c24463a447aac33ec9e324b8fc47d8e Mon Sep 17 00:00:00 2001 From: Yafen Date: Thu, 9 Nov 2023 00:13:51 +0800 Subject: [PATCH] RPi: update kernel version to openEuler 5.10.0-166.0.0 --- 0000-raspberrypi-kernel.patch | 826 ++++++++++++++++------------------ raspberrypi-kernel.spec | 7 +- 2 files changed, 402 insertions(+), 431 deletions(-) diff --git a/0000-raspberrypi-kernel.patch b/0000-raspberrypi-kernel.patch index 894a285..5fdc5a0 100644 --- a/0000-raspberrypi-kernel.patch +++ b/0000-raspberrypi-kernel.patch @@ -1,7 +1,7 @@ -From 3554c6c6478932af731e011d2286763b849c55d4 Mon Sep 17 00:00:00 2001 -From: junyu mu -Date: Tue, 24 Oct 2023 21:34:38 +0800 -Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) +From 5c4416167c93fdb5e03519f0154e07f6606f9ae6 Mon Sep 17 00:00:00 2001 +From: Yafen +Date: Wed, 8 Nov 2023 19:48:46 +0800 +Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-166.0.0) --- .../admin-guide/media/bcm2835-isp.rst | 127 + @@ -407,7 +407,7 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) arch/arm64/crypto/aes-cipher-glue.c | 10 + arch/arm64/crypto/aes-glue.c | 4 +- arch/arm64/crypto/aes-neonbs-glue.c | 5 - - arch/arm64/kernel/armv8_deprecated.c | 5 + + arch/arm64/kernel/armv8_deprecated.c | 51 + arch/arm64/kernel/cpuinfo.c | 25 + drivers/bluetooth/btusb.c | 8 + drivers/bluetooth/hci_h5.c | 3 +- @@ -459,7 +459,6 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) drivers/gpu/drm/drm_color_mgmt.c | 114 +- drivers/gpu/drm/drm_connector.c | 70 + drivers/gpu/drm/drm_edid.c | 15 +- - drivers/gpu/drm/drm_fourcc.c | 3 + drivers/gpu/drm/drm_framebuffer.c | 16 +- drivers/gpu/drm/drm_panel.c | 15 +- drivers/gpu/drm/drm_probe_helper.c | 111 +- @@ -516,13 +515,13 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_crtc.c | 276 +- drivers/gpu/drm/vc4/vc4_debugfs.c | 7 +- - drivers/gpu/drm/vc4/vc4_dpi.c | 113 +- + drivers/gpu/drm/vc4/vc4_dpi.c | 58 +- drivers/gpu/drm/vc4/vc4_drv.c | 66 +- drivers/gpu/drm/vc4/vc4_drv.h | 95 +- drivers/gpu/drm/vc4/vc4_dsi.c | 73 +- drivers/gpu/drm/vc4/vc4_firmware_kms.c | 1992 +++++ drivers/gpu/drm/vc4/vc4_gem.c | 3 +- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2296 +++++- + drivers/gpu/drm/vc4/vc4_hdmi.c | 2286 +++++- drivers/gpu/drm/vc4/vc4_hdmi.h | 148 +- drivers/gpu/drm/vc4/vc4_hdmi_phy.c | 45 +- drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 35 +- @@ -532,7 +531,7 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) drivers/gpu/drm/vc4/vc4_plane.c | 312 +- drivers/gpu/drm/vc4/vc4_regs.h | 90 +- drivers/gpu/drm/vc4/vc4_txp.c | 24 +- - drivers/gpu/drm/vc4/vc4_vec.c | 399 +- + drivers/gpu/drm/vc4/vc4_vec.c | 393 +- drivers/gpu/drm/vc4/vc_image_types.h | 175 + drivers/gpu/drm/virtio/virtgpu_display.c | 8 +- drivers/gpu/drm/vkms/vkms_crtc.c | 24 +- @@ -797,7 +796,7 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/rpi_backlight.c | 119 + - drivers/video/fbdev/Kconfig | 26 + + drivers/video/fbdev/Kconfig | 27 + drivers/video/fbdev/Makefile | 2 + drivers/video/fbdev/bcm2708_fb.c | 1274 +++ drivers/video/fbdev/core/cfbimgblt.c | 152 +- @@ -826,7 +825,7 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) include/linux/mfd/rpisense/framebuffer.h | 32 + include/linux/mfd/rpisense/joystick.h | 35 + include/linux/microchipphy.h | 8 + - include/linux/mmc/card.h | 1 + + include/linux/mmc/card.h | 2 + include/linux/platform_data/dma-bcm2708.h | 143 + include/linux/usb.h | 2 + include/linux/usb/hcd.h | 7 + @@ -901,7 +900,7 @@ Subject: [PATCH] apply RPi patch of 5.10.110(openEuler 5.10.0-161.0.0) sound/soc/soc-core.c | 14 +- sound/usb/quirks-table.h | 9 + sound/usb/quirks.c | 6 + - 897 files changed, 175465 insertions(+), 4753 deletions(-) + 896 files changed, 175469 insertions(+), 4723 deletions(-) create mode 100644 Documentation/admin-guide/media/bcm2835-isp.rst create mode 100644 Documentation/devicetree/bindings/clock/raspberrypi,firmware-clocks.yaml create mode 100644 Documentation/devicetree/bindings/hwmon/rpi-poe-fan.txt @@ -3293,7 +3292,7 @@ index 000000000000..f8d32547195b +zte ZTE Corp. +zyxel ZyXEL Communications Corp. diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml -index 2735be1a8470..e8a98ec7632d 100644 +index b327801d18b3..093607ce65b5 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -159,6 +159,8 @@ patternProperties: @@ -4156,7 +4155,7 @@ index 4a05a105a9e6..ba3a5b599362 100644 pixfmt-nv16m pixfmt-nv24 diff --git a/MAINTAINERS b/MAINTAINERS -index 50b205a570f0..c6b9a8530598 100644 +index a7815fd1072f..19b33766778f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3427,6 +3427,29 @@ N: bcm113* @@ -4204,7 +4203,7 @@ index 50b205a570f0..c6b9a8530598 100644 DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS M: Hans de Goede S: Maintained -@@ -16464,6 +16495,23 @@ S: Maintained +@@ -16454,6 +16485,23 @@ S: Maintained T: git git://linuxtv.org/media_tree.git F: drivers/media/i2c/imx355.c @@ -4229,10 +4228,10 @@ index 50b205a570f0..c6b9a8530598 100644 M: Maxim Levitsky M: Alex Dubov diff --git a/Makefile b/Makefile -index 6ece128aa360..51b04d69183d 100644 +index 46ca8c6c05fc..f5fec38c4ef9 100644 --- a/Makefile +++ b/Makefile -@@ -1385,6 +1385,9 @@ ifneq ($(dtstree),) +@@ -1394,6 +1394,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ @@ -45980,25 +45979,67 @@ index fb507d569922..cc52829d426a 100644 asmlinkage void aesbs_ecb_encrypt(u8 out[], u8 const in[], u8 const rk[], diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c -index ab955c249f37..bdc8e8ab1d81 100644 +index 637e57a4868e..c217a8cf8310 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c -@@ -183,10 +183,15 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops) - - switch (ops->status) { - case INSN_DEPRECATED: +@@ -57,6 +57,57 @@ struct insn_emulation { + */ + struct ctl_table sysctl[2]; + }; ++static void __init register_insn_emulation(struct insn_emulation_ops *ops) ++{ ++ unsigned long flags; ++ struct insn_emulation *insn; ++ ++ insn = kzalloc(sizeof(*insn), GFP_KERNEL); ++ if (!insn) ++ return; ++ ++ insn->ops = ops; ++ insn->min = INSN_UNDEF; ++ ++ switch (ops->status) { ++ case INSN_DEPRECATED: +#if 0 - insn->current_mode = INSN_EMULATE; - /* Disable the HW mode if it was turned on at early boot time */ - run_all_cpu_set_hw_mode(insn, false); ++ insn->current_mode = INSN_EMULATE; ++ /* Disable the HW mode if it was turned on at early boot time */ ++ run_all_cpu_set_hw_mode(insn, false); +#else + insn->current_mode = INSN_HW; + run_all_cpu_set_hw_mode(insn, true); - insn->max = INSN_HW; ++ insn->max = INSN_HW; +#endif - break; - case INSN_OBSOLETE: - insn->current_mode = INSN_UNDEF; ++ break; ++ case INSN_OBSOLETE: ++ insn->current_mode = INSN_UNDEF; ++ insn->max = INSN_EMULATE; ++ break; ++ } ++ ++ raw_spin_lock_irqsave(&insn_emulation_lock, flags); ++ list_add(&insn->node, &insn_emulation); ++ nr_insn_emulated++; ++ raw_spin_unlock_irqrestore(&insn_emulation_lock, flags); ++ ++ /* Register any handlers if required */ ++ update_insn_emulation_mode(insn, INSN_UNDEF); ++} ++ ++static int emulation_proc_handler(struct ctl_table *table, int write, ++ void *buffer, size_t *lenp, ++ loff_t *ppos) ++{ ++ int ret = 0; ++ struct insn_emulation *insn; ++ enum insn_emulation_mode prev_mode; ++ ++ mutex_lock(&insn_emulation_mutex); ++ insn = container_of(table->data, struct insn_emulation, current_mode); ++ prev_mode = insn->current_mode; ++ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + + #define ARM_OPCODE_CONDTEST_FAIL 0 + #define ARM_OPCODE_CONDTEST_PASS 1 diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 0cd3453a6f41..bd3a9d0c7093 100644 --- a/arch/arm64/kernel/cpuinfo.c @@ -46050,10 +46091,10 @@ index 0cd3453a6f41..bd3a9d0c7093 100644 } diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c -index 3d905fda9b29..060f74279838 100644 +index 2695ece47eb0..6ecd12dfeb80 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -451,6 +451,14 @@ static const struct usb_device_id blacklist_table[] = { +@@ -455,6 +455,14 @@ static const struct usb_device_id blacklist_table[] = { { USB_DEVICE(0x0bda, 0xb009), .driver_info = BTUSB_REALTEK }, { USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK }, @@ -46083,7 +46124,7 @@ index 7f70a677b92b..ae95ed54a118 100644 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig -index 6fa56a473995..6389eb91e04b 100644 +index 677e16195d32..a26b49af28dd 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig @@ -5,6 +5,8 @@ @@ -46096,10 +46137,10 @@ index 6fa56a473995..6389eb91e04b 100644 config TTY_PRINTK diff --git a/drivers/char/Makefile b/drivers/char/Makefile -index 71d76fd62692..3ad819383e9d 100644 +index e2b4fc88154d..a2dcb492dc82 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile -@@ -47,4 +47,5 @@ obj-$(CONFIG_PS3_FLASH) += ps3flash.o +@@ -46,4 +46,5 @@ obj-$(CONFIG_PS3_FLASH) += ps3flash.o obj-$(CONFIG_XILLYBUS) += xillybus/ obj-$(CONFIG_POWERNV_OP_PANEL) += powernv-op-panel.o obj-$(CONFIG_ADI) += adi.o @@ -47850,7 +47891,7 @@ index 01583faf9893..2a92ea658096 100644 ret = devm_hwrng_register(dev, &priv->rng); if (ret) { diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig -index c715d4681a0b..32f8921307bd 100644 +index 4ae49eae4586..fbe74f5898bc 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -86,6 +86,12 @@ config COMMON_CLK_HI655X @@ -48978,7 +49019,7 @@ index 000000000000..9e2634465823 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:clk-hifiberry-dacpro"); diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c -index b355d3d40f63..2feb27ca78aa 100644 +index 3575afe16a57..5b40de004512 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -77,12 +77,14 @@ struct clk_core { @@ -49009,7 +49050,7 @@ index b355d3d40f63..2feb27ca78aa 100644 /*** runtime pm ***/ static int clk_pm_runtime_get(struct clk_core *core) { -@@ -1325,6 +1333,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core, +@@ -1336,6 +1344,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core, if (!core) return 0; @@ -49018,7 +49059,7 @@ index b355d3d40f63..2feb27ca78aa 100644 /* * At this point, core protection will be disabled if * - if the provider is not protected at all -@@ -1430,10 +1440,14 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) +@@ -1441,10 +1451,14 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate) { int ret; struct clk_rate_request req; @@ -49033,7 +49074,7 @@ index b355d3d40f63..2feb27ca78aa 100644 ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) return 0; -@@ -1454,6 +1468,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); +@@ -1465,6 +1479,7 @@ EXPORT_SYMBOL_GPL(clk_hw_round_rate); long clk_round_rate(struct clk *clk, unsigned long rate) { struct clk_rate_request req; @@ -49041,7 +49082,7 @@ index b355d3d40f63..2feb27ca78aa 100644 int ret; if (!clk) -@@ -1467,6 +1482,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate) +@@ -1478,6 +1493,9 @@ long clk_round_rate(struct clk *clk, unsigned long rate) clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate); req.rate = rate; @@ -49051,7 +49092,7 @@ index b355d3d40f63..2feb27ca78aa 100644 ret = clk_core_round_rate_nolock(clk->core, &req); if (clk->exclusive_count) -@@ -1934,6 +1952,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -1945,6 +1963,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, unsigned long new_rate; unsigned long min_rate; unsigned long max_rate; @@ -49059,7 +49100,7 @@ index b355d3d40f63..2feb27ca78aa 100644 int p_index = 0; long ret; -@@ -1948,6 +1967,9 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, +@@ -1959,6 +1978,9 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core, clk_core_get_boundaries(core, &min_rate, &max_rate); @@ -49069,7 +49110,7 @@ index b355d3d40f63..2feb27ca78aa 100644 /* find the closest rate and parent clk/rate */ if (clk_core_can_round(core)) { struct clk_rate_request req; -@@ -2152,6 +2174,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2163,6 +2185,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, { int ret, cnt; struct clk_rate_request req; @@ -49077,7 +49118,7 @@ index b355d3d40f63..2feb27ca78aa 100644 lockdep_assert_held(&prepare_lock); -@@ -2166,6 +2189,9 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, +@@ -2177,6 +2200,9 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core, clk_core_get_boundaries(core, &req.min_rate, &req.max_rate); req.rate = req_rate; @@ -49087,7 +49128,7 @@ index b355d3d40f63..2feb27ca78aa 100644 ret = clk_core_round_rate_nolock(core, &req); /* restore the protection */ -@@ -2259,6 +2285,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) +@@ -2270,6 +2296,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) ret = clk_core_set_rate_nolock(clk->core, rate); @@ -49097,7 +49138,7 @@ index b355d3d40f63..2feb27ca78aa 100644 if (clk->exclusive_count) clk_core_rate_protect(clk->core); -@@ -2424,6 +2453,103 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) +@@ -2435,6 +2464,103 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_set_max_rate); @@ -49201,7 +49242,7 @@ index b355d3d40f63..2feb27ca78aa 100644 /** * clk_get_parent - return the parent of a clk * @clk: the clk whose parent gets returned -@@ -3874,6 +4000,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) +@@ -3885,6 +4011,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) goto fail_parents; INIT_HLIST_HEAD(&core->clks); @@ -50654,7 +50695,7 @@ index 9eef49da47e0..fbb5ec576e0e 100644 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index c9401840422a..f6bd6d10716b 100644 +index 73857e169df6..c44d7d92b975 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -193,6 +193,12 @@ config GPIO_BCM_XGS_IPROC @@ -52351,12 +52392,12 @@ index 3e01a3ac652d..f7f3c294c085 100644 "%s: tried to flag a GPIO set as output for IRQ\n", __func__); diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig -index f6dcb60be551..f74579a3f08f 100644 +index 8c01d5193101..1bf7a1794ccc 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig -@@ -397,6 +397,8 @@ source "drivers/gpu/drm/tidss/Kconfig" +@@ -399,6 +399,8 @@ source "drivers/gpu/drm/xlnx/Kconfig" - source "drivers/gpu/drm/xlnx/Kconfig" + source "drivers/gpu/drm/phytium/Kconfig" +source "drivers/gpu/drm/gud/Kconfig" + @@ -52364,20 +52405,19 @@ index f6dcb60be551..f74579a3f08f 100644 menuconfig DRM_LEGACY diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile -index e806bda8650a..a6adea6c7028 100644 +index 495448f93d86..e58a5371852e 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile -@@ -125,4 +125,5 @@ obj-$(CONFIG_DRM_ASPEED_GFX) += aspeed/ - obj-$(CONFIG_DRM_MCDE) += mcde/ - obj-$(CONFIG_DRM_TIDSS) += tidss/ +@@ -127,3 +127,4 @@ obj-$(CONFIG_DRM_TIDSS) += tidss/ obj-y += xlnx/ -+obj-y += gud/ obj-$(CONFIG_DRM_INSPUR) += inspur/ + obj-$(CONFIG_DRM_PHYTIUM) += phytium/ ++obj-y += gud/ diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -index fbe15f4b75fd..898501cb7804 100644 +index dbdf0e210522..844d647979aa 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c -@@ -5025,7 +5025,6 @@ static void dm_disable_vblank(struct drm_crtc *crtc) +@@ -5027,7 +5027,6 @@ static void dm_disable_vblank(struct drm_crtc *crtc) static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .reset = dm_crtc_reset_state, .destroy = amdgpu_dm_crtc_destroy, @@ -52385,7 +52425,7 @@ index fbe15f4b75fd..898501cb7804 100644 .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .atomic_duplicate_state = dm_crtc_duplicate_state, -@@ -5509,25 +5508,6 @@ static int fill_hdr_info_packet(const struct drm_connector_state *state, +@@ -5511,25 +5510,6 @@ static int fill_hdr_info_packet(const struct drm_connector_state *state, return 0; } @@ -52411,7 +52451,7 @@ index fbe15f4b75fd..898501cb7804 100644 static int amdgpu_dm_connector_atomic_check(struct drm_connector *conn, struct drm_atomic_state *state) -@@ -5543,7 +5523,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, +@@ -5545,7 +5525,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, if (!crtc) return 0; @@ -52420,7 +52460,7 @@ index fbe15f4b75fd..898501cb7804 100644 struct dc_info_packet hdr_infopacket; ret = fill_hdr_info_packet(new_con_state, &hdr_infopacket); -@@ -5638,17 +5618,19 @@ static void dm_update_crtc_active_planes(struct drm_crtc *crtc, +@@ -5640,17 +5620,19 @@ static void dm_update_crtc_active_planes(struct drm_crtc *crtc, } static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, @@ -52444,7 +52484,7 @@ index fbe15f4b75fd..898501cb7804 100644 WARN_ON(1); return ret; } -@@ -5659,8 +5641,8 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, +@@ -5661,8 +5643,8 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc *crtc, * planes are disabled, which is not supported by the hardware. And there is legacy * userspace which stops using the HW cursor altogether in response to the resulting EINVAL. */ @@ -52455,7 +52495,7 @@ index fbe15f4b75fd..898501cb7804 100644 return -EINVAL; /* In some use cases, like reset, no stream is attached */ -@@ -6562,9 +6544,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, +@@ -6564,9 +6546,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) { @@ -52466,7 +52506,7 @@ index fbe15f4b75fd..898501cb7804 100644 if (!aconnector->mst_port) drm_connector_attach_vrr_capable_property(&aconnector->base); -@@ -7814,7 +7794,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) +@@ -7816,7 +7796,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_old_crtc_state->abm_level; hdr_changed = @@ -52476,7 +52516,7 @@ index fbe15f4b75fd..898501cb7804 100644 if (!scaling_changed && !abm_changed && !hdr_changed) continue; diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c -index d617e98afb76..935e351e8ec4 100644 +index 767b3d31c720..be4890a689fa 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -24,6 +24,7 @@ @@ -52487,7 +52527,7 @@ index d617e98afb76..935e351e8ec4 100644 #include #include #include -@@ -264,8 +265,10 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) +@@ -283,8 +284,10 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) static struct drm_encoder * dm_mst_atomic_best_encoder(struct drm_connector *connector, @@ -53435,7 +53475,7 @@ index 9c3bbe2c3e6f..4b2df9162d66 100644 * drm_connector_set_vrr_capable_property - sets the variable refresh rate * capable property for a connector diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c -index 4334e466b4e0..8ba175445a6b 100644 +index 39eb39e78d7a..e74d823f203a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -4960,8 +4960,15 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, @@ -53454,7 +53494,7 @@ index 4334e466b4e0..8ba175445a6b 100644 DRM_DEBUG("%s: HDMI sink does YCRCB444 in deep color.\n", connector->name); } -@@ -5705,13 +5712,13 @@ static const u32 hdmi_colorimetry_val[] = { +@@ -5708,13 +5715,13 @@ static const u32 hdmi_colorimetry_val[] = { #undef ACE /** @@ -53471,7 +53511,7 @@ index 4334e466b4e0..8ba175445a6b 100644 const struct drm_connector_state *conn_state) { u32 colorimetry_val; -@@ -5730,7 +5737,7 @@ drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame, +@@ -5733,7 +5740,7 @@ drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame, frame->extended_colorimetry = (colorimetry_val >> 2) & EXTENDED_COLORIMETRY_MASK; } @@ -53480,20 +53520,6 @@ index 4334e466b4e0..8ba175445a6b 100644 /** * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe -diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c -index 92152c06b75b..d25b05618f67 100644 ---- a/drivers/gpu/drm/drm_fourcc.c -+++ b/drivers/gpu/drm/drm_fourcc.c -@@ -289,6 +289,9 @@ const struct drm_format_info *__drm_format_info(u32 format) - { .format = DRM_FORMAT_P030, .depth = 0, .num_planes = 2, - .char_per_block = { 4, 8, 0 }, .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, - .hsub = 2, .vsub = 2, .is_yuv = true}, -+ { .format = DRM_FORMAT_P030, .depth = 0, .num_planes = 2, -+ .char_per_block = { 4, 4, 0 }, .block_w = { 3, 0, 0 }, .block_h = { 1, 0, 0 }, -+ .hsub = 2, .vsub = 2, .is_yuv = true}, - }; - - unsigned int i; diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 2f5b0c2bb0fe..89ced6af9c5c 100644 --- a/drivers/gpu/drm/drm_framebuffer.c @@ -56191,10 +56217,10 @@ index 406e96785c76..d1f8c7f3d197 100644 + drm_connector_attach_colorspace_property(connector); } diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c -index 45c2556d6395..32f440223bd1 100644 +index d46011f7a838..e47f94c03629 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c -@@ -16562,7 +16562,6 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, +@@ -16563,7 +16563,6 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, } #define INTEL_CRTC_FUNCS \ @@ -56466,7 +56492,7 @@ index 5ec9770e401e..4b73ed6a0e98 100644 static const struct drm_plane_helper_funcs ingenic_drm_plane_helper_funcs = { diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c -index dfd5ed15a7f4..3d698cd10626 100644 +index e83b1c406b96..ec63151d37d6 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -517,7 +517,7 @@ void mtk_drm_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane, @@ -56587,7 +56613,7 @@ index 2854272dc2d9..d70616da8ce2 100644 struct meson_crtc *meson_crtc = to_meson_crtc(crtc); struct meson_drm *priv = meson_crtc->priv; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c -index 9bc4a1cd9ac6..e660489d99e6 100644 +index 5afb3c544653..ad92cf8166e9 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -11,6 +11,7 @@ @@ -56616,7 +56642,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 { struct dpu_crtc *dpu_crtc; struct drm_device *dev; -@@ -706,10 +707,12 @@ static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc) +@@ -709,10 +710,12 @@ static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc) } static void dpu_crtc_disable(struct drm_crtc *crtc, @@ -56630,7 +56656,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 struct drm_encoder *encoder; unsigned long flags; bool release_bandwidth = false; -@@ -770,7 +773,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, +@@ -773,7 +776,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, } static void dpu_crtc_enable(struct drm_crtc *crtc, @@ -56639,7 +56665,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 { struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc); struct drm_encoder *encoder; -@@ -812,10 +815,12 @@ struct plane_state { +@@ -815,10 +818,12 @@ struct plane_state { }; static int dpu_crtc_atomic_check(struct drm_crtc *crtc, @@ -56654,7 +56680,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 struct plane_state *pstates; const struct drm_plane_state *pstate; -@@ -834,32 +839,33 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, +@@ -837,32 +842,33 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, if (!pstates) return -ENOMEM; @@ -56663,7 +56689,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 DPU_DEBUG("crtc%d -> enable %d, active %d, skip atomic_check\n", - crtc->base.id, state->enable, state->active); + crtc->base.id, crtc_state->enable, -+ crtc_state->active); ++ crtc_state->active); goto end; } @@ -56695,7 +56721,7 @@ index 9bc4a1cd9ac6..e660489d99e6 100644 struct drm_rect dst, clip = crtc_rect; if (IS_ERR_OR_NULL(pstate)) { -@@ -965,7 +971,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, +@@ -968,7 +974,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, atomic_inc(&_dpu_crtc_get_kms(crtc)->bandwidth_ref); @@ -56753,7 +56779,7 @@ index a0253297bc76..34e3186e236d 100644 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); struct drm_device *dev = crtc->dev; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c -index ff4f207cbdea..ee30ec6ad84d 100644 +index 60e7371cd0e0..52e20159919d 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -7,6 +7,7 @@ @@ -56897,7 +56923,7 @@ index b535621f4f78..d2f747d3695a 100644 struct mxsfb_drm_private *mxsfb = to_mxsfb_drm_private(crtc->dev); struct drm_device *drm = mxsfb->drm; diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c -index c2d34c91e840..afd2736f040d 100644 +index 0ac120225b4d..f9af6b5602fa 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -32,6 +32,7 @@ @@ -56908,7 +56934,7 @@ index c2d34c91e840..afd2736f040d 100644 #include #include #include -@@ -1161,8 +1162,10 @@ nv50_msto_new(struct drm_device *dev, struct nv50_head *head, int id) +@@ -1193,8 +1194,10 @@ nv50_msto_new(struct drm_device *dev, struct nv50_head *head, int id) static struct drm_encoder * nv50_mstc_atomic_best_encoder(struct drm_connector *connector, @@ -59100,7 +59126,7 @@ index 4fbbf980a299..a95d88fea8d2 100644 list_for_each_entry(entry, &vc4->debugfs_list, link) { drm_debugfs_create_files(&entry->info, 1, diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c -index a90f2545baee..0d4fb6818d51 100644 +index 9c8a71d7426a..f401cb8481e8 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -131,7 +131,7 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) @@ -59112,47 +59138,10 @@ index a90f2545baee..0d4fb6818d51 100644 int ret; /* Look up the connector attached to DPI so we can get the -@@ -148,49 +148,88 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) - } - drm_connector_list_iter_end(&conn_iter); - -- if (connector && connector->display_info.num_bus_formats) { -- u32 bus_format = connector->display_info.bus_formats[0]; -- -- switch (bus_format) { -- case MEDIA_BUS_FMT_RGB888_1X24: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -- DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_BGR888_1X24: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -- DPI_FORMAT); -- dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, DPI_ORDER); -- break; -- case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -- DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_RGB666_1X18: -+ if (connector) { -+ if (connector->display_info.num_bus_formats) { -+ u32 bus_format = connector->display_info.bus_formats[0]; -+ -+ switch (bus_format) { -+ case MEDIA_BUS_FMT_RGB888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ break; -+ case MEDIA_BUS_FMT_BGR888_1X24: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, -+ DPI_FORMAT); -+ dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, -+ DPI_ORDER); -+ break; -+ case MEDIA_BUS_FMT_RGB666_1X24_CPADHI: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, -+ DPI_FORMAT); -+ break; +@@ -167,19 +167,40 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, + DPI_FORMAT); + break; + case MEDIA_BUS_FMT_BGR666_1X24_CPADHI: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_2, + DPI_FORMAT); @@ -59163,46 +59152,40 @@ index a90f2545baee..0d4fb6818d51 100644 + DRM_ERROR("Unknown media bus format %d\n", + bus_format); + fallthrough; -+ case MEDIA_BUS_FMT_RGB666_1X18: -+ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, -+ DPI_FORMAT); -+ break; + case MEDIA_BUS_FMT_RGB666_1X18: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, + DPI_FORMAT); + break; + case MEDIA_BUS_FMT_BGR666_1X18: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, + DPI_FORMAT); + dpi_c |= VC4_SET_FIELD(DPI_ORDER_BGR, + DPI_ORDER); + break; -+ case MEDIA_BUS_FMT_RGB565_1X16: + case MEDIA_BUS_FMT_RGB565_1X16: +- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_1, + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -+ DPI_FORMAT); -+ break; + DPI_FORMAT); + break; +- default: +- DRM_ERROR("Unknown media bus format %d\n", +- bus_format); + case MEDIA_BUS_FMT_RGB565_1X24_CPADHI: + dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_2, + DPI_FORMAT); -+ break; -+ } + break; + } + } else { + /* Default to 18bit if no connector found. */ - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, - DPI_FORMAT); -- break; -- case MEDIA_BUS_FMT_RGB565_1X16: -- dpi_c |= VC4_SET_FIELD(DPI_FORMAT_16BIT_565_RGB_3, -- DPI_FORMAT); -- break; -- default: -- DRM_ERROR("Unknown media bus format %d\n", bus_format); -- break; ++ dpi_c |= VC4_SET_FIELD(DPI_FORMAT_18BIT_666_RGB_1, ++ DPI_FORMAT); + } -+ -+ if (connector->display_info.bus_flags & -+ DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) -+ dpi_c |= DPI_PIXEL_CLK_INVERT; -+ -+ if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW) -+ dpi_c |= DPI_OUTPUT_ENABLE_INVERT; + + if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) +@@ -188,19 +209,26 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder) + if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW) + dpi_c |= DPI_OUTPUT_ENABLE_INVERT; } else { - /* Default to 24bit if no connector found. */ - dpi_c |= VC4_SET_FIELD(DPI_FORMAT_24BIT_888_RGB, DPI_FORMAT); @@ -59219,16 +59202,16 @@ index a90f2545baee..0d4fb6818d51 100644 + dpi_c |= DPI_OUTPUT_ENABLE_INVERT; + } else { + dpi_c |= DPI_OUTPUT_ENABLE_MODE; -+ -+ if (mode->flags & DRM_MODE_FLAG_NHSYNC) -+ dpi_c |= DPI_HSYNC_INVERT; -+ else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) -+ dpi_c |= DPI_HSYNC_DISABLE; - if (mode->flags & DRM_MODE_FLAG_NVSYNC) - dpi_c |= DPI_VSYNC_INVERT; - else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) - dpi_c |= DPI_VSYNC_DISABLE; ++ if (mode->flags & DRM_MODE_FLAG_NHSYNC) ++ dpi_c |= DPI_HSYNC_INVERT; ++ else if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) ++ dpi_c |= DPI_HSYNC_DISABLE; ++ + if (mode->flags & DRM_MODE_FLAG_NVSYNC) + dpi_c |= DPI_VSYNC_INVERT; + else if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) @@ -61761,7 +61744,7 @@ index b641252939d8..445d3bab89e0 100644 /* Scheduled when any job has been completed, this walks the list of diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index 539ebf85fd7c..b3064293dbb1 100644 +index 7e8620838de9..3957fc0391fa 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -35,25 +35,39 @@ @@ -62950,21 +62933,9 @@ index 539ebf85fd7c..b3064293dbb1 100644 bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; bool interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; -@@ -565,16 +1259,21 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, - VC4_SET_FIELD(mode->crtc_vsync_start - mode->crtc_vdisplay, - VC5_HDMI_VERTA_VFP) | - VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL)); -- u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep), -- VC5_HDMI_VERTB_VSPO) | -- VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end, -+ u32 vertb = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | -+ VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end + -+ interlaced, - VC4_HDMI_VERTB_VBP)); - u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) | +@@ -574,8 +1268,13 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, VC4_SET_FIELD(mode->crtc_vtotal - -- mode->crtc_vsync_end - interlaced, -+ mode->crtc_vsync_end, + mode->crtc_vsync_end, VC4_HDMI_VERTB_VBP)); + unsigned long flags; + unsigned char gcp; @@ -62977,7 +62948,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 HDMI_WRITE(HDMI_HORZA, (vsync_pos ? VC5_HDMI_HORZA_VPOS : 0) | (hsync_pos ? VC5_HDMI_HORZA_HPOS : 0) | -@@ -598,14 +1297,66 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, +@@ -599,14 +1298,66 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); @@ -63044,7 +63015,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 drift = HDMI_READ(HDMI_FIFO_CTL); drift &= VC4_HDMI_FIFO_VALID_WRITE_MASK; -@@ -613,133 +1364,164 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) +@@ -614,133 +1365,164 @@ static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) drift & ~VC4_HDMI_FIFO_CTL_RECENTER); HDMI_WRITE(HDMI_FIFO_CTL, drift | VC4_HDMI_FIFO_CTL_RECENTER); @@ -63267,7 +63238,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 VC4_HD_VID_CTL_UNDERFLOW_ENABLE | VC4_HD_VID_CTL_FRAME_COUNTER_RESET | (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | -@@ -753,6 +1535,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) +@@ -754,6 +1536,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) HDMI_READ(HDMI_SCHEDULER_CONTROL) | VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -63276,7 +63247,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 ret = wait_for(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE, 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -765,6 +1549,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) +@@ -766,6 +1550,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) HDMI_READ(HDMI_SCHEDULER_CONTROL) & ~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI); @@ -63285,7 +63256,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 ret = wait_for(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE), 1000); WARN_ONCE(ret, "Timeout waiting for " -@@ -772,6 +1558,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) +@@ -773,6 +1559,8 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) } if (vc4_encoder->hdmi_monitor) { @@ -63294,7 +63265,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) & VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE)); HDMI_WRITE(HDMI_SCHEDULER_CONTROL, -@@ -781,14 +1569,245 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) +@@ -782,14 +1570,245 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE); @@ -63541,7 +63512,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 } #define WIFI_2_4GHz_CH1_MIN_FREQ 2400000000ULL -@@ -798,10 +1817,15 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, +@@ -799,10 +1818,15 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state) { @@ -63557,7 +63528,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 if (vc4_hdmi->variant->unsupported_odd_h_timings && !(mode->flags & DRM_MODE_FLAG_DBLCLK) && -@@ -823,11 +1847,14 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, +@@ -824,11 +1848,14 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, pixel_rate = mode->clock * 1000; } @@ -63576,7 +63547,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -844,19 +1871,48 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, +@@ -845,19 +1872,48 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; @@ -63631,7 +63602,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 static u32 vc4_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) { int i; -@@ -881,33 +1937,49 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) +@@ -882,33 +1938,49 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask) return channel_map; } @@ -63688,7 +63659,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 n = 128 * samplerate / 1000; tmp = (u64)(mode->clock * 1000) * n; do_div(tmp, 128 * samplerate); -@@ -933,36 +2005,48 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) +@@ -934,36 +2006,48 @@ static inline struct vc4_hdmi *dai_to_hdmi(struct snd_soc_dai *dai) return snd_soc_card_get_drvdata(card); } @@ -63759,7 +63730,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -970,60 +2054,133 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) +@@ -971,60 +2055,133 @@ static void vc4_hdmi_audio_reset(struct vc4_hdmi *vc4_hdmi) { struct drm_encoder *encoder = &vc4_hdmi->encoder.base.base; struct device *dev = &vc4_hdmi->pdev->dev; @@ -63919,7 +63890,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 /* The B frame identifier should match the value used by alsa-lib (8) */ audio_packet_config = -@@ -1031,7 +2188,7 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, +@@ -1032,7 +2189,7 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, VC4_HDMI_AUDIO_PACKET_ZERO_DATA_ON_INACTIVE_CHANNELS | VC4_SET_FIELD(0x8, VC4_HDMI_AUDIO_PACKET_B_FRAME_IDENTIFIER); @@ -63928,7 +63899,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 audio_packet_config |= VC4_SET_FIELD(channel_mask, VC4_HDMI_AUDIO_PACKET_CEA_MASK); -@@ -1044,101 +2201,26 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, +@@ -1045,101 +2202,26 @@ static int vc4_hdmi_audio_hw_params(struct snd_pcm_substream *substream, HDMI_WRITE(HDMI_MAI_CONFIG, VC4_HDMI_MAI_CONFIG_BIT_REVERSE | @@ -63941,7 +63912,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 - vc4_hdmi_set_n_cts(vc4_hdmi); - - vc4_hdmi_set_audio_infoframe(encoder); - +- - return 0; -} - @@ -63953,12 +63924,10 @@ index 539ebf85fd7c..b3064293dbb1 100644 - switch (cmd) { - case SNDRV_PCM_TRIGGER_START: - vc4_hdmi->audio.streaming = true; -+ vc4_hdmi_set_n_cts(vc4_hdmi, sample_rate); - +- - if (vc4_hdmi->variant->phy_rng_enable) - vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); -+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); - +- - HDMI_WRITE(HDMI_MAI_CTL, - VC4_SET_FIELD(vc4_hdmi->audio.channels, - VC4_HD_MAI_CTL_CHNUM) | @@ -63974,9 +63943,10 @@ index 539ebf85fd7c..b3064293dbb1 100644 - - if (vc4_hdmi->variant->phy_rng_disable) - vc4_hdmi->variant->phy_rng_disable(vc4_hdmi); -- + - vc4_hdmi->audio.streaming = false; -- ++ vc4_hdmi_set_n_cts(vc4_hdmi, sample_rate); + - break; - default: - break; @@ -63992,7 +63962,8 @@ index 539ebf85fd7c..b3064293dbb1 100644 - - return snd_soc_card_get_drvdata(card); -} -- ++ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); + -static int vc4_hdmi_audio_eld_ctl_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ @@ -64037,11 +64008,10 @@ index 539ebf85fd7c..b3064293dbb1 100644 static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = { SND_SOC_DAPM_OUTPUT("TX"), }; -@@ -1148,39 +2230,15 @@ static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { - }; +@@ -1150,38 +2232,14 @@ static const struct snd_soc_dapm_route vc4_hdmi_audio_routes[] = { static const struct snd_soc_component_driver vc4_hdmi_audio_component_drv = { -- .name = "vc4-hdmi-codec-dai-component", + .name = "vc4-hdmi-codec-dai-component", - .controls = vc4_hdmi_audio_controls, - .num_controls = ARRAY_SIZE(vc4_hdmi_audio_controls), - .dapm_widgets = vc4_hdmi_audio_widgets, @@ -64074,7 +64044,6 @@ index 539ebf85fd7c..b3064293dbb1 100644 - SNDRV_PCM_RATE_192000, - .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, - }, -+ .name = "vc4-hdmi-codec-dai-component", + .dapm_widgets = vc4_hdmi_audio_widgets, + .num_dapm_widgets = ARRAY_SIZE(vc4_hdmi_audio_widgets), + .dapm_routes = vc4_hdmi_audio_routes, @@ -64086,7 +64055,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 }; static const struct snd_soc_component_driver vc4_hdmi_audio_cpu_dai_comp = { -@@ -1209,7 +2267,6 @@ static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { +@@ -1210,7 +2268,6 @@ static struct snd_soc_dai_driver vc4_hdmi_audio_cpu_dai_drv = { SNDRV_PCM_RATE_192000, .formats = SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE, }, @@ -64094,7 +64063,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 }; static const struct snd_dmaengine_pcm_config pcm_conf = { -@@ -1217,6 +2274,33 @@ static const struct snd_dmaengine_pcm_config pcm_conf = { +@@ -1218,6 +2275,33 @@ static const struct snd_dmaengine_pcm_config pcm_conf = { .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, }; @@ -64128,7 +64097,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) { const struct vc4_hdmi_register *mai_data = -@@ -1224,11 +2308,14 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1225,11 +2309,14 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) struct snd_soc_dai_link *dai_link = &vc4_hdmi->audio.link; struct snd_soc_card *card = &vc4_hdmi->audio.card; struct device *dev = &vc4_hdmi->pdev->dev; @@ -64145,7 +64114,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 dev_warn(dev, "'dmas' DT property is missing or empty, no HDMI audio\n"); return 0; -@@ -1270,12 +2357,13 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1271,12 +2358,13 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) return ret; } @@ -64165,7 +64134,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 } dai_link->cpus = &vc4_hdmi->audio.cpu; -@@ -1288,9 +2376,9 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1289,9 +2377,9 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) dai_link->name = "MAI"; dai_link->stream_name = "MAI PCM"; @@ -64177,7 +64146,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 dai_link->platforms->name = dev_name(dev); card->dai_link = dai_link; -@@ -1310,22 +2398,83 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) +@@ -1311,22 +2399,83 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) snd_soc_card_set_drvdata(card, vc4_hdmi); ret = devm_snd_soc_register_card(dev, card); if (ret) @@ -64268,7 +64237,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 cec_transmit_done(vc4_hdmi->cec_adap, CEC_TX_STATUS_OK, 0, 0, 0, 0); } else { -@@ -1339,12 +2488,27 @@ static irqreturn_t vc4_cec_irq_handler_thread(int irq, void *priv) +@@ -1340,12 +2489,27 @@ static irqreturn_t vc4_cec_irq_handler_thread(int irq, void *priv) return IRQ_HANDLED; } @@ -64296,7 +64265,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 msg->len = 1 + ((cntrl1 & VC4_HDMI_CEC_REC_WRD_CNT_MASK) >> VC4_HDMI_CEC_REC_WRD_CNT_SHIFT); -@@ -1363,83 +2527,208 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) +@@ -1364,83 +2528,208 @@ static void vc4_cec_read_msg(struct vc4_hdmi *vc4_hdmi, u32 cntrl1) } } @@ -64419,9 +64388,9 @@ index 539ebf85fd7c..b3064293dbb1 100644 + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); + if (ret) + return ret; - -+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + ++ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); + + val = HDMI_READ(HDMI_CEC_CNTRL_5); val &= ~(VC4_HDMI_CEC_TX_SW_RESET | VC4_HDMI_CEC_RX_SW_RESET | VC4_HDMI_CEC_CNT_TO_4700_US_MASK | @@ -64546,7 +64515,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -1448,14 +2737,28 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -1449,14 +2738,28 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, { struct vc4_hdmi *vc4_hdmi = cec_get_drvdata(adap); struct drm_device *dev = vc4_hdmi->connector.dev; @@ -64575,7 +64544,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 for (i = 0; i < msg->len; i += 4) HDMI_WRITE(HDMI_CEC_TX_DATA_1 + (i >> 2), (msg->msg[i]) | -@@ -1471,6 +2774,9 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, +@@ -1472,6 +2775,9 @@ static int vc4_hdmi_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, val |= VC4_HDMI_CEC_START_XMIT_BEGIN; HDMI_WRITE(HDMI_CEC_CNTRL_1, val); @@ -64585,24 +64554,24 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -1484,11 +2790,14 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1485,11 +2791,14 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) { struct cec_connector_info conn_info; struct platform_device *pdev = vc4_hdmi->pdev; - u32 value; + struct device *dev = &pdev->dev; -+ unsigned long flags; ++ unsigned long flags; int ret; - if (!vc4_hdmi->variant->cec_available) + if (!of_find_property(dev->of_node, "interrupts", NULL)) { -+ dev_warn(dev, "'interrupts' DT property is missing, no CEC\n"); ++ dev_warn(dev, "'interrupts' DT property is missing, no CEC\n"); return 0; -+ } ++ } vc4_hdmi->cec_adap = cec_allocate_adapter(&vc4_hdmi_cec_adap_ops, vc4_hdmi, -@@ -1502,28 +2811,49 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1503,28 +2812,49 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector); cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info); @@ -64668,7 +64637,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 err_delete_cec_adap: cec_delete_adapter(vc4_hdmi->cec_adap); -@@ -1532,8 +2862,40 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1533,8 +2863,40 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) { @@ -64709,7 +64678,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 #else static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) { -@@ -1542,6 +2904,10 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) +@@ -1543,6 +2905,10 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {}; @@ -64720,7 +64689,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 #endif static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi, -@@ -1616,6 +2982,7 @@ static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -1617,6 +2983,7 @@ static int vc4_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return PTR_ERR(vc4_hdmi->hsm_clock); } vc4_hdmi->audio_clock = vc4_hdmi->hsm_clock; @@ -64728,7 +64697,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -1625,6 +2992,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -1626,6 +2993,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; struct resource *res; @@ -64736,7 +64705,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); if (!res) -@@ -1709,12 +3077,50 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) +@@ -1710,12 +3078,50 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) return PTR_ERR(vc4_hdmi->audio_clock); } @@ -64787,7 +64756,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } -@@ -1737,6 +3143,15 @@ static int vc4_hdmi_runtime_resume(struct device *dev) +@@ -1738,6 +3144,15 @@ static int vc4_hdmi_runtime_resume(struct device *dev) if (ret) return ret; @@ -64803,7 +64772,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 return 0; } #endif -@@ -1755,6 +3170,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1756,6 +3171,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL); if (!vc4_hdmi) return -ENOMEM; @@ -64813,7 +64782,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 dev_set_drvdata(dev, vc4_hdmi); encoder = &vc4_hdmi->encoder.base.base; -@@ -1767,6 +3185,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1768,6 +3186,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->pdev = pdev; vc4_hdmi->variant = variant; @@ -64829,7 +64798,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 ret = variant->init_resources(vc4_hdmi); if (ret) return ret; -@@ -1804,6 +3231,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1805,6 +3232,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi->disable_wifi_frequencies = of_property_read_bool(dev->of_node, "wifi-2.4ghz-coexistence"); @@ -64844,7 +64813,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 /* * If we boot without any cable connected to the HDMI connector, * the firmware will skip the HSM initialization and leave it -@@ -1812,13 +3247,29 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1813,13 +3248,29 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) * * Let's put a sensible default at runtime_resume so that we * don't end up in this situation. @@ -64877,7 +64846,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && -@@ -1828,8 +3279,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1829,8 +3280,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) clk_prepare_enable(vc4_hdmi->pixel_bvb_clock); } @@ -64886,7 +64855,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs); -@@ -1837,10 +3286,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1838,10 +3287,14 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) if (ret) goto err_destroy_encoder; @@ -64902,7 +64871,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 ret = vc4_hdmi_audio_init(vc4_hdmi); if (ret) goto err_free_cec; -@@ -1849,14 +3302,19 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) +@@ -1850,14 +3303,19 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) vc4_hdmi_debugfs_regs, vc4_hdmi); @@ -64922,7 +64891,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 pm_runtime_disable(dev); err_put_ddc: put_device(&vc4_hdmi->ddc->dev); -@@ -1894,6 +3352,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, +@@ -1895,6 +3353,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master, kfree(vc4_hdmi->hd_regset.regs); vc4_hdmi_cec_exit(vc4_hdmi); @@ -64930,7 +64899,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 vc4_hdmi_connector_destroy(&vc4_hdmi->connector); drm_encoder_cleanup(&vc4_hdmi->encoder.base.base); -@@ -1923,7 +3382,6 @@ static const struct vc4_hdmi_variant bcm2835_variant = { +@@ -1924,7 +3383,6 @@ static const struct vc4_hdmi_variant bcm2835_variant = { .debugfs_name = "hdmi_regs", .card_name = "vc4-hdmi", .max_pixel_clock = 162000000, @@ -64938,7 +64907,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 .registers = vc4_hdmi_fields, .num_registers = ARRAY_SIZE(vc4_hdmi_fields), -@@ -1935,14 +3393,16 @@ static const struct vc4_hdmi_variant bcm2835_variant = { +@@ -1936,14 +3394,16 @@ static const struct vc4_hdmi_variant bcm2835_variant = { .phy_disable = vc4_hdmi_phy_disable, .phy_rng_enable = vc4_hdmi_phy_rng_enable, .phy_rng_disable = vc4_hdmi_phy_rng_disable, @@ -64956,7 +64925,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 .registers = vc5_hdmi_hdmi0_fields, .num_registers = ARRAY_SIZE(vc5_hdmi_hdmi0_fields), .phy_lane_mapping = { -@@ -1952,6 +3412,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { +@@ -1953,6 +3413,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { PHY_LANE_CK, }, .unsupported_odd_h_timings = true, @@ -64964,7 +64933,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 .init_resources = vc5_hdmi_init_resources, .csc_setup = vc5_hdmi_csc_setup, -@@ -1961,7 +3422,10 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { +@@ -1962,7 +3423,10 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .phy_disable = vc5_hdmi_phy_disable, .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable = vc5_hdmi_phy_rng_disable, @@ -64975,7 +64944,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -1978,6 +3442,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { +@@ -1979,6 +3443,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { PHY_LANE_2, }, .unsupported_odd_h_timings = true, @@ -64983,7 +64952,7 @@ index 539ebf85fd7c..b3064293dbb1 100644 .init_resources = vc5_hdmi_init_resources, .csc_setup = vc5_hdmi_csc_setup, -@@ -1987,7 +3452,10 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { +@@ -1988,7 +3453,10 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .phy_disable = vc5_hdmi_phy_disable, .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable = vc5_hdmi_phy_rng_disable, @@ -65528,7 +65497,7 @@ index 6c0dfbbe1a7e..0198de96c7b2 100644 dev_warn(&hdmi->pdev->dev, "Invalid register ID %u\n", reg); diff --git a/drivers/gpu/drm/vc4/vc4_hvs.c b/drivers/gpu/drm/vc4/vc4_hvs.c -index 95fa6fc052a7..fc4de2f6e922 100644 +index f8f2fc3d15f7..61c622e6d9ea 100644 --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c @@ -95,6 +95,123 @@ static int vc4_hvs_debugfs_underrun(struct seq_file *m, void *data) @@ -65944,7 +65913,7 @@ index 95fa6fc052a7..fc4de2f6e922 100644 } HVS_WRITE(SCALER_DISPBKGNDX(vc4_state->assigned_channel), dispbkgndx); } -@@ -687,6 +953,11 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) +@@ -698,6 +964,11 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) vc4_debugfs_add_regset32(drm, "hvs_regs", &hvs->regset); vc4_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, NULL); @@ -66308,7 +66277,7 @@ index f4aa75efd16b..18abc06335c1 100644 static int vc4_perfmon_idr_del(int id, void *elem, void *data) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c -index 4df222a83049..766280a844f4 100644 +index 2e03c16c60bb..07c1bf57cc39 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -33,6 +33,7 @@ static const struct hvs_format { @@ -66319,7 +66288,7 @@ index 4df222a83049..766280a844f4 100644 } hvs_formats[] = { { .drm = DRM_FORMAT_XRGB8888, -@@ -128,6 +129,40 @@ static const struct hvs_format { +@@ -130,6 +131,40 @@ static const struct hvs_format { .hvs = HVS_PIXEL_FORMAT_YCBCR_YUV422_2PLANE, .pixel_order = HVS_PIXEL_ORDER_XYCRCB, }, @@ -66360,7 +66329,7 @@ index 4df222a83049..766280a844f4 100644 }; static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) -@@ -353,15 +388,14 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) +@@ -355,15 +390,14 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) for (i = 0; i < num_planes; i++) vc4_state->offsets[i] = bo->paddr + fb->offsets[i]; @@ -66381,7 +66350,7 @@ index 4df222a83049..766280a844f4 100644 vc4_state->crtc_x = state->dst.x1; vc4_state->crtc_y = state->dst.y1; -@@ -528,9 +562,6 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) +@@ -530,9 +564,6 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) struct vc4_dev *vc4; vc4 = to_vc4_dev(state->plane->dev); @@ -66391,7 +66360,7 @@ index 4df222a83049..766280a844f4 100644 vc4_state = to_vc4_plane_state(state); crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc); -@@ -617,6 +648,95 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state) +@@ -619,6 +650,95 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state) return 0; } @@ -66487,7 +66456,7 @@ index 4df222a83049..766280a844f4 100644 /* Writes out a full display list for an active plane to the plane's * private dlist state. */ -@@ -763,47 +883,90 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -765,47 +885,90 @@ static int vc4_plane_mode_set(struct drm_plane *plane, case DRM_FORMAT_MOD_BROADCOM_SAND128: case DRM_FORMAT_MOD_BROADCOM_SAND256: { uint32_t param = fourcc_mod_broadcom_param(fb->modifier); @@ -66605,7 +66574,7 @@ index 4df222a83049..766280a844f4 100644 } pitch0 = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT); -@@ -856,13 +1019,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -858,13 +1021,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Position Word 2: Source Image Size, Alpha */ vc4_state->pos2_offset = vc4_state->dlist_count; vc4_dlist_write(vc4_state, @@ -66620,7 +66589,7 @@ index 4df222a83049..766280a844f4 100644 VC4_SET_FIELD(vc4_state->src_w[0], SCALER_POS2_WIDTH) | VC4_SET_FIELD(vc4_state->src_h[0], -@@ -907,14 +1065,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -909,14 +1067,9 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_dlist_write(vc4_state, VC4_SET_FIELD(state->alpha >> 4, SCALER5_CTL2_ALPHA) | @@ -66637,7 +66606,7 @@ index 4df222a83049..766280a844f4 100644 ); /* Position Word 1: Scaled Image Dimensions. */ -@@ -956,7 +1109,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -958,7 +1111,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Pitch word 1/2 */ for (i = 1; i < num_planes; i++) { @@ -66647,7 +66616,7 @@ index 4df222a83049..766280a844f4 100644 vc4_dlist_write(vc4_state, VC4_SET_FIELD(fb->pitches[i], SCALER_SRC_PITCH)); -@@ -967,9 +1121,20 @@ static int vc4_plane_mode_set(struct drm_plane *plane, +@@ -969,9 +1123,20 @@ static int vc4_plane_mode_set(struct drm_plane *plane, /* Colorspace conversion words */ if (vc4_state->is_yuv) { @@ -66671,7 +66640,7 @@ index 4df222a83049..766280a844f4 100644 } vc4_state->lbm_offset = 0; -@@ -1142,7 +1307,6 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, +@@ -1144,7 +1309,6 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, plane->state->src_y = state->src_y; plane->state->src_w = state->src_w; plane->state->src_h = state->src_h; @@ -66679,7 +66648,7 @@ index 4df222a83049..766280a844f4 100644 plane->state->alpha = state->alpha; plane->state->pixel_blend_mode = state->pixel_blend_mode; plane->state->rotation = state->rotation; -@@ -1279,11 +1443,6 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = { +@@ -1281,11 +1445,6 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = { .atomic_async_update = vc4_plane_atomic_async_update, }; @@ -66691,7 +66660,7 @@ index 4df222a83049..766280a844f4 100644 static bool vc4_format_mod_supported(struct drm_plane *plane, uint32_t format, uint64_t modifier) -@@ -1316,6 +1475,13 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, +@@ -1318,6 +1477,13 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, default: return false; } @@ -66705,7 +66674,7 @@ index 4df222a83049..766280a844f4 100644 case DRM_FORMAT_RGBX1010102: case DRM_FORMAT_BGRX1010102: case DRM_FORMAT_RGBA1010102: -@@ -1334,7 +1500,7 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, +@@ -1336,7 +1502,7 @@ static bool vc4_format_mod_supported(struct drm_plane *plane, static const struct drm_plane_funcs vc4_plane_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, @@ -66714,7 +66683,7 @@ index 4df222a83049..766280a844f4 100644 .set_property = NULL, .reset = vc4_plane_reset, .atomic_duplicate_state = vc4_plane_duplicate_state, -@@ -1348,8 +1514,11 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1350,8 +1516,11 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, struct drm_plane *plane = NULL; struct vc4_plane *vc4_plane; u32 formats[ARRAY_SIZE(hvs_formats)]; @@ -66726,7 +66695,7 @@ index 4df222a83049..766280a844f4 100644 static const uint64_t modifiers[] = { DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED, DRM_FORMAT_MOD_BROADCOM_SAND128, -@@ -1364,13 +1533,17 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1366,13 +1535,17 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, if (!vc4_plane) return ERR_PTR(-ENOMEM); @@ -66747,7 +66716,7 @@ index 4df222a83049..766280a844f4 100644 modifiers, type, NULL); if (ret) return ERR_PTR(ret); -@@ -1378,12 +1551,25 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, +@@ -1380,12 +1553,25 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, drm_plane_helper_add(plane, &vc4_plane_helper_funcs); drm_plane_create_alpha_property(plane); @@ -66774,10 +66743,10 @@ index 4df222a83049..766280a844f4 100644 } diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index be2c32a519b3..f40dd93f2cdd 100644 +index a324ef88ceaf..7c4741070fe8 100644 --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -491,6 +491,28 @@ +@@ -497,6 +497,28 @@ #define SCALER_DLIST_START 0x00002000 #define SCALER_DLIST_SIZE 0x00004000 @@ -66806,7 +66775,7 @@ index be2c32a519b3..f40dd93f2cdd 100644 #define SCALER5_DLIST_START 0x00004000 # define VC4_HDMI_SW_RESET_FORMAT_DETECT BIT(1) -@@ -516,6 +538,36 @@ +@@ -522,6 +544,36 @@ # define VC4_HDMI_AUDIO_PACKET_CEA_MASK_MASK VC4_MASK(7, 0) # define VC4_HDMI_AUDIO_PACKET_CEA_MASK_SHIFT 0 @@ -66843,7 +66812,7 @@ index be2c32a519b3..f40dd93f2cdd 100644 # define VC4_HDMI_RAM_PACKET_ENABLE BIT(16) /* When set, the CTS_PERIOD counts based on MAI bus sync pulse instead -@@ -744,8 +796,27 @@ +@@ -750,8 +802,27 @@ # define VC4_HD_CSC_CTL_RGB2YCC BIT(1) # define VC4_HD_CSC_CTL_ENABLE BIT(0) @@ -66871,7 +66840,7 @@ index be2c32a519b3..f40dd93f2cdd 100644 /* HVS display list information. */ #define HVS_BOOTLOADER_DLIST_END 32 -@@ -945,7 +1016,10 @@ enum hvs_pixel_format { +@@ -951,7 +1022,10 @@ enum hvs_pixel_format { #define SCALER_CSC0_COEF_CR_OFS_SHIFT 0 #define SCALER_CSC0_ITR_R_601_5 0x00f00000 #define SCALER_CSC0_ITR_R_709_3 0x00f00000 @@ -66882,7 +66851,7 @@ index be2c32a519b3..f40dd93f2cdd 100644 /* S2.8 contribution of Cb to Green */ #define SCALER_CSC1_COEF_CB_GRN_MASK VC4_MASK(31, 22) -@@ -960,8 +1034,11 @@ enum hvs_pixel_format { +@@ -966,8 +1040,11 @@ enum hvs_pixel_format { #define SCALER_CSC1_COEF_CR_BLU_MASK VC4_MASK(1, 0) #define SCALER_CSC1_COEF_CR_BLU_SHIFT 0 #define SCALER_CSC1_ITR_R_601_5 0xe73304a8 @@ -66896,7 +66865,7 @@ index be2c32a519b3..f40dd93f2cdd 100644 /* S2.8 contribution of Cb to Red */ #define SCALER_CSC2_COEF_CB_RED_MASK VC4_MASK(29, 20) -@@ -972,9 +1049,12 @@ enum hvs_pixel_format { +@@ -978,9 +1055,12 @@ enum hvs_pixel_format { /* S2.8 contribution of Cb to Blue */ #define SCALER_CSC2_COEF_CB_BLU_MASK VC4_MASK(19, 10) #define SCALER_CSC2_COEF_CB_BLU_SHIFT 10 @@ -67005,7 +66974,7 @@ index f8fa09dfea5d..82beb8c159f2 100644 txp->pdev = pdev; diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c -index c6bd168a5898..179f6edbecf3 100644 +index c6bd168a5898..255e5c6c48e0 100644 --- a/drivers/gpu/drm/vc4/vc4_vec.c +++ b/drivers/gpu/drm/vc4/vc4_vec.c @@ -45,6 +45,7 @@ @@ -67137,14 +67106,11 @@ index c6bd168a5898..179f6edbecf3 100644 - -static const struct drm_display_mode ntsc_mode = { - DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 13500, -- 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0, -- 480, 480 + 7, 480 + 7 + 6, 525, 0, -- DRM_MODE_FLAG_INTERLACE) +static const struct drm_display_mode drm_mode_480i = { + DRM_MODE("720x480i", DRM_MODE_TYPE_DRIVER, 13500, -+ 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0, -+ 480, 480 + 7, 480 + 7 + 6, 525, 0, -+ DRM_MODE_FLAG_INTERLACE) + 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0, + 480, 480 + 7, 480 + 7 + 6, 525, 0, + DRM_MODE_FLAG_INTERLACE) }; -static void vc4_vec_pal_mode_set(struct vc4_vec *vec) @@ -67163,13 +67129,13 @@ index c6bd168a5898..179f6edbecf3 100644 -} +static const struct drm_display_mode drm_mode_240p = { + DRM_MODE("720x240", DRM_MODE_TYPE_DRIVER, 13500, -+ 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0, -+ 240, 240 + 3, 240 + 3 + 3, 262, 0, 0) ++ 720, 720 + 14, 720 + 14 + 64, 720 + 14 + 64 + 60, 0, ++ 240, 240 + 3, 240 + 3 + 3, 262, 0, 0) +}; -static const struct drm_display_mode pal_mode = { - DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 13500, -+static const struct drm_display_mode pal_mode_576i = { ++static const struct drm_display_mode drm_mode_576i = { + DRM_MODE("720x576i", DRM_MODE_TYPE_DRIVER, 13500, 720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0, 576, 576 + 4, 576 + 4 + 6, 625, 0, @@ -67178,8 +67144,8 @@ index c6bd168a5898..179f6edbecf3 100644 +static const struct drm_display_mode drm_mode_288p = { + DRM_MODE("720x288", DRM_MODE_TYPE_DRIVER, 13500, -+ 720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0, -+ 288, 288 + 2, 288 + 2 + 3, 312, 0, 0) ++ 720, 720 + 20, 720 + 20 + 64, 720 + 20 + 64 + 60, 0, ++ 288, 288 + 2, 288 + 2 + 3, 312, 0, 0) +}; + static const struct vc4_vec_tv_mode vc4_vec_tv_modes[] = { @@ -67194,7 +67160,7 @@ index c6bd168a5898..179f6edbecf3 100644 [VC4_VEC_TV_MODE_NTSC_J] = { - .mode = &ntsc_mode, - .mode_set = vc4_vec_ntsc_j_mode_set, -+ .interlaced_mode = &drm_mode_288p, ++ .interlaced_mode = &drm_mode_480i, + .progressive_mode = &drm_mode_240p, + .config0 = VEC_CONFIG0_NTSC_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS, @@ -67210,25 +67176,25 @@ index c6bd168a5898..179f6edbecf3 100644 [VC4_VEC_TV_MODE_PAL] = { - .mode = &pal_mode, - .mode_set = vc4_vec_pal_mode_set, -+ .interlaced_mode = &pal_mode_576i, -+ .progressive_mode = &drm_mode_288p, -+ .config0 = VEC_CONFIG0_PAL_BDGHI_STD, -+ .config1 = VEC_CONFIG1_C_CVBS_CVBS, ++ .interlaced_mode = &drm_mode_576i, ++ .progressive_mode = &drm_mode_288p, ++ .config0 = VEC_CONFIG0_PAL_BDGHI_STD, ++ .config1 = VEC_CONFIG1_C_CVBS_CVBS, }, [VC4_VEC_TV_MODE_PAL_M] = { - .mode = &pal_mode, - .mode_set = vc4_vec_pal_m_mode_set, -+ .interlaced_mode = &pal_mode_576i, ++ .interlaced_mode = &drm_mode_480i, + .progressive_mode = &drm_mode_240p, + .config0 = VEC_CONFIG0_PAL_M_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS, -+ }, ++ }, + [VC4_VEC_TV_MODE_PAL_N] = { -+ .interlaced_mode = &pal_mode_576i, ++ .interlaced_mode = &drm_mode_576i, + .progressive_mode = &drm_mode_288p, + .config0 = VEC_CONFIG0_PAL_N_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS, -+ }, ++ }, + [VC4_VEC_TV_MODE_PAL60] = { + /* PAL-M with chroma frequency of regular PAL */ + .interlaced_mode = &drm_mode_480i, @@ -67236,9 +67202,9 @@ index c6bd168a5898..179f6edbecf3 100644 + .config0 = VEC_CONFIG0_PAL_M_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS | VEC_CONFIG1_CUSTOM_FREQ, + .custom_freq = 0x2a098acb, -+ }, ++ }, + [VC4_VEC_TV_MODE_SECAM] = { -+ .interlaced_mode = &pal_mode_576i, ++ .interlaced_mode = &drm_mode_576i, + .progressive_mode = &drm_mode_288p, + .config0 = VEC_CONFIG0_SECAM_STD, + .config1 = VEC_CONFIG1_C_CVBS_CVBS, @@ -67247,41 +67213,41 @@ index c6bd168a5898..179f6edbecf3 100644 }; +static const char * const tv_mode_names[] = { -+ [VC4_VEC_TV_MODE_NTSC] = "NTSC", -+ [VC4_VEC_TV_MODE_NTSC_J] = "NTSC-J", -+ [VC4_VEC_TV_MODE_NTSC_443] = "NTSC-443", -+ [VC4_VEC_TV_MODE_PAL] = "PAL", -+ [VC4_VEC_TV_MODE_PAL_M] = "PAL-M", -+ [VC4_VEC_TV_MODE_PAL_N] = "PAL-N", -+ [VC4_VEC_TV_MODE_PAL60] = "PAL60", -+ [VC4_VEC_TV_MODE_SECAM] = "SECAM", ++ [VC4_VEC_TV_MODE_NTSC] = "NTSC", ++ [VC4_VEC_TV_MODE_NTSC_J] = "NTSC-J", ++ [VC4_VEC_TV_MODE_NTSC_443] = "NTSC-443", ++ [VC4_VEC_TV_MODE_PAL] = "PAL", ++ [VC4_VEC_TV_MODE_PAL_M] = "PAL-M", ++ [VC4_VEC_TV_MODE_PAL_N] = "PAL-N", ++ [VC4_VEC_TV_MODE_PAL60] = "PAL60", ++ [VC4_VEC_TV_MODE_SECAM] = "SECAM", +}; + +enum vc4_vec_tv_mode_id +vc4_vec_get_default_mode(struct drm_connector *connector) +{ -+ int i; ++ int i; + -+ if (vc4_vec_tv_norm) { -+ for (i = 0; i < ARRAY_SIZE(tv_mode_names); i++) -+ if (strcmp(vc4_vec_tv_norm, tv_mode_names[i])) -+ return (enum vc4_vec_tv_mode_id) i; -+ } else if (connector->cmdline_mode.specified && -+ ((connector->cmdline_mode.refresh_specified && -+ (connector->cmdline_mode.refresh == 25 || -+ connector->cmdline_mode.refresh == 50)) || -+ (!connector->cmdline_mode.refresh_specified && -+ (connector->cmdline_mode.yres == 288 || -+ connector->cmdline_mode.yres == 576)))) { -+ /* -+ * no explicitly specified TV norm; use PAL if a mode -+ * looks like PAL has been specified on the command l -+ */ -+ return VC4_VEC_TV_MODE_PAL; -+ } ++ if (vc4_vec_tv_norm) { ++ for (i = 0; i < ARRAY_SIZE(tv_mode_names); i++) ++ if (strcmp(vc4_vec_tv_norm, tv_mode_names[i]) == 0) ++ return (enum vc4_vec_tv_mode_id) i; ++ } else if (connector->cmdline_mode.specified && ++ ((connector->cmdline_mode.refresh_specified && ++ (connector->cmdline_mode.refresh == 25 || ++ connector->cmdline_mode.refresh == 50)) || ++ (!connector->cmdline_mode.refresh_specified && ++ (connector->cmdline_mode.yres == 288 || ++ connector->cmdline_mode.yres == 576)))) { ++ /* ++ * no explicitly specified TV norm; use PAL if a mode that ++ * looks like PAL has been specified on the command line ++ */ ++ return VC4_VEC_TV_MODE_PAL; ++ } + -+ /* in all other cases, default to NTSC */ -+ return VC4_VEC_TV_MODE_NTSC; ++ /* in all other cases, default to NTSC */ ++ return VC4_VEC_TV_MODE_NTSC; +} + static enum drm_connector_status @@ -70671,7 +70637,7 @@ index 4498d14d3429..4103690a71df 100644 mutex_unlock(&state->mutex); diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c -index 4771d0ef2c46..7f0fdd6fd7bc 100644 +index b975636d9440..f2664fc97047 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -55,7 +55,7 @@ @@ -70683,7 +70649,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 /*Frame Length Line*/ #define IMX219_FLL_MIN 0x08a6 -@@ -118,6 +118,16 @@ +@@ -124,6 +124,16 @@ #define IMX219_PIXEL_ARRAY_WIDTH 3280U #define IMX219_PIXEL_ARRAY_HEIGHT 2464U @@ -70700,7 +70666,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 struct imx219_reg { u16 address; u8 val; -@@ -536,7 +546,7 @@ static const struct imx219_mode supported_modes[] = { +@@ -444,7 +454,7 @@ static const struct imx219_mode supported_modes[] = { struct imx219 { struct v4l2_subdev sd; @@ -70709,7 +70675,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 struct v4l2_mbus_framefmt fmt; -@@ -671,7 +681,7 @@ static void imx219_set_default_format(struct imx219 *imx219) +@@ -579,7 +589,7 @@ static void imx219_set_default_format(struct imx219 *imx219) fmt = &imx219->fmt; fmt->code = MEDIA_BUS_FMT_SRGGB10_1X10; @@ -70718,7 +70684,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, fmt->colorspace, -@@ -685,18 +695,26 @@ static void imx219_set_default_format(struct imx219 *imx219) +@@ -593,18 +603,26 @@ static void imx219_set_default_format(struct imx219 *imx219) static int imx219_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { struct imx219 *imx219 = to_imx219(sd); @@ -70753,7 +70719,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 /* Initialize try_crop rectangle. */ try_crop = v4l2_subdev_get_try_crop(sd, fh->pad, 0); -@@ -805,10 +823,21 @@ static int imx219_enum_mbus_code(struct v4l2_subdev *sd, +@@ -713,10 +731,21 @@ static int imx219_enum_mbus_code(struct v4l2_subdev *sd, { struct imx219 *imx219 = to_imx219(sd); @@ -70777,7 +70743,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 return 0; } -@@ -819,23 +848,36 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd, +@@ -727,23 +756,36 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd, { struct imx219 *imx219 = to_imx219(sd); @@ -70822,7 +70788,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); fmt->quantization = V4L2_MAP_QUANTIZATION_DEFAULT(true, fmt->colorspace, -@@ -843,9 +885,9 @@ static void imx219_reset_colorspace(struct v4l2_mbus_framefmt *fmt) +@@ -751,9 +793,9 @@ static void imx219_reset_colorspace(struct v4l2_mbus_framefmt *fmt) fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace); } @@ -70835,7 +70801,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 { fmt->format.width = mode->width; fmt->format.height = mode->height; -@@ -853,20 +895,38 @@ static void imx219_update_pad_format(struct imx219 *imx219, +@@ -761,20 +803,38 @@ static void imx219_update_pad_format(struct imx219 *imx219, imx219_reset_colorspace(&fmt->format); } @@ -70878,7 +70844,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 } return 0; -@@ -896,51 +956,74 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, +@@ -804,51 +864,74 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd, int exposure_max, exposure_def, hblank; unsigned int i; @@ -70996,7 +70962,7 @@ index 4771d0ef2c46..7f0fdd6fd7bc 100644 } mutex_unlock(&imx219->mutex); -@@ -1508,16 +1591,18 @@ static int imx219_probe(struct i2c_client *client) +@@ -1459,16 +1542,18 @@ static int imx219_probe(struct i2c_client *client) /* Initialize subdev */ imx219->sd.internal_ops = &imx219_internal_ops; @@ -86255,21 +86221,21 @@ index 8f2465394253..f13832ad1003 100644 return 0; } diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h -index c8c0f50a2076..ab0f24e6526c 100644 +index c8c0f50a2076..20380a8fdba2 100644 --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h @@ -105,6 +105,14 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = { MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd, MMC_QUIRK_BROKEN_SD_DISCARD), -+ /* -+ * On some Kingston SD cards, multiple erases of less than 64 -+ * sectors can cause corruption. -+ */ -+ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ ++ /* ++ * On some Kingston SD cards, multiple erases of less than 64 ++ * sectors can cause corruption. ++ */ ++ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), ++ END_FIXUP }; @@ -90176,7 +90142,7 @@ index 133f0d376480..3b6b396219db 100644 sdhci_dumpregs(host); diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c -index 6ee6c34f28f2..a48f3c482b01 100644 +index 5c5bea495f04..6f173b801ddc 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -67,6 +67,9 @@ @@ -90189,7 +90155,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 static inline void bcmgenet_writel(u32 value, void __iomem *offset) { -@@ -2439,6 +2442,11 @@ static void reset_umac(struct bcmgenet_priv *priv) +@@ -2447,6 +2450,11 @@ static void reset_umac(struct bcmgenet_priv *priv) bcmgenet_rbuf_ctrl_set(priv, 0); udelay(10); @@ -90201,7 +90167,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 /* issue soft reset and disable MAC while updating its registers */ bcmgenet_umac_writel(priv, CMD_SW_RESET, UMAC_CMD); udelay(2); -@@ -2608,7 +2616,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_priv *priv, +@@ -2616,7 +2624,7 @@ static void bcmgenet_init_tx_ring(struct bcmgenet_priv *priv, bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_PROD_INDEX); bcmgenet_tdma_ring_writel(priv, index, 0, TDMA_CONS_INDEX); @@ -90210,7 +90176,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 /* Disable rate control for now */ bcmgenet_tdma_ring_writel(priv, index, flow_period_val, TDMA_FLOW_PERIOD); -@@ -3249,7 +3257,7 @@ static void bcmgenet_get_hw_addr(struct bcmgenet_priv *priv, +@@ -3257,7 +3265,7 @@ static void bcmgenet_get_hw_addr(struct bcmgenet_priv *priv, } /* Returns a reusable dma control register value */ @@ -90219,7 +90185,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 { unsigned int i; u32 reg; -@@ -3274,6 +3282,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv) +@@ -3282,6 +3290,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv) udelay(10); bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH); @@ -90234,7 +90200,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 return dma_ctrl; } -@@ -3337,8 +3353,8 @@ static int bcmgenet_open(struct net_device *dev) +@@ -3345,8 +3361,8 @@ static int bcmgenet_open(struct net_device *dev) bcmgenet_set_hw_addr(priv, dev->dev_addr); @@ -90245,7 +90211,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 /* Reinitialize TDMA and RDMA and SW housekeeping */ ret = bcmgenet_init_dma(priv); -@@ -4077,9 +4093,12 @@ static int bcmgenet_probe(struct platform_device *pdev) +@@ -4085,9 +4101,12 @@ static int bcmgenet_probe(struct platform_device *pdev) netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1); /* Set default coalescing parameters */ @@ -90259,7 +90225,7 @@ index 6ee6c34f28f2..a48f3c482b01 100644 /* libphy will determine the link state */ netif_carrier_off(dev); -@@ -4195,7 +4214,7 @@ static int bcmgenet_resume(struct device *d) +@@ -4203,7 +4222,7 @@ static int bcmgenet_resume(struct device *d) bcmgenet_hfb_create_rxnfc_filter(priv, rule); /* Disable RX/TX DMA and flush TX queues */ @@ -90282,10 +90248,10 @@ index f6ca01da141d..45ea07829b8c 100644 /* misc. configuration */ #define MAX_NUM_OF_FS_RULES 16 diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c -index f9e91304d232..7abd5ddebd8e 100644 +index 4b875838a646..59cc972b080a 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c -@@ -293,6 +293,8 @@ int bcmgenet_mii_probe(struct net_device *dev) +@@ -286,6 +286,8 @@ int bcmgenet_mii_probe(struct net_device *dev) /* Communicate the integrated PHY revision */ if (priv->internal_phy) phy_flags = priv->gphy_rev; @@ -90395,7 +90361,7 @@ index 0cde17bd743f..2122c7171320 100644 { PHY_ID_BCM54612E, 0xfffffff0 }, { PHY_ID_BCM54616S, 0xfffffff0 }, diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c -index a644e8e5071c..15e0a7383f68 100644 +index 375bbd60b38a..9e884d2bd948 100644 --- a/drivers/net/phy/microchip.c +++ b/drivers/net/phy/microchip.c @@ -217,6 +217,7 @@ static int lan88xx_probe(struct phy_device *phydev) @@ -90440,11 +90406,11 @@ index a644e8e5071c..15e0a7383f68 100644 priv->chip_id = phy_read_mmd(phydev, 3, LAN88XX_MMD3_CHIP_ID); priv->chip_rev = phy_read_mmd(phydev, 3, LAN88XX_MMD3_CHIP_REV); diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c -index caf7291ffaf8..65ccc94a9282 100644 +index b67de3f9ef18..1d8da35c3e58 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c -@@ -185,6 +185,8 @@ static int lan87xx_read_status(struct phy_device *phydev) - int err = genphy_read_status(phydev); +@@ -188,6 +188,8 @@ static int lan87xx_read_status(struct phy_device *phydev) + return err; if (!phydev->link && priv->energy_enable) { + int energy_detected; @@ -90452,7 +90418,7 @@ index caf7291ffaf8..65ccc94a9282 100644 /* Disable EDPD to wake up PHY */ int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); if (rc < 0) -@@ -195,12 +197,12 @@ static int lan87xx_read_status(struct phy_device *phydev) +@@ -198,12 +200,12 @@ static int lan87xx_read_status(struct phy_device *phydev) if (rc < 0) return rc; @@ -90467,7 +90433,7 @@ index caf7291ffaf8..65ccc94a9282 100644 MII_LAN83C185_CTRL_STATUS); if (rc < 0) return rc; -@@ -210,10 +212,16 @@ static int lan87xx_read_status(struct phy_device *phydev) +@@ -213,10 +215,16 @@ static int lan87xx_read_status(struct phy_device *phydev) if (rc < 0) return rc; @@ -90498,7 +90464,7 @@ index 99fd12be2111..99381e6bea78 100644 obj-$(CONFIG_USB_NET_DM9601) += dm9601.o obj-$(CONFIG_USB_NET_SR9700) += sr9700.o diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c -index 6f7b70522d92..54b3eb586b7e 100644 +index 667984efeb3b..607703748279 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -427,6 +427,20 @@ static int msg_level = -1; @@ -90522,7 +90488,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -1169,6 +1183,9 @@ static int lan78xx_link_reset(struct lan78xx_net *dev) +@@ -1165,6 +1179,9 @@ static int lan78xx_link_reset(struct lan78xx_net *dev) if (unlikely(ret < 0)) return -EIO; @@ -90532,7 +90498,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 mutex_lock(&phydev->lock); phy_read_status(phydev); link = phydev->link; -@@ -1668,6 +1685,7 @@ static const struct ethtool_ops lan78xx_ethtool_ops = { +@@ -1664,6 +1681,7 @@ static const struct ethtool_ops lan78xx_ethtool_ops = { .set_link_ksettings = lan78xx_set_link_ksettings, .get_regs_len = lan78xx_get_regs_len, .get_regs = lan78xx_get_regs, @@ -90540,7 +90506,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 }; static void lan78xx_init_mac_address(struct lan78xx_net *dev) -@@ -2168,6 +2186,22 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) +@@ -2136,6 +2154,22 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -90563,7 +90529,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -2463,6 +2497,11 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2427,6 +2461,11 @@ static int lan78xx_reset(struct lan78xx_net *dev) int ret = 0; unsigned long timeout; u8 sig; @@ -90575,7 +90541,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_LRST_; -@@ -2516,6 +2555,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2480,6 +2519,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_MEF_; @@ -90585,7 +90551,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 ret = lan78xx_write_reg(dev, HW_CFG, buf); ret = lan78xx_read_reg(dev, USB_CFG0, &buf); -@@ -2571,6 +2613,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) +@@ -2535,6 +2577,9 @@ static int lan78xx_reset(struct lan78xx_net *dev) buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } @@ -90595,7 +90561,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 ret = lan78xx_write_reg(dev, MAC_CR, buf); ret = lan78xx_read_reg(dev, MAC_TX, &buf); -@@ -2900,8 +2945,14 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) +@@ -2864,8 +2909,14 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; @@ -90612,7 +90578,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 if (DEFAULT_VLAN_RX_OFFLOAD) dev->net->features |= NETIF_F_HW_VLAN_CTAG_RX; -@@ -3124,7 +3175,7 @@ static int rx_submit(struct lan78xx_net *dev, struct urb *urb, gfp_t flags) +@@ -3088,7 +3139,7 @@ static int rx_submit(struct lan78xx_net *dev, struct urb *urb, gfp_t flags) size_t size = dev->rx_urb_size; int ret = 0; @@ -90621,7 +90587,7 @@ index 6f7b70522d92..54b3eb586b7e 100644 if (!skb) { usb_free_urb(urb); return -ENOMEM; -@@ -3728,7 +3779,13 @@ static int lan78xx_probe(struct usb_interface *intf, +@@ -3692,7 +3743,13 @@ static int lan78xx_probe(struct usb_interface *intf, netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); @@ -95978,7 +95944,7 @@ index 000000000000..2c3fabd38b16 +MODULE_DESCRIPTION("Realtek USB ECM device"); +MODULE_LICENSE("GPL"); diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index e1cd4c2de2d3..0fba826e255c 100644 +index 975f52605867..23c0425b20b0 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -50,6 +50,7 @@ @@ -96092,7 +96058,7 @@ index e1cd4c2de2d3..0fba826e255c 100644 } netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -@@ -1853,7 +1917,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1859,7 +1923,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -96102,7 +96068,7 @@ index e1cd4c2de2d3..0fba826e255c 100644 return 1; } -@@ -1871,7 +1936,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1877,7 +1942,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ @@ -96268,7 +96234,7 @@ index df5970619712..3b9d903c6d16 100644 return; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -index e3758bd86acf..9047a0813ebf 100644 +index f29de630908d..7597a06cddd1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -134,13 +134,23 @@ static int brcmf_c_process_clm_blob(struct brcmf_if *ifp) @@ -97869,10 +97835,10 @@ index 000000000000..5ae2bdaa88b4 +MODULE_LICENSE("GPL"); + diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -index 39d2024dc2ee..cd8a0d5596ed 100644 +index c7ae9f900b53..4984901fa80c 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c -@@ -378,7 +378,7 @@ static const struct gpio_chip bcm2835_gpio_chip = { +@@ -376,7 +376,7 @@ static const struct gpio_chip bcm2835_gpio_chip = { .get = bcm2835_gpio_get, .set = bcm2835_gpio_set, .set_config = gpiochip_generic_config, @@ -97881,7 +97847,7 @@ index 39d2024dc2ee..cd8a0d5596ed 100644 .ngpio = BCM2835_NUM_GPIOS, .can_sleep = false, .of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, -@@ -395,7 +395,7 @@ static const struct gpio_chip bcm2711_gpio_chip = { +@@ -393,7 +393,7 @@ static const struct gpio_chip bcm2711_gpio_chip = { .get = bcm2835_gpio_get, .set = bcm2835_gpio_set, .set_config = gpiochip_generic_config, @@ -97890,7 +97856,7 @@ index 39d2024dc2ee..cd8a0d5596ed 100644 .ngpio = BCM2711_NUM_GPIOS, .can_sleep = false, .of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback, -@@ -1308,9 +1308,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) +@@ -1306,9 +1306,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) char *name; girq->parents[i] = irq_of_parse_and_map(np, i); @@ -97906,7 +97872,7 @@ index 39d2024dc2ee..cd8a0d5596ed 100644 /* Skip over the all banks interrupts */ pc->wake_irq[i] = irq_of_parse_and_map(np, i + BCM2835_NUM_IRQS + 1); -@@ -1336,7 +1340,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) +@@ -1334,7 +1338,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_level_irq; @@ -115655,7 +115621,7 @@ index c9876040ca44..048805aed90c 100644 uap->vendor = vendor; uap->fifosize = vendor->get_fifosize(dev); diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c -index 04b4ed5d0634..5fcac9eba277 100644 +index 7ece8d1a23cb..8afc10e8d7ee 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -523,8 +523,9 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud) @@ -175997,7 +175963,7 @@ index 67291945de62..6eac092eee89 100644 if (pdev->vendor == PCI_VENDOR_ID_ZHAOXIN && diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c -index 935368c6b31d..9f96c7e44113 100644 +index d99ea8492749..e30a5b18a6c9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -87,15 +87,16 @@ static bool trb_is_link(union xhci_trb *trb) @@ -176060,7 +176026,7 @@ index 935368c6b31d..9f96c7e44113 100644 state->new_deq_seg = new_seg; state->new_deq_ptr = new_deq; -@@ -2976,7 +2994,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) +@@ -2981,7 +2999,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) * that clears the EHB. */ while (xhci_handle_event(xhci) > 0) { @@ -176069,7 +176035,7 @@ index 935368c6b31d..9f96c7e44113 100644 continue; xhci_update_erst_dequeue(xhci, event_ring_deq); event_ring_deq = xhci->event_ring->dequeue; -@@ -3408,14 +3426,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, +@@ -3413,14 +3431,15 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, unsigned int num_trbs; unsigned int start_cycle, num_sgs = 0; unsigned int enqd_len, block_len, trb_buff_len, full_len; @@ -176087,7 +176053,7 @@ index 935368c6b31d..9f96c7e44113 100644 full_len = urb->transfer_buffer_length; /* If we have scatter/gather list, we use it. */ if (urb->num_sgs) { -@@ -3452,6 +3471,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, +@@ -3457,6 +3476,17 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, start_cycle = ring->cycle_state; send_addr = addr; @@ -176105,7 +176071,7 @@ index 935368c6b31d..9f96c7e44113 100644 /* Queue the TRBs, even if they are zero-length */ for (enqd_len = 0; first_trb || enqd_len < full_len; enqd_len += trb_buff_len) { -@@ -3464,6 +3494,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, +@@ -3469,6 +3499,11 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, if (enqd_len + trb_buff_len > full_len) trb_buff_len = full_len - enqd_len; @@ -176117,7 +176083,7 @@ index 935368c6b31d..9f96c7e44113 100644 /* Don't change the cycle bit of the first TRB until later */ if (first_trb) { first_trb = false; -@@ -4270,9 +4305,9 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, +@@ -4275,9 +4310,9 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, } ep = &xhci->devs[slot_id]->eps[ep_index]; if ((ep->ep_state & SET_DEQ_PENDING)) { @@ -176131,10 +176097,10 @@ index 935368c6b31d..9f96c7e44113 100644 /* This function gets called from contexts where it cannot sleep */ diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c -index 30af35a30728..c666576a9eca 100644 +index b37ddbb88b74..dd004e1690cc 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -877,8 +877,8 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) +@@ -881,8 +881,8 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) seg = ring->deq_seg; do { memset(seg->trbs, 0, @@ -176145,7 +176111,7 @@ index 30af35a30728..c666576a9eca 100644 cpu_to_le32(~TRB_CYCLE); seg = seg->next; } while (seg != ring->deq_seg); -@@ -889,7 +889,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) +@@ -893,7 +893,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) ring->enq_seg = ring->deq_seg; ring->enqueue = ring->dequeue; @@ -176154,7 +176120,7 @@ index 30af35a30728..c666576a9eca 100644 /* * Ring is now zeroed, so the HW should look for change of ownership * when the cycle bit is set to 1. -@@ -1493,6 +1493,103 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, +@@ -1497,6 +1497,103 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id, return ret; } @@ -176258,7 +176224,7 @@ index 30af35a30728..c666576a9eca 100644 /* * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it -@@ -5463,6 +5560,7 @@ static const struct hc_driver xhci_hc_driver = { +@@ -5467,6 +5564,7 @@ static const struct hc_driver xhci_hc_driver = { .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, @@ -176267,7 +176233,7 @@ index 30af35a30728..c666576a9eca 100644 .enable_device = xhci_enable_device, .update_hub_device = xhci_update_hub_device, diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h -index 7e92740221e1..c9abf489301f 100644 +index 7e92740221e1..1a5205179b76 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1622,6 +1622,7 @@ struct xhci_ring { @@ -176289,16 +176255,16 @@ index 7e92740221e1..c9abf489301f 100644 /* Initial allocated size of the ERST, in number of entries */ #define ERST_SIZE 64 /* Initial number of event segment rings allocated */ -@@ -1896,6 +1897,9 @@ struct xhci_hcd { - #define XHCI_ZHAOXIN_HOST BIT_ULL(41) - #define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(42) +@@ -1898,6 +1899,9 @@ struct xhci_hcd { #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(43) -+#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(44) -+#define XHCI_VLI_TRB_CACHE_BUG BIT_ULL(45) -+#define XHCI_VLI_SS_BULK_OUT_BUG BIT_ULL(46) #define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(44) #define XHCI_RESET_TO_DEFAULT BIT_ULL(45) ++#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(46) ++#define XHCI_VLI_TRB_CACHE_BUG BIT_ULL(47) ++#define XHCI_VLI_SS_BULK_OUT_BUG BIT_ULL(48) + unsigned int num_active_eps; + unsigned int limit_active_eps; diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index d83c87b902c1..ed22a119c992 100644 --- a/drivers/video/backlight/Kconfig @@ -176455,7 +176421,7 @@ index 000000000000..14a0d9b03739 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig -index 9cb29c86e594..a5d0bf402029 100644 +index 9cb29c86e594..db41ea016b39 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -219,6 +219,20 @@ config FB_TILEBLITTING @@ -176479,25 +176445,26 @@ index 9cb29c86e594..a5d0bf402029 100644 config FB_GRVGA tristate "Aeroflex Gaisler framebuffer support" depends on FB && SPARC -@@ -2243,6 +2257,18 @@ config FB_LS2K500 - select FB_CFB_IMAGEBLIT +@@ -2244,6 +2258,19 @@ config FB_LS2K500 help Frame buffer driver for the Loongson LS7A Platform-Bridge. -+ -+config FB_RPISENSE -+ tristate "Raspberry Pi Sense HAT framebuffer" -+ depends on FB -+ select MFD_RPISENSE_CORE -+ select FB_SYS_FOPS -+ select FB_SYS_FILLRECT -+ select FB_SYS_COPYAREA -+ select FB_SYS_IMAGEBLIT -+ select FB_DEFERRED_IO -+ help -+ This is the framebuffer driver for the Raspberry Pi Sense HAT ++config FB_RPISENSE ++ tristate "Raspberry Pi Sense HAT framebuffer" ++ depends on FB ++ select MFD_RPISENSE_CORE ++ select FB_SYS_FOPS ++ select FB_SYS_FILLRECT ++ select FB_SYS_COPYAREA ++ select FB_SYS_IMAGEBLIT ++ select FB_DEFERRED_IO ++ ++ help ++ This is the framebuffer driver for the Raspberry Pi Sense HAT ++ source "drivers/video/fbdev/omap/Kconfig" source "drivers/video/fbdev/omap2/Kconfig" + source "drivers/video/fbdev/mmp/Kconfig" diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index a446c174d4e3..ee23e3b86021 100644 --- a/drivers/video/fbdev/Makefile @@ -177976,7 +177943,7 @@ index a2bb276a8b24..436494fba15a 100644 start_index, pitch_index); } else diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c -index d787a344b3b8..68203a093367 100644 +index 1704deaf4152..e16aceb9b53a 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1095,6 +1095,30 @@ fb_blank(struct fb_info *info, int blank) @@ -178018,7 +177985,7 @@ index d787a344b3b8..68203a093367 100644 void __user *argp = (void __user *)arg; long ret = 0; -@@ -1180,6 +1205,15 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, +@@ -1182,6 +1207,15 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unlock_fb_info(info); console_unlock(); break; @@ -178034,7 +178001,7 @@ index d787a344b3b8..68203a093367 100644 default: lock_fb_info(info); fb = info->fbops; -@@ -1325,6 +1359,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, +@@ -1327,6 +1361,7 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP: @@ -182214,17 +182181,18 @@ index 517288da19fd..626c450d71f4 100644 #define PHY_ARDENNES_MMD_DEV_3_PHY_CFG (0x806A) #define PHY_ARDENNES_MMD_DEV_3_PHY_CFG_ZD_DLY_EN_ (0x2000) diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h -index ef870d1f4f5f..7fab4d749543 100644 +index ef870d1f4f5f..e92cee4c5ecb 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -270,6 +270,7 @@ struct mmc_card { - #define MMC_QUIRK_BROKEN_IRQ_POLLING (1<<11) /* Polling SDIO_CCCR_INTx could create a fake interrupt */ - #define MMC_QUIRK_TRIM_BROKEN (1<<12) /* Skip trim */ +@@ -272,6 +272,8 @@ struct mmc_card { #define MMC_QUIRK_BROKEN_HPI (1<<13) /* Disable broken HPI support */ -+#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ #define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14) /* Disable broken SD discard support */ ++#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ ++ bool reenable_cmdq; /* Re-enable Command Queue */ + + unsigned int erase_size; /* erase size in sectors */ diff --git a/include/linux/platform_data/dma-bcm2708.h b/include/linux/platform_data/dma-bcm2708.h new file mode 100644 index 000000000000..6ca874d332a8 @@ -183261,7 +183229,7 @@ index b28817c59fdf..5a220bff12c7 100644 /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c -index 2bc5bae49d20..3e76b7836313 100644 +index 3d778636f2e8..10959a9e73b1 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -5924,6 +5924,9 @@ int __init cgroup_init_early(void) @@ -183287,7 +183255,7 @@ index 2bc5bae49d20..3e76b7836313 100644 for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6558,6 +6567,10 @@ static int __init cgroup_disable(char *str) +@@ -6578,6 +6587,10 @@ static int __init cgroup_disable(char *str) strcmp(token, ss->legacy_name)) continue; @@ -183298,7 +183266,7 @@ index 2bc5bae49d20..3e76b7836313 100644 static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6567,6 +6580,31 @@ static int __init cgroup_disable(char *str) +@@ -6587,6 +6600,31 @@ static int __init cgroup_disable(char *str) } __setup("cgroup_disable=", cgroup_disable); @@ -183331,7 +183299,7 @@ index 2bc5bae49d20..3e76b7836313 100644 static int __init enable_cgroup_debug(char *str) diff --git a/kernel/resource.c b/kernel/resource.c -index 817545ff80b9..375a43d99b28 100644 +index 100253d4909c..fb32fdc53687 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -214,6 +214,12 @@ static int __release_resource(struct resource *old, bool release_child) @@ -183348,10 +183316,10 @@ index 817545ff80b9..375a43d99b28 100644 for (;;) { tmp = *p; diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 9e85e8b52299..913d86aecd30 100644 +index b511a3c17769..827d68ef964a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -9163,8 +9163,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, +@@ -9165,8 +9165,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, 0)) { @@ -196196,7 +196164,7 @@ index 000000000000..835d0f9420e7 +MODULE_DESCRIPTION("ASoC Raspberry Pi Hat generic digi driver for WM8804 based cards"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index 25f331551f68..890cd6d074e6 100644 +index f1c9e563994b..a5a27d0c3043 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -100,12 +100,14 @@ config SND_SOC_ALL_CODECS @@ -199305,5 +199273,5 @@ index 752422147fb3..977c3b33d640 100644 } -- -2.27.0 +2.33.0 diff --git a/raspberrypi-kernel.spec b/raspberrypi-kernel.spec index ef7a4e5..1d933c7 100644 --- a/raspberrypi-kernel.spec +++ b/raspberrypi-kernel.spec @@ -2,13 +2,13 @@ %global KernelVer %{version}-%{release}.raspi.%{_target_cpu} -%global hulkrelease 161.0.0 +%global hulkrelease 166.0.0 %global debug_package %{nil} Name: raspberrypi-kernel Version: 5.10.0 -Release: %{hulkrelease}.15 +Release: %{hulkrelease}.16 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -166,6 +166,9 @@ install -m 644 /boot/dtb-%{KernelVer}/overlays/README /boot/overlays/ /lib/modules/%{KernelVer} %changelog +* Thu Nev 9 2023 Yafen Fang - 5.10.0-166.0.0.16 +- update kernel version to openEuler 5.10.0-166.0.0 + * Tue Oct 24 2023 Junyu Mu - 5.10.0-161.0.0.15 - update kernel version to openEuler 5.10.0-161.0.0