From 0405d900a5a7054ed3231c40a3c2181f4b9d2e07 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Wed, 28 Dec 2022 06:08:39 +0000 Subject: [PATCH 1/4] linux (Rockchip): rebase patches for 6.1.2-rc1 --- .../default/linux-0011-v4l2-from-list.patch | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/projects/Rockchip/patches/linux/default/linux-0011-v4l2-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0011-v4l2-from-list.patch index 7c4afd72e9..8d203773e3 100644 --- a/projects/Rockchip/patches/linux/default/linux-0011-v4l2-from-list.patch +++ b/projects/Rockchip/patches/linux/default/linux-0011-v4l2-from-list.patch @@ -135,7 +135,7 @@ Subject: [PATCH] media: v4l2: Add NV15 and NV20 pixel formats Add NV15 and NV20 pixel formats used by the Rockchip Video Decoder for 10-bit buffers. -NV15 and NV20 is a packed 10-bit 4:2:0/4:2:2 semi-planar Y/CbCr format +NV15 and NV20 is a packed 10-bit 4:2:0/4:2:2 semi-planar Y/UV format similar to P010 and P210 but has no padding between components. Instead, luminance and chrominance samples are grouped into 4s so that each group is packed into an integer number of bytes: @@ -172,28 +172,28 @@ index e6fd355a2e92..24771edaa4f2 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1354,6 +1354,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) - case V4L2_PIX_FMT_NV24: descr = "Y/CbCr 4:4:4"; break; - case V4L2_PIX_FMT_NV42: descr = "Y/CrCb 4:4:4"; break; - case V4L2_PIX_FMT_P010: descr = "10-bit Y/CbCr 4:2:0"; break; -+ case V4L2_PIX_FMT_NV15: descr = "10-bit Y/CbCr 4:2:0 (Packed)"; break; -+ case V4L2_PIX_FMT_NV20: descr = "10-bit Y/CbCr 4:2:2 (Packed)"; break; - case V4L2_PIX_FMT_NV12_4L4: descr = "Y/CbCr 4:2:0 (4x4 Linear)"; break; - case V4L2_PIX_FMT_NV12_16L16: descr = "Y/CbCr 4:2:0 (16x16 Linear)"; break; - case V4L2_PIX_FMT_NV12_32L32: descr = "Y/CbCr 4:2:0 (32x32 Linear)"; break; + case V4L2_PIX_FMT_NV24: descr = "Y/UV 4:4:4"; break; + case V4L2_PIX_FMT_NV42: descr = "Y/VU 4:4:4"; break; + case V4L2_PIX_FMT_P010: descr = "10-bit Y/UV 4:2:0"; break; ++ case V4L2_PIX_FMT_NV15: descr = "10-bit Y/UV 4:2:0 (Packed)"; break; ++ case V4L2_PIX_FMT_NV20: descr = "10-bit Y/UV 4:2:2 (Packed)"; break; + case V4L2_PIX_FMT_NV12_4L4: descr = "Y/UV 4:2:0 (4x4 Linear)"; break; + case V4L2_PIX_FMT_NV12_16L16: descr = "Y/UV 4:2:0 (16x16 Linear)"; break; + case V4L2_PIX_FMT_NV12_32L32: descr = "Y/UV 4:2:0 (32x32 Linear)"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 01e630f2ec78..cea44992aea3 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -628,6 +628,9 @@ struct v4l2_pix_format { - #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */ - #define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/CbCr 4:2:0 10-bit per component */ + #define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/VU 4:4:4 */ + #define V4L2_PIX_FMT_P010 v4l2_fourcc('P', '0', '1', '0') /* 24 Y/UV 4:2:0 10-bit per component */ -+#define V4L2_PIX_FMT_NV15 v4l2_fourcc('N', 'V', '1', '5') /* 15 Y/CbCr 4:2:0 10-bit packed */ -+#define V4L2_PIX_FMT_NV20 v4l2_fourcc('N', 'V', '2', '0') /* 20 Y/CbCr 4:2:2 10-bit packed */ ++#define V4L2_PIX_FMT_NV15 v4l2_fourcc('N', 'V', '1', '5') /* 15 Y/UV 4:2:0 10-bit packed */ ++#define V4L2_PIX_FMT_NV20 v4l2_fourcc('N', 'V', '2', '0') /* 20 Y/UV 4:2:2 10-bit packed */ + /* two non contiguous planes - one Y, one Cr + Cb interleaved */ - #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ - #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ + #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/UV 4:2:0 */ + #define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/VU 4:2:0 */ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jonas Karlman From ff1506bb4e052fb26d33d22fcd0067998a2cbe83 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Thu, 29 Dec 2022 23:01:38 +0000 Subject: [PATCH 2/4] linux (Allwinner): drop upstream patches included in 6.1.2-rc1 --- ...cedrus--hevc--Fix-offset-adjustments.patch | 91 ------------ .../0068-iommu-sun50i-Fix-reset-release.patch | 44 ------ ...Consider-all-fault-sources-for-reset.patch | 50 ------- ...ommu-sun50i-Fix-R-W-permission-check.patch | 33 ----- .../0071-iommu-sun50i-Fix-flush-size.patch | 27 ---- ...mmu-sun50i-Implement-.iotlb_sync_map.patch | 133 ------------------ ...bCr-YUV-terms-in-format-descriptions.patch | 61 -------- 7 files changed, 439 deletions(-) delete mode 100644 projects/Allwinner/patches/linux/0062-media--cedrus--hevc--Fix-offset-adjustments.patch delete mode 100644 projects/Allwinner/patches/linux/0068-iommu-sun50i-Fix-reset-release.patch delete mode 100644 projects/Allwinner/patches/linux/0069-iommu-sun50i-Consider-all-fault-sources-for-reset.patch delete mode 100644 projects/Allwinner/patches/linux/0070-iommu-sun50i-Fix-R-W-permission-check.patch delete mode 100644 projects/Allwinner/patches/linux/0071-iommu-sun50i-Fix-flush-size.patch delete mode 100644 projects/Allwinner/patches/linux/0072-iommu-sun50i-Implement-.iotlb_sync_map.patch delete mode 100644 projects/Allwinner/patches/linux/0074-media-Unify-YCbCr-YUV-terms-in-format-descriptions.patch diff --git a/projects/Allwinner/patches/linux/0062-media--cedrus--hevc--Fix-offset-adjustments.patch b/projects/Allwinner/patches/linux/0062-media--cedrus--hevc--Fix-offset-adjustments.patch deleted file mode 100644 index 97d93e3864..0000000000 --- a/projects/Allwinner/patches/linux/0062-media--cedrus--hevc--Fix-offset-adjustments.patch +++ /dev/null @@ -1,91 +0,0 @@ -From e85edafea5122a1357c884559db1a00046102807 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Tue, 4 Oct 2022 20:28:44 +0200 -Subject: [PATCH] media: cedrus: hevc: Fix offset adjustments - -As it turns out, current padding size check works fine in theory but it -doesn't in practice. Most probable reason are caching issues. - -Let's rework reading data from bitstream using Cedrus engine instead of -CPU. That way we avoid all cache issues and make sure that we're reading -same data as Cedrus. - -Fixes: e7060d9a78c2 ("media: uapi: Change data_bit_offset definition") -Signed-off-by: Jernej Skrabec ---- - .../staging/media/sunxi/cedrus/cedrus_h265.c | 24 ++++++++++++++----- - .../staging/media/sunxi/cedrus/cedrus_regs.h | 2 ++ - 2 files changed, 20 insertions(+), 6 deletions(-) - -diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -index 82e2e510e62509..400a7bc1670df3 100644 ---- a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -+++ b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c -@@ -281,6 +281,17 @@ static void cedrus_h265_skip_bits(struct cedrus_dev *dev, int num) - } - } - -+static u32 cedrus_h265_show_bits(struct cedrus_dev *dev, int num) -+{ -+ cedrus_write(dev, VE_DEC_H265_TRIGGER, -+ VE_DEC_H265_TRIGGER_SHOW_BITS | -+ VE_DEC_H265_TRIGGER_TYPE_N_BITS(num)); -+ while (cedrus_read(dev, VE_DEC_H265_STATUS) & VE_DEC_H265_STATUS_VLD_BUSY) -+ udelay(1); -+ -+ return cedrus_read(dev, VE_DEC_H265_READED_BITS); -+} -+ - static void cedrus_h265_write_scaling_list(struct cedrus_ctx *ctx, - struct cedrus_run *run) - { -@@ -445,7 +456,7 @@ static int cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run) - u32 num_entry_point_offsets; - u32 output_pic_list_index; - u32 pic_order_cnt[2]; -- u8 *padding; -+ u8 padding; - int count; - u32 reg; - -@@ -529,21 +540,22 @@ static int cedrus_h265_setup(struct cedrus_ctx *ctx, struct cedrus_run *run) - if (slice_params->data_byte_offset == 0) - return -EOPNOTSUPP; - -- padding = (u8 *)vb2_plane_vaddr(&run->src->vb2_buf, 0) + -- slice_params->data_byte_offset - 1; -+ cedrus_h265_skip_bits(dev, (slice_params->data_byte_offset - 1) * 8); -+ -+ padding = cedrus_h265_show_bits(dev, 8); - - /* at least one bit must be set in that byte */ -- if (*padding == 0) -+ if (padding == 0) - return -EINVAL; - - for (count = 0; count < 8; count++) -- if (*padding & (1 << count)) -+ if (padding & (1 << count)) - break; - - /* Include the one bit. */ - count++; - -- cedrus_h265_skip_bits(dev, slice_params->data_byte_offset * 8 - count); -+ cedrus_h265_skip_bits(dev, 8 - count); - - /* Bitstream parameters. */ - -diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -index 2f7dbd8b8896e9..424049f567c465 100644 ---- a/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -+++ b/drivers/staging/media/sunxi/cedrus/cedrus_regs.h -@@ -509,6 +509,8 @@ - #define VE_DEC_H265_LOW_ADDR_ENTRY_POINTS_BUF(a) \ - SHIFT_AND_MASK_BITS(a, 7, 0) - -+#define VE_DEC_H265_READED_BITS (VE_ENGINE_DEC_H265 + 0xdc) -+ - #define VE_DEC_H265_SRAM_OFFSET (VE_ENGINE_DEC_H265 + 0xe0) - - #define VE_DEC_H265_SRAM_OFFSET_PRED_WEIGHT_LUMA_L0 0x00 diff --git a/projects/Allwinner/patches/linux/0068-iommu-sun50i-Fix-reset-release.patch b/projects/Allwinner/patches/linux/0068-iommu-sun50i-Fix-reset-release.patch deleted file mode 100644 index 09b8cc17a1..0000000000 --- a/projects/Allwinner/patches/linux/0068-iommu-sun50i-Fix-reset-release.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 12 Oct 2022 21:10:47 +0200 -Subject: [PATCH] iommu/sun50i: Fix reset release - -Reset signal is asserted by writing 0 to the corresponding locations of -masters we want to reset. So in order to deassert all reset signals, we -should write 1's to all locations. - -Current code writes 1's to locations of masters which were just reset -which is good. However, at the same time it also writes 0's to other -locations and thus asserts reset signals of remaining masters. Fix code -by writing all 1's when we want to deassert all reset signals. - -This bug was discovered when working with Cedrus (video decoder). When -it faulted, display went blank due to reset signal assertion. - -Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") -Signed-off-by: Jernej Skrabec ---- - drivers/iommu/sun50i-iommu.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c -index a84c63518773..c777882d0ec2 100644 ---- a/drivers/iommu/sun50i-iommu.c -+++ b/drivers/iommu/sun50i-iommu.c -@@ -27,6 +27,7 @@ - #include - - #define IOMMU_RESET_REG 0x010 -+#define IOMMU_RESET_RELEASE_ALL 0xffffffff - #define IOMMU_ENABLE_REG 0x020 - #define IOMMU_ENABLE_ENABLE BIT(0) - -@@ -893,7 +894,7 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id) - iommu_write(iommu, IOMMU_INT_CLR_REG, status); - - iommu_write(iommu, IOMMU_RESET_REG, ~status); -- iommu_write(iommu, IOMMU_RESET_REG, status); -+ iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL); - - spin_unlock(&iommu->iommu_lock); - diff --git a/projects/Allwinner/patches/linux/0069-iommu-sun50i-Consider-all-fault-sources-for-reset.patch b/projects/Allwinner/patches/linux/0069-iommu-sun50i-Consider-all-fault-sources-for-reset.patch deleted file mode 100644 index a5b1f20315..0000000000 --- a/projects/Allwinner/patches/linux/0069-iommu-sun50i-Consider-all-fault-sources-for-reset.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 12 Oct 2022 22:46:32 +0200 -Subject: [PATCH] iommu/sun50i: Consider all fault sources for reset - -We have to reset masters for all faults - permissions, L1 fault or L2 -fault. Currently it's done only for permissions. If other type of fault -happens, master is in locked up state. Fix that by really considering -all fault sources. - -Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") -Signed-off-by: Jernej Skrabec ---- - drivers/iommu/sun50i-iommu.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c -index c777882d0ec2..38d1069cf383 100644 ---- a/drivers/iommu/sun50i-iommu.c -+++ b/drivers/iommu/sun50i-iommu.c -@@ -869,8 +869,8 @@ static phys_addr_t sun50i_iommu_handle_perm_irq(struct sun50i_iommu *iommu) - - static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id) - { -+ u32 status, l1_status, l2_status, resets; - struct sun50i_iommu *iommu = dev_id; -- u32 status; - - spin_lock(&iommu->iommu_lock); - -@@ -880,6 +880,9 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id) - return IRQ_NONE; - } - -+ l1_status = iommu_read(iommu, IOMMU_L1PG_INT_REG); -+ l2_status = iommu_read(iommu, IOMMU_L2PG_INT_REG); -+ - if (status & IOMMU_INT_INVALID_L2PG) - sun50i_iommu_handle_pt_irq(iommu, - IOMMU_INT_ERR_ADDR_L2_REG, -@@ -893,7 +896,8 @@ static irqreturn_t sun50i_iommu_irq(int irq, void *dev_id) - - iommu_write(iommu, IOMMU_INT_CLR_REG, status); - -- iommu_write(iommu, IOMMU_RESET_REG, ~status); -+ resets = (status | l1_status | l2_status) & IOMMU_INT_MASTER_MASK; -+ iommu_write(iommu, IOMMU_RESET_REG, ~resets); - iommu_write(iommu, IOMMU_RESET_REG, IOMMU_RESET_RELEASE_ALL); - - spin_unlock(&iommu->iommu_lock); diff --git a/projects/Allwinner/patches/linux/0070-iommu-sun50i-Fix-R-W-permission-check.patch b/projects/Allwinner/patches/linux/0070-iommu-sun50i-Fix-R-W-permission-check.patch deleted file mode 100644 index fa9844bf4e..0000000000 --- a/projects/Allwinner/patches/linux/0070-iommu-sun50i-Fix-R-W-permission-check.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 12 Oct 2022 21:24:03 +0200 -Subject: [PATCH] iommu/sun50i: Fix R/W permission check - -Because driver has enum type permissions and iommu subsystem has bitmap -type, we have to be careful how check for combined read and write -permissions is done. In such case, we have to mask both permissions and -check that both are set at the same time. - -Current code just masks both flags but doesn't check that both are set. -In short, it always sets R/W permission, regardles if requested -permissions were RO, WO or RW. Fix that. - -Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") -Signed-off-by: Jernej Skrabec ---- - drivers/iommu/sun50i-iommu.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c -index 38d1069cf383..135df6934a9e 100644 ---- a/drivers/iommu/sun50i-iommu.c -+++ b/drivers/iommu/sun50i-iommu.c -@@ -271,7 +271,7 @@ static u32 sun50i_mk_pte(phys_addr_t page, int prot) - enum sun50i_iommu_aci aci; - u32 flags = 0; - -- if (prot & (IOMMU_READ | IOMMU_WRITE)) -+ if ((prot & (IOMMU_READ | IOMMU_WRITE)) == (IOMMU_READ | IOMMU_WRITE)) - aci = SUN50I_IOMMU_ACI_RD_WR; - else if (prot & IOMMU_READ) - aci = SUN50I_IOMMU_ACI_RD; diff --git a/projects/Allwinner/patches/linux/0071-iommu-sun50i-Fix-flush-size.patch b/projects/Allwinner/patches/linux/0071-iommu-sun50i-Fix-flush-size.patch deleted file mode 100644 index 82b3b18b0a..0000000000 --- a/projects/Allwinner/patches/linux/0071-iommu-sun50i-Fix-flush-size.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 12 Oct 2022 21:35:53 +0200 -Subject: [PATCH] iommu/sun50i: Fix flush size - -Function sun50i_table_flush() takes number of entries as an argument, -not number of bytes. Fix that mistake in sun50i_dte_get_page_table(). - -Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") -Signed-off-by: Jernej Skrabec ---- - drivers/iommu/sun50i-iommu.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c -index 135df6934a9e..7c3b2ac552da 100644 ---- a/drivers/iommu/sun50i-iommu.c -+++ b/drivers/iommu/sun50i-iommu.c -@@ -512,7 +512,7 @@ static u32 *sun50i_dte_get_page_table(struct sun50i_iommu_domain *sun50i_domain, - sun50i_iommu_free_page_table(iommu, drop_pt); - } - -- sun50i_table_flush(sun50i_domain, page_table, PT_SIZE); -+ sun50i_table_flush(sun50i_domain, page_table, NUM_PT_ENTRIES); - sun50i_table_flush(sun50i_domain, dte_addr, 1); - - return page_table; diff --git a/projects/Allwinner/patches/linux/0072-iommu-sun50i-Implement-.iotlb_sync_map.patch b/projects/Allwinner/patches/linux/0072-iommu-sun50i-Implement-.iotlb_sync_map.patch deleted file mode 100644 index 91b1578d84..0000000000 --- a/projects/Allwinner/patches/linux/0072-iommu-sun50i-Implement-.iotlb_sync_map.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Wed, 12 Oct 2022 21:55:27 +0200 -Subject: [PATCH] iommu/sun50i: Implement .iotlb_sync_map - -Allocated iova ranges need to be invalidated immediately or otherwise -they might or might not work when used by master or CPU. This was -discovered when running video decoder conformity test with Cedrus. Some -videos were now and then decoded incorrectly and generated page faults. - -According to vendor driver, it's enough to invalidate just start and end -TLB and PTW cache lines. Documentation says that neighbouring lines must -be invalidated too. Finally, when page fault occurs, that iova must be -invalidated the same way, according to documentation. - -Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") -Signed-off-by: Jernej Skrabec ---- - drivers/iommu/sun50i-iommu.c | 73 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 73 insertions(+) - -diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c -index 7c3b2ac552da..d7c5e9b1a087 100644 ---- a/drivers/iommu/sun50i-iommu.c -+++ b/drivers/iommu/sun50i-iommu.c -@@ -93,6 +93,8 @@ - #define NUM_PT_ENTRIES 256 - #define PT_SIZE (NUM_PT_ENTRIES * PT_ENTRY_SIZE) - -+#define SPAGE_SIZE 4096 -+ - struct sun50i_iommu { - struct iommu_device iommu; - -@@ -295,6 +297,62 @@ static void sun50i_table_flush(struct sun50i_iommu_domain *sun50i_domain, - dma_sync_single_for_device(iommu->dev, dma, size, DMA_TO_DEVICE); - } - -+static void sun50i_iommu_zap_iova(struct sun50i_iommu *iommu, -+ unsigned long iova) -+{ -+ u32 reg; -+ int ret; -+ -+ iommu_write(iommu, IOMMU_TLB_IVLD_ADDR_REG, iova); -+ iommu_write(iommu, IOMMU_TLB_IVLD_ADDR_MASK_REG, GENMASK(31, 12)); -+ iommu_write(iommu, IOMMU_TLB_IVLD_ENABLE_REG, -+ IOMMU_TLB_IVLD_ENABLE_ENABLE); -+ -+ ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_IVLD_ENABLE_REG, -+ reg, !reg, 1, 2000); -+ if (ret) -+ dev_warn(iommu->dev, "TLB invalidation timed out!\n"); -+} -+ -+static void sun50i_iommu_zap_ptw_cache(struct sun50i_iommu *iommu, -+ unsigned long iova) -+{ -+ u32 reg; -+ int ret; -+ -+ iommu_write(iommu, IOMMU_PC_IVLD_ADDR_REG, iova); -+ iommu_write(iommu, IOMMU_PC_IVLD_ENABLE_REG, -+ IOMMU_PC_IVLD_ENABLE_ENABLE); -+ -+ ret = readl_poll_timeout_atomic(iommu->base + IOMMU_PC_IVLD_ENABLE_REG, -+ reg, !reg, 1, 2000); -+ if (ret) -+ dev_warn(iommu->dev, "PTW cache invalidation timed out!\n"); -+} -+ -+static void sun50i_iommu_zap_range(struct sun50i_iommu *iommu, -+ unsigned long iova, size_t size) -+{ -+ assert_spin_locked(&iommu->iommu_lock); -+ -+ iommu_write(iommu, IOMMU_AUTO_GATING_REG, 0); -+ -+ sun50i_iommu_zap_iova(iommu, iova); -+ sun50i_iommu_zap_iova(iommu, iova + SPAGE_SIZE); -+ if (size > SPAGE_SIZE) { -+ sun50i_iommu_zap_iova(iommu, iova + size); -+ sun50i_iommu_zap_iova(iommu, iova + size + SPAGE_SIZE); -+ } -+ sun50i_iommu_zap_ptw_cache(iommu, iova); -+ sun50i_iommu_zap_ptw_cache(iommu, iova + SZ_1M); -+ if (size > SZ_1M) { -+ sun50i_iommu_zap_ptw_cache(iommu, iova + size); -+ sun50i_iommu_zap_ptw_cache(iommu, iova + size + SZ_1M); -+ } -+ -+ iommu_write(iommu, IOMMU_AUTO_GATING_REG, IOMMU_AUTO_GATING_ENABLE); -+} -+ - static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu) - { - u32 reg; -@@ -344,6 +402,18 @@ static void sun50i_iommu_flush_iotlb_all(struct iommu_domain *domain) - spin_unlock_irqrestore(&iommu->iommu_lock, flags); - } - -+static void sun50i_iommu_iotlb_sync_map(struct iommu_domain *domain, -+ unsigned long iova, size_t size) -+{ -+ struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain); -+ struct sun50i_iommu *iommu = sun50i_domain->iommu; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&iommu->iommu_lock, flags); -+ sun50i_iommu_zap_range(iommu, iova, size); -+ spin_unlock_irqrestore(&iommu->iommu_lock, flags); -+} -+ - static void sun50i_iommu_iotlb_sync(struct iommu_domain *domain, - struct iommu_iotlb_gather *gather) - { -@@ -767,6 +837,7 @@ static const struct iommu_ops sun50i_iommu_ops = { - .attach_dev = sun50i_iommu_attach_device, - .detach_dev = sun50i_iommu_detach_device, - .flush_iotlb_all = sun50i_iommu_flush_iotlb_all, -+ .iotlb_sync_map = sun50i_iommu_iotlb_sync_map, - .iotlb_sync = sun50i_iommu_iotlb_sync, - .iova_to_phys = sun50i_iommu_iova_to_phys, - .map = sun50i_iommu_map, -@@ -786,6 +857,8 @@ static void sun50i_iommu_report_fault(struct sun50i_iommu *iommu, - report_iommu_fault(iommu->domain, iommu->dev, iova, prot); - else - dev_err(iommu->dev, "Page fault while iommu not attached to any domain?\n"); -+ -+ sun50i_iommu_zap_range(iommu, iova, SPAGE_SIZE); - } - - static phys_addr_t sun50i_iommu_handle_pt_irq(struct sun50i_iommu *iommu, diff --git a/projects/Allwinner/patches/linux/0074-media-Unify-YCbCr-YUV-terms-in-format-descriptions.patch b/projects/Allwinner/patches/linux/0074-media-Unify-YCbCr-YUV-terms-in-format-descriptions.patch deleted file mode 100644 index 329dd47815..0000000000 --- a/projects/Allwinner/patches/linux/0074-media-Unify-YCbCr-YUV-terms-in-format-descriptions.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jernej Skrabec -Date: Sat, 15 Oct 2022 10:43:41 +0200 -Subject: [PATCH] media: Unify YCbCr/YUV terms in format descriptions - -Format descriptions use YCbCr and YUV terms interchangeably. Let's unify -them so they all use YUV. While YCbCr is actually correct term here, YUV -is shorter and thus it also fixes too long description of P010 tiled -format. - -Fixes: 3c8e19d3d3f9 ("media: Add P010 tiled format") -Signed-off-by: Jernej Skrabec ---- - drivers/media/v4l2-core/v4l2-ioctl.c | 34 ++++++++++++++-------------- - 1 file changed, 17 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c -index e6fd355a2e92..de83714f0d40 100644 ---- a/drivers/media/v4l2-core/v4l2-ioctl.c -+++ b/drivers/media/v4l2-core/v4l2-ioctl.c -@@ -1347,23 +1347,23 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) - case V4L2_PIX_FMT_YUV420: descr = "Planar YUV 4:2:0"; break; - case V4L2_PIX_FMT_HI240: descr = "8-bit Dithered RGB (BTTV)"; break; - case V4L2_PIX_FMT_M420: descr = "YUV 4:2:0 (M420)"; break; -- case V4L2_PIX_FMT_NV12: descr = "Y/CbCr 4:2:0"; break; -- case V4L2_PIX_FMT_NV21: descr = "Y/CrCb 4:2:0"; break; -- case V4L2_PIX_FMT_NV16: descr = "Y/CbCr 4:2:2"; break; -- case V4L2_PIX_FMT_NV61: descr = "Y/CrCb 4:2:2"; break; -- case V4L2_PIX_FMT_NV24: descr = "Y/CbCr 4:4:4"; break; -- case V4L2_PIX_FMT_NV42: descr = "Y/CrCb 4:4:4"; break; -- case V4L2_PIX_FMT_P010: descr = "10-bit Y/CbCr 4:2:0"; break; -- case V4L2_PIX_FMT_NV12_4L4: descr = "Y/CbCr 4:2:0 (4x4 Linear)"; break; -- case V4L2_PIX_FMT_NV12_16L16: descr = "Y/CbCr 4:2:0 (16x16 Linear)"; break; -- case V4L2_PIX_FMT_NV12_32L32: descr = "Y/CbCr 4:2:0 (32x32 Linear)"; break; -- case V4L2_PIX_FMT_P010_4L4: descr = "10-bit Y/CbCr 4:2:0 (4x4 Linear)"; break; -- case V4L2_PIX_FMT_NV12M: descr = "Y/CbCr 4:2:0 (N-C)"; break; -- case V4L2_PIX_FMT_NV21M: descr = "Y/CrCb 4:2:0 (N-C)"; break; -- case V4L2_PIX_FMT_NV16M: descr = "Y/CbCr 4:2:2 (N-C)"; break; -- case V4L2_PIX_FMT_NV61M: descr = "Y/CrCb 4:2:2 (N-C)"; break; -- case V4L2_PIX_FMT_NV12MT: descr = "Y/CbCr 4:2:0 (64x32 MB, N-C)"; break; -- case V4L2_PIX_FMT_NV12MT_16X16: descr = "Y/CbCr 4:2:0 (16x16 MB, N-C)"; break; -+ case V4L2_PIX_FMT_NV12: descr = "Y/UV 4:2:0"; break; -+ case V4L2_PIX_FMT_NV21: descr = "Y/VU 4:2:0"; break; -+ case V4L2_PIX_FMT_NV16: descr = "Y/UV 4:2:2"; break; -+ case V4L2_PIX_FMT_NV61: descr = "Y/VU 4:2:2"; break; -+ case V4L2_PIX_FMT_NV24: descr = "Y/UV 4:4:4"; break; -+ case V4L2_PIX_FMT_NV42: descr = "Y/VU 4:4:4"; break; -+ case V4L2_PIX_FMT_P010: descr = "10-bit Y/UV 4:2:0"; break; -+ case V4L2_PIX_FMT_NV12_4L4: descr = "Y/UV 4:2:0 (4x4 Linear)"; break; -+ case V4L2_PIX_FMT_NV12_16L16: descr = "Y/UV 4:2:0 (16x16 Linear)"; break; -+ case V4L2_PIX_FMT_NV12_32L32: descr = "Y/UV 4:2:0 (32x32 Linear)"; break; -+ case V4L2_PIX_FMT_P010_4L4: descr = "10-bit Y/UV 4:2:0 (4x4 Linear)"; break; -+ case V4L2_PIX_FMT_NV12M: descr = "Y/UV 4:2:0 (N-C)"; break; -+ case V4L2_PIX_FMT_NV21M: descr = "Y/VU 4:2:0 (N-C)"; break; -+ case V4L2_PIX_FMT_NV16M: descr = "Y/UV 4:2:2 (N-C)"; break; -+ case V4L2_PIX_FMT_NV61M: descr = "Y/VU 4:2:2 (N-C)"; break; -+ case V4L2_PIX_FMT_NV12MT: descr = "Y/UV 4:2:0 (64x32 MB, N-C)"; break; -+ case V4L2_PIX_FMT_NV12MT_16X16: descr = "Y/UV 4:2:0 (16x16 MB, N-C)"; break; - case V4L2_PIX_FMT_YUV420M: descr = "Planar YUV 4:2:0 (N-C)"; break; - case V4L2_PIX_FMT_YVU420M: descr = "Planar YVU 4:2:0 (N-C)"; break; - case V4L2_PIX_FMT_YUV422M: descr = "Planar YUV 4:2:2 (N-C)"; break; From 621d56d0b9325c7bd1c3ebe0ba187b002eb795f8 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 30 Dec 2022 03:41:20 +0000 Subject: [PATCH 3/4] linux (NXP iMX8): rebase patches for 6.1.2-rc1 --- ...1-drm-bridge-mhdp-Add-cdns-mhdp-driver-bridge-driver.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/NXP/devices/iMX8/patches/linux/0001-drm-bridge-mhdp-Add-cdns-mhdp-driver-bridge-driver.patch b/projects/NXP/devices/iMX8/patches/linux/0001-drm-bridge-mhdp-Add-cdns-mhdp-driver-bridge-driver.patch index 43c18842b8..cb984a03e0 100644 --- a/projects/NXP/devices/iMX8/patches/linux/0001-drm-bridge-mhdp-Add-cdns-mhdp-driver-bridge-driver.patch +++ b/projects/NXP/devices/iMX8/patches/linux/0001-drm-bridge-mhdp-Add-cdns-mhdp-driver-bridge-driver.patch @@ -4028,8 +4028,8 @@ index a4a45daf93f2..058bc372f02b 100644 video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC); video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC); -- memcpy(&dp->mode, adjusted, sizeof(*mode)); -+ memcpy(&dp->mhdp.mode, adjusted, sizeof(*mode)); +- drm_mode_copy(&dp->mode, adjusted); ++ drm_mode_copy(&dp->mhdp.mode, adjusted); } static bool cdn_dp_check_link_status(struct cdn_dp_device *dp) From 42997d8fa0cf5d9a88d54516a7f1fd882687005b Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sat, 31 Dec 2022 23:08:49 +0000 Subject: [PATCH 4/4] linux: update to 6.1.2 --- packages/linux/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index b91cab3119..3aadf34602 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -28,8 +28,8 @@ case "${LINUX}" in PKG_SOURCE_NAME="linux-${LINUX}-${PKG_VERSION}.tar.gz" ;; *) - PKG_VERSION="6.1.1" - PKG_SHA256="a3e61377cf4435a9e2966b409a37a1056f6aaa59e561add9125a88e3c0971dfb" + PKG_VERSION="6.1.2" + PKG_SHA256="ee41f3c4f599b2f46f08aae428c9243db403e7292eb2c9f04ee34909b038d1ae" PKG_URL="https://www.kernel.org/pub/linux/kernel/v${PKG_VERSION/.*/}.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_PATCH_DIRS="default" ;;