mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
linux (Allwinner): rebase and update patches for 6.11
The following changes were introduced in 6.11-rc1 and 6.11-rc7 only pass 3 variables to - of: remove internal arguments from of_property_for_each_u32() -9722c3b66e
6.11-rc7 has refactored drm9da7ec9b19
resulting in the following compile error. build.LibreELEC-H6.aarch64-13.0-devel/toolchain/bin/aarch64-libreelec-linux-gnu-ld: drivers/gpu/drm/sun4i/sun8i_dw_hdmi.o: in function `sun8i_dw_hdmi_bind': build.LibreELEC-H6.aarch64-13.0-devel/build/linux-6.11-rc7/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c:394:(.text+0x73c): undefined reference to `drm_bridge_connector_init' Co-authored-by: Jernej Skrabec <jernej.skrabec@gmail.com>
This commit is contained in:
parent
219a01e2fc
commit
33b0203020
@ -62,14 +62,14 @@ again for each clock, which is part of why I didn't do it that way.
|
|||||||
|
|
||||||
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
Signed-off-by: Samuel Holland <samuel@sholland.org>
|
||||||
---
|
---
|
||||||
drivers/clk/clk-conf.c | 54 ++++++++++++++++++++++++++++++++++++++++++
|
drivers/clk/clk-conf.c | 56 ++++++++++++++++++++++++++++++++++++++++++
|
||||||
drivers/clk/clk.c | 31 ++++++++++++++++++++++++
|
drivers/clk/clk.c | 31 ++++++++++++++++++++++++
|
||||||
drivers/clk/clk.h | 2 ++
|
drivers/clk/clk.h | 2 ++
|
||||||
3 files changed, 87 insertions(+)
|
3 files changed, 87 insertions(+)
|
||||||
|
|
||||||
--- a/drivers/clk/clk-conf.c
|
--- a/drivers/clk/clk-conf.c
|
||||||
+++ b/drivers/clk/clk-conf.c
|
+++ b/drivers/clk/clk-conf.c
|
||||||
@@ -11,6 +11,54 @@
|
@@ -11,6 +11,56 @@
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/printk.h>
|
#include <linux/printk.h>
|
||||||
|
|
||||||
@ -93,7 +93,9 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
|
|||||||
+ clkspec.np = node;
|
+ clkspec.np = node;
|
||||||
+ clkspec.args_count = nr_cells;
|
+ clkspec.args_count = nr_cells;
|
||||||
+
|
+
|
||||||
+ of_property_for_each_u32(node, "protected-clocks", prop, cur, clkspec.args[0]) {
|
+ prop = of_find_property(node, "protected-clocks", NULL);
|
||||||
|
+ for (cur = of_prop_next_u32(prop, NULL, &clkspec.args[0]); cur;
|
||||||
|
+ cur = of_prop_next_u32(prop, cur, &clkspec.args[0])) {
|
||||||
+ /* read the remainder of the clock specifier */
|
+ /* read the remainder of the clock specifier */
|
||||||
+ for (i = 1; i < nr_cells; ++i) {
|
+ for (i = 1; i < nr_cells; ++i) {
|
||||||
+ cur = of_prop_next_u32(prop, cur, &clkspec.args[i]);
|
+ cur = of_prop_next_u32(prop, cur, &clkspec.args[i]);
|
||||||
|
@ -15,7 +15,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
|
|||||||
|
|
||||||
--- a/drivers/clk/qcom/common.c
|
--- a/drivers/clk/qcom/common.c
|
||||||
+++ b/drivers/clk/qcom/common.c
|
+++ b/drivers/clk/qcom/common.c
|
||||||
@@ -194,22 +194,6 @@ int qcom_cc_register_sleep_clk(struct de
|
@@ -223,20 +223,6 @@ int qcom_cc_register_sleep_clk(struct de
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(qcom_cc_register_sleep_clk);
|
EXPORT_SYMBOL_GPL(qcom_cc_register_sleep_clk);
|
||||||
|
|
||||||
@ -23,11 +23,9 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
|
|||||||
-static void qcom_cc_drop_protected(struct device *dev, struct qcom_cc *cc)
|
-static void qcom_cc_drop_protected(struct device *dev, struct qcom_cc *cc)
|
||||||
-{
|
-{
|
||||||
- struct device_node *np = dev->of_node;
|
- struct device_node *np = dev->of_node;
|
||||||
- struct property *prop;
|
|
||||||
- const __be32 *p;
|
|
||||||
- u32 i;
|
- u32 i;
|
||||||
-
|
-
|
||||||
- of_property_for_each_u32(np, "protected-clocks", prop, p, i) {
|
- of_property_for_each_u32(np, "protected-clocks", i) {
|
||||||
- if (i >= cc->num_rclks)
|
- if (i >= cc->num_rclks)
|
||||||
- continue;
|
- continue;
|
||||||
-
|
-
|
||||||
@ -38,7 +36,7 @@ Signed-off-by: Samuel Holland <samuel@sholland.org>
|
|||||||
static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
|
static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
@@ -272,8 +256,6 @@ int qcom_cc_really_probe(struct platform
|
@@ -330,8 +314,6 @@ int qcom_cc_really_probe(struct platform
|
||||||
cc->rclks = rclks;
|
cc->rclks = rclks;
|
||||||
cc->num_rclks = num_clks;
|
cc->num_rclks = num_clks;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
aquantia-objs += aquantia_main.o
|
aquantia-objs += aquantia_main.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/net/phy/ac200.c
|
+++ b/drivers/net/phy/ac200.c
|
||||||
@@ -0,0 +1,234 @@
|
@@ -0,0 +1,232 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0+
|
+// SPDX-License-Identifier: GPL-2.0+
|
||||||
+/**
|
+/**
|
||||||
+ * Driver for AC200 Ethernet PHY
|
+ * Driver for AC200 Ethernet PHY
|
||||||
@ -242,7 +242,7 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static int ac200_ephy_remove(struct platform_device *pdev)
|
+static void ac200_ephy_remove(struct platform_device *pdev)
|
||||||
+{
|
+{
|
||||||
+ struct ac200_ephy_dev *priv = platform_get_drvdata(pdev);
|
+ struct ac200_ephy_dev *priv = platform_get_drvdata(pdev);
|
||||||
+
|
+
|
||||||
@ -251,8 +251,6 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
+ regmap_write(priv->regmap, AC200_EPHY_CTL, AC200_EPHY_SHUTDOWN);
|
+ regmap_write(priv->regmap, AC200_EPHY_CTL, AC200_EPHY_SHUTDOWN);
|
||||||
+ regmap_write(priv->regmap, AC200_SYS_EPHY_CTL1, 0);
|
+ regmap_write(priv->regmap, AC200_SYS_EPHY_CTL1, 0);
|
||||||
+ regmap_write(priv->regmap, AC200_SYS_EPHY_CTL0, 0);
|
+ regmap_write(priv->regmap, AC200_SYS_EPHY_CTL0, 0);
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static const struct of_device_id ac200_ephy_match[] = {
|
+static const struct of_device_id ac200_ephy_match[] = {
|
||||||
|
@ -47,7 +47,7 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
+obj-$(CONFIG_VIDEO_SUN50I_DEINTERLACE) += sun50i-di.o
|
+obj-$(CONFIG_VIDEO_SUN50I_DEINTERLACE) += sun50i-di.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.c
|
+++ b/drivers/media/platform/sunxi/sun50i-di/sun50i-di.c
|
||||||
@@ -0,0 +1,1137 @@
|
@@ -0,0 +1,1135 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0
|
+// SPDX-License-Identifier: GPL-2.0
|
||||||
+/*
|
+/*
|
||||||
+ * Allwinner sun50i deinterlacer driver
|
+ * Allwinner sun50i deinterlacer driver
|
||||||
@ -1087,7 +1087,7 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
+ return ret;
|
+ return ret;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static int deinterlace_remove(struct platform_device *pdev)
|
+static void deinterlace_remove(struct platform_device *pdev)
|
||||||
+{
|
+{
|
||||||
+ struct deinterlace_dev *dev = platform_get_drvdata(pdev);
|
+ struct deinterlace_dev *dev = platform_get_drvdata(pdev);
|
||||||
+
|
+
|
||||||
@ -1096,8 +1096,6 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
|
|||||||
+ v4l2_device_unregister(&dev->v4l2_dev);
|
+ v4l2_device_unregister(&dev->v4l2_dev);
|
||||||
+
|
+
|
||||||
+ pm_runtime_force_suspend(&pdev->dev);
|
+ pm_runtime_force_suspend(&pdev->dev);
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static int deinterlace_runtime_resume(struct device *device)
|
+static int deinterlace_runtime_resume(struct device *device)
|
||||||
|
@ -18,7 +18,7 @@ diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
|
|||||||
index d7c5e9b1a087..9944266c4f58 100644
|
index d7c5e9b1a087..9944266c4f58 100644
|
||||||
--- a/drivers/iommu/sun50i-iommu.c
|
--- a/drivers/iommu/sun50i-iommu.c
|
||||||
+++ b/drivers/iommu/sun50i-iommu.c
|
+++ b/drivers/iommu/sun50i-iommu.c
|
||||||
@@ -593,10 +593,12 @@ static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
|
@@ -598,10 +598,12 @@ static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
|
||||||
{
|
{
|
||||||
struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
|
struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);
|
||||||
struct sun50i_iommu *iommu = sun50i_domain->iommu;
|
struct sun50i_iommu *iommu = sun50i_domain->iommu;
|
||||||
@ -29,9 +29,9 @@ index d7c5e9b1a087..9944266c4f58 100644
|
|||||||
|
|
||||||
+ pages = size / SPAGE_SIZE;
|
+ pages = size / SPAGE_SIZE;
|
||||||
+
|
+
|
||||||
page_table = sun50i_dte_get_page_table(sun50i_domain, iova, gfp);
|
/* the IOMMU can only handle 32-bit addresses, both input and output */
|
||||||
if (IS_ERR(page_table)) {
|
if ((uint64_t)paddr >> 32) {
|
||||||
ret = PTR_ERR(page_table);
|
ret = -EINVAL;
|
||||||
@@ -604,18 +606,21 @@ static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
|
@@ -604,18 +606,21 @@ static int sun50i_iommu_map(struct iommu_domain *domain, unsigned long iova,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,17 @@ Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
|
|||||||
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 5 ++
|
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h | 5 ++
|
||||||
2 files changed, 117 insertions(+), 2 deletions(-)
|
2 files changed, 117 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig
|
||||||
|
--- a/drivers/gpu/drm/sun4i/Kconfig
|
||||||
|
+++ b/drivers/gpu/drm/sun4i/Kconfig
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
tristate "DRM Support for Allwinner A10 Display Engine"
|
||||||
|
depends on DRM && COMMON_CLK
|
||||||
|
depends on ARCH_SUNXI || COMPILE_TEST
|
||||||
|
+ select DRM_BRIDGE_CONNECTOR
|
||||||
|
select DRM_GEM_DMA_HELPER
|
||||||
|
select DRM_KMS_HELPER
|
||||||
|
select DRM_PANEL
|
||||||
diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
|
diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
|
||||||
index 8f8d3bdba5ce..93831cdf1917 100644
|
index 8f8d3bdba5ce..93831cdf1917 100644
|
||||||
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
|
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
|
||||||
|
@ -16,10 +16,10 @@ diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2
|
|||||||
index f4d9d6279094..1e07066fa129 100644
|
index f4d9d6279094..1e07066fa129 100644
|
||||||
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
|
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
|
||||||
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
|
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
|
||||||
@@ -1510,6 +1510,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
|
@@ -1542,6 +1542,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
|
||||||
case V4L2_PIX_FMT_MT2110T: descr = "Mediatek 10bit Tile Mode"; break;
|
case V4L2_PIX_FMT_PISP_COMP2_GBRG: descr = "PiSP 8b GBGB/RGRG mode2 compr"; break;
|
||||||
case V4L2_PIX_FMT_MT2110R: descr = "Mediatek 10bit Raster Mode"; break;
|
case V4L2_PIX_FMT_PISP_COMP2_BGGR: descr = "PiSP 8b BGBG/GRGR mode2 compr"; break;
|
||||||
case V4L2_PIX_FMT_HEXTILE: descr = "Hextile Compressed Format"; break;
|
case V4L2_PIX_FMT_PISP_COMP2_MONO: descr = "PiSP 8b monochrome mode2 compr"; break;
|
||||||
+ case V4L2_PIX_FMT_YUV420_8_AFBC_16X16_SPLIT: descr = "YUV 4:2:0 (AFBC 16x16)"; break;
|
+ case V4L2_PIX_FMT_YUV420_8_AFBC_16X16_SPLIT: descr = "YUV 4:2:0 (AFBC 16x16)"; break;
|
||||||
+ case V4L2_PIX_FMT_YUV420_10_AFBC_16X16_SPLIT: descr = "10-bit YUV 4:2:0 (AFBC 16x16)"; break;
|
+ case V4L2_PIX_FMT_YUV420_10_AFBC_16X16_SPLIT: descr = "10-bit YUV 4:2:0 (AFBC 16x16)"; break;
|
||||||
default:
|
default:
|
||||||
|
@ -17,22 +17,24 @@ diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8
|
|||||||
index 884abe3cf773..91781b5bbbbc 100644
|
index 884abe3cf773..91781b5bbbbc 100644
|
||||||
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
|
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
|
||||||
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
|
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
|
||||||
@@ -365,6 +365,10 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
@@ -295,6 +295,11 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
||||||
if (!layer)
|
if (!layer)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
+ layer->mixer = mixer;
|
+ layer->mixer = mixer;
|
||||||
|
+ layer->type = SUN8I_LAYER_TYPE_UI;
|
||||||
+ layer->channel = channel;
|
+ layer->channel = channel;
|
||||||
+ layer->overlay = 0;
|
+ layer->overlay = 0;
|
||||||
+
|
+
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
type = DRM_PLANE_TYPE_PRIMARY;
|
type = DRM_PLANE_TYPE_PRIMARY;
|
||||||
|
|
||||||
@@ -395,9 +399,6 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
@@ -325,10 +330,6 @@ struct sun8i_ui_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_plane_helper_add(&layer->plane, &sun8i_ui_layer_helper_funcs);
|
drm_plane_helper_add(&layer->plane, &sun8i_ui_layer_helper_funcs);
|
||||||
- layer->mixer = mixer;
|
- layer->mixer = mixer;
|
||||||
|
- layer->type = SUN8I_LAYER_TYPE_UI;
|
||||||
- layer->channel = channel;
|
- layer->channel = channel;
|
||||||
- layer->overlay = 0;
|
- layer->overlay = 0;
|
||||||
|
|
||||||
@ -42,22 +44,24 @@ diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8
|
|||||||
index 6ee3790a2a81..329e8bf8cd20 100644
|
index 6ee3790a2a81..329e8bf8cd20 100644
|
||||||
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
||||||
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
||||||
@@ -549,6 +549,10 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
@@ -478,6 +478,11 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
||||||
if (!layer)
|
if (!layer)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
+ layer->mixer = mixer;
|
+ layer->mixer = mixer;
|
||||||
|
+ layer->type = SUN8I_LAYER_TYPE_VI;
|
||||||
+ layer->channel = index;
|
+ layer->channel = index;
|
||||||
+ layer->overlay = 0;
|
+ layer->overlay = 0;
|
||||||
+
|
+
|
||||||
if (mixer->cfg->is_de3) {
|
if (mixer->cfg->is_de3) {
|
||||||
formats = sun8i_vi_layer_de3_formats;
|
formats = sun8i_vi_layer_de3_formats;
|
||||||
format_count = ARRAY_SIZE(sun8i_vi_layer_de3_formats);
|
format_count = ARRAY_SIZE(sun8i_vi_layer_de3_formats);
|
||||||
@@ -607,9 +611,6 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
@@ -543,10 +549,6 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_plane_helper_add(&layer->plane, &sun8i_vi_layer_helper_funcs);
|
drm_plane_helper_add(&layer->plane, &sun8i_vi_layer_helper_funcs);
|
||||||
- layer->mixer = mixer;
|
- layer->mixer = mixer;
|
||||||
|
- layer->type = SUN8I_LAYER_TYPE_VI;
|
||||||
- layer->channel = index;
|
- layer->channel = index;
|
||||||
- layer->overlay = 0;
|
- layer->overlay = 0;
|
||||||
|
|
||||||
|
@ -372,6 +372,26 @@ index 000000000000..cea685c86855
|
|||||||
+void sun50i_afbc_disable(struct sun8i_mixer *mixer, unsigned int channel);
|
+void sun50i_afbc_disable(struct sun8i_mixer *mixer, unsigned int channel);
|
||||||
+
|
+
|
||||||
+#endif
|
+#endif
|
||||||
|
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
|
||||||
|
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
|
||||||
|
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
|
||||||
|
@@ -26,6 +26,7 @@
|
||||||
|
#include <uapi/linux/media-bus-format.h>
|
||||||
|
|
||||||
|
#include "sun4i_drv.h"
|
||||||
|
+#include "sun50i_afbc.h"
|
||||||
|
#include "sun50i_fmt.h"
|
||||||
|
#include "sun8i_mixer.h"
|
||||||
|
#include "sun8i_ui_layer.h"
|
||||||
|
@@ -272,6 +273,8 @@
|
||||||
|
val = enable ? SUN8I_MIXER_CHAN_VI_LAYER_ATTR_EN : 0;
|
||||||
|
mask = SUN8I_MIXER_CHAN_VI_LAYER_ATTR_EN;
|
||||||
|
reg = SUN8I_MIXER_CHAN_VI_LAYER_ATTR(ch_base, layer->overlay);
|
||||||
|
+ if (!enable && layer->mixer->cfg->is_de3)
|
||||||
|
+ sun50i_afbc_disable(layer->mixer, layer->channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
regmap_update_bits(layer->mixer->engine.regs, reg, mask, val);
|
||||||
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
||||||
index 329e8bf8cd20..bda91c3e2bb7 100644
|
index 329e8bf8cd20..bda91c3e2bb7 100644
|
||||||
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
|
||||||
@ -414,7 +434,7 @@ index 329e8bf8cd20..bda91c3e2bb7 100644
|
|||||||
DRM_DEBUG_DRIVER("Using horizontal coarse scaling\n");
|
DRM_DEBUG_DRIVER("Using horizontal coarse scaling\n");
|
||||||
hm = src_w;
|
hm = src_w;
|
||||||
hn = scanline;
|
hn = scanline;
|
||||||
@@ -356,6 +358,15 @@ static int sun8i_vi_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
|
@@ -307,6 +309,15 @@ static int sun8i_vi_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,34 +450,20 @@ index 329e8bf8cd20..bda91c3e2bb7 100644
|
|||||||
static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,
|
static int sun8i_vi_layer_atomic_check(struct drm_plane *plane,
|
||||||
struct drm_atomic_state *state)
|
struct drm_atomic_state *state)
|
||||||
{
|
{
|
||||||
@@ -399,6 +410,8 @@ static void sun8i_vi_layer_atomic_disable(struct drm_plane *plane,
|
@@ -346,19 +357,44 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
|
||||||
|
plane);
|
||||||
sun8i_vi_layer_enable(mixer, layer->channel, layer->overlay, false, 0,
|
struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
|
||||||
old_zpos);
|
|
||||||
+ if (mixer->cfg->is_de3)
|
|
||||||
+ sun50i_afbc_disable(mixer, layer->channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
|
|
||||||
@@ -411,26 +424,53 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
|
|
||||||
struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
|
|
||||||
unsigned int zpos = new_state->normalized_zpos;
|
unsigned int zpos = new_state->normalized_zpos;
|
||||||
unsigned int old_zpos = old_state->normalized_zpos;
|
|
||||||
+ struct drm_framebuffer *fb = plane->state->fb;
|
+ struct drm_framebuffer *fb = plane->state->fb;
|
||||||
struct sun8i_mixer *mixer = layer->mixer;
|
struct sun8i_mixer *mixer = layer->mixer;
|
||||||
+ bool afbc = drm_is_afbc(fb->modifier);
|
+ bool afbc = drm_is_afbc(fb->modifier);
|
||||||
|
|
||||||
if (!new_state->visible) {
|
if (!new_state->crtc || !new_state->visible)
|
||||||
sun8i_vi_layer_enable(mixer, layer->channel,
|
|
||||||
layer->overlay, false, 0, old_zpos);
|
|
||||||
+ if (mixer->cfg->is_de3)
|
|
||||||
+ sun50i_afbc_disable(mixer, layer->channel);
|
|
||||||
return;
|
return;
|
||||||
}
|
+
|
||||||
|
|
||||||
+ if (afbc) {
|
+ if (afbc) {
|
||||||
+ u32 fmt_type;
|
+ u32 fmt_type;
|
||||||
+
|
|
||||||
+ sun8i_vi_layer_prepare_non_linear(mixer, layer->channel,
|
+ sun8i_vi_layer_prepare_non_linear(mixer, layer->channel,
|
||||||
+ layer->overlay);
|
+ layer->overlay);
|
||||||
+ sun50i_afbc_atomic_update(mixer, layer->channel, plane);
|
+ sun50i_afbc_atomic_update(mixer, layer->channel, plane);
|
||||||
@ -485,21 +491,17 @@ index 329e8bf8cd20..bda91c3e2bb7 100644
|
|||||||
- sun8i_vi_layer_update_buffer(mixer, layer->channel,
|
- sun8i_vi_layer_update_buffer(mixer, layer->channel,
|
||||||
- layer->overlay, plane);
|
- layer->overlay, plane);
|
||||||
+ layer->overlay, plane, zpos, afbc);
|
+ layer->overlay, plane, zpos, afbc);
|
||||||
sun8i_vi_layer_enable(mixer, layer->channel, layer->overlay,
|
+}
|
||||||
true, zpos, old_zpos);
|
+
|
||||||
}
|
|
||||||
|
|
||||||
+static bool sun8i_vi_layer_format_mod_supported(struct drm_plane *plane,
|
+static bool sun8i_vi_layer_format_mod_supported(struct drm_plane *plane,
|
||||||
+ u32 format, u64 modifier)
|
+ u32 format, u64 modifier)
|
||||||
+{
|
+{
|
||||||
+ struct sun8i_vi_layer *layer = plane_to_sun8i_vi_layer(plane);
|
+ struct sun8i_layer *layer = plane_to_sun8i_layer(plane);
|
||||||
+
|
+
|
||||||
+ return sun50i_afbc_format_mod_supported(layer->mixer, format, modifier);
|
+ return sun50i_afbc_format_mod_supported(layer->mixer, format, modifier);
|
||||||
+}
|
}
|
||||||
+
|
|
||||||
static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = {
|
static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = {
|
||||||
.atomic_check = sun8i_vi_layer_atomic_check,
|
|
||||||
.atomic_disable = sun8i_vi_layer_atomic_disable,
|
|
||||||
@@ -444,6 +484,7 @@ static const struct drm_plane_funcs sun8i_vi_layer_funcs = {
|
@@ -444,6 +484,7 @@ static const struct drm_plane_funcs sun8i_vi_layer_funcs = {
|
||||||
.disable_plane = drm_atomic_helper_disable_plane,
|
.disable_plane = drm_atomic_helper_disable_plane,
|
||||||
.reset = drm_atomic_helper_plane_reset,
|
.reset = drm_atomic_helper_plane_reset,
|
||||||
@ -536,13 +538,13 @@ index 329e8bf8cd20..bda91c3e2bb7 100644
|
|||||||
+ DRM_FORMAT_MOD_INVALID
|
+ DRM_FORMAT_MOD_INVALID
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
struct sun8i_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
||||||
struct sun8i_mixer *mixer,
|
struct sun8i_mixer *mixer,
|
||||||
int index)
|
int index)
|
||||||
@@ -542,6 +600,7 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
@@ -542,6 +600,7 @@ struct sun8i_vi_layer *sun8i_vi_layer_init_one(struct drm_device *drm,
|
||||||
u32 supported_encodings, supported_ranges;
|
u32 supported_encodings, supported_ranges;
|
||||||
unsigned int plane_cnt, format_count;
|
unsigned int plane_cnt, format_count;
|
||||||
struct sun8i_vi_layer *layer;
|
struct sun8i_layer *layer;
|
||||||
+ const uint64_t *modifiers;
|
+ const uint64_t *modifiers;
|
||||||
const u32 *formats;
|
const u32 *formats;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -216,18 +216,16 @@ index 581233d6eaf2..a5771b5d9b67 100644
|
|||||||
|
|
||||||
regs = devm_platform_ioremap_resource(pdev, 0);
|
regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(regs))
|
if (IS_ERR(regs))
|
||||||
@@ -727,8 +810,19 @@ static int sun8i_hdmi_phy_probe(struct platform_device *pdev)
|
@@ -727,8 +810,17 @@ static int sun8i_hdmi_phy_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
+static int sun8i_hdmi_phy_remove(struct platform_device *pdev)
|
+static void sun8i_hdmi_phy_remove(struct platform_device *pdev)
|
||||||
+{
|
+{
|
||||||
+ struct sun8i_hdmi_phy *phy = platform_get_drvdata(pdev);
|
+ struct sun8i_hdmi_phy *phy = platform_get_drvdata(pdev);
|
||||||
+
|
+
|
||||||
+ cec_notifier_cec_adap_unregister(phy->cec_notifier, phy->cec_adapter);
|
+ cec_notifier_cec_adap_unregister(phy->cec_notifier, phy->cec_adapter);
|
||||||
+ cec_unregister_adapter(phy->cec_adapter);
|
+ cec_unregister_adapter(phy->cec_adapter);
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
struct platform_driver sun8i_hdmi_phy_driver = {
|
struct platform_driver sun8i_hdmi_phy_driver = {
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
From 4a6926ea19c64b49e2bdeb30ceef98fc812cc52d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jernej Skrabec <jernej.skrabec@gmail.com>
|
||||||
|
Date: Thu, 19 Sep 2024 20:17:30 +0200
|
||||||
|
Subject: [PATCH] media: verisilicon: g2: Fix chroma offset calculation
|
||||||
|
|
||||||
|
Since bit depth may not be divisible by 8 (like 10 or 12), division must
|
||||||
|
be rounded up.
|
||||||
|
|
||||||
|
Fixes: 3eeaee737dce ("media: verisilicon: g2: Use common helpers to compute chroma and mv offsets")
|
||||||
|
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
|
||||||
|
---
|
||||||
|
drivers/media/platform/verisilicon/hantro_g2.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/media/platform/verisilicon/hantro_g2.c b/drivers/media/platform/verisilicon/hantro_g2.c
|
||||||
|
index b880a6849d5852..24ae7b69f6a0ae 100644
|
||||||
|
--- a/drivers/media/platform/verisilicon/hantro_g2.c
|
||||||
|
+++ b/drivers/media/platform/verisilicon/hantro_g2.c
|
||||||
|
@@ -47,7 +47,7 @@ irqreturn_t hantro_g2_irq(int irq, void *dev_id)
|
||||||
|
|
||||||
|
size_t hantro_g2_chroma_offset(struct hantro_ctx *ctx)
|
||||||
|
{
|
||||||
|
- return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 8;
|
||||||
|
+ return ctx->dst_fmt.width * ctx->dst_fmt.height * DIV_ROUND_UP(ctx->bit_depth, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t hantro_g2_motion_vectors_offset(struct hantro_ctx *ctx)
|
Loading…
x
Reference in New Issue
Block a user