mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-04 04:54:18 +00:00
5158e28769
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.64 Manually rebased: generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch Removed upstreamed: bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch[1] bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch[2] bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch[3] bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch[4] ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch[5] ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch[6] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=223ee2567a55e4f80315c768d2969e6a3b9fb23d 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=8182b5ca19c6f173b6498d1c6d3e4b034b76bbde 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=52c1716f65a558174e381360bd88f18dae4be85c 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=9728b508b01a5eeeac79ceb676364c674dd951ac 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=f85a1d06afbcc57ac44176db8f9d7a934979952c 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=fbb13732c6ffa9d58cedafabcd5ce8fd7ef8ae5a Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Co-authored-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: John Audia <therealgraysky@proton.me> Link: https://github.com/openwrt/openwrt/pull/17217 Signed-off-by: Robert Marko <robimarko@gmail.com>
106 lines
3.2 KiB
Diff
106 lines
3.2 KiB
Diff
From 50a879cfdb87baad4edb50f7b443177a592998ed Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Mon, 14 Jun 2021 15:28:30 +0200
|
|
Subject: [PATCH 0010/1085] drm/vc4: hvs: Force modeset on gamma lut change
|
|
|
|
The HVS Gamma block can only be updated when idle, so we need to disable
|
|
the HVS channel when the gamma property is set in an atomic commit.
|
|
|
|
Since the pixelvalve cannot have its assigned channel halted without
|
|
stalling unless it's disabled as well, in our case that means forcing a
|
|
full disable / enable cycle on the pipeline.
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/gpu/drm/vc4/vc4_crtc.c | 17 +++++++++++++++++
|
|
drivers/gpu/drm/vc4/vc4_drv.h | 3 +++
|
|
drivers/gpu/drm/vc4/vc4_hvs.c | 32 +++++++++++++++++++++++++++++++-
|
|
3 files changed, 51 insertions(+), 1 deletion(-)
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
|
|
@@ -303,6 +303,23 @@ struct drm_encoder *vc4_get_crtc_encoder
|
|
return NULL;
|
|
}
|
|
|
|
+#define drm_for_each_connector_mask(connector, dev, connector_mask) \
|
|
+ list_for_each_entry((connector), &(dev)->mode_config.connector_list, head) \
|
|
+ for_each_if ((connector_mask) & drm_connector_mask(connector))
|
|
+
|
|
+struct drm_connector *vc4_get_crtc_connector(struct drm_crtc *crtc,
|
|
+ struct drm_crtc_state *state)
|
|
+{
|
|
+ struct drm_connector *connector;
|
|
+
|
|
+ WARN_ON(hweight32(state->connector_mask) > 1);
|
|
+
|
|
+ drm_for_each_connector_mask(connector, crtc->dev, state->connector_mask)
|
|
+ return connector;
|
|
+
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
static void vc4_crtc_pixelvalve_reset(struct drm_crtc *crtc)
|
|
{
|
|
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
|
--- a/drivers/gpu/drm/vc4/vc4_drv.h
|
|
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
|
|
@@ -614,6 +614,9 @@ vc4_crtc_to_vc4_pv_data(const struct vc4
|
|
return container_of_const(data, struct vc4_pv_data, base);
|
|
}
|
|
|
|
+struct drm_connector *vc4_get_crtc_connector(struct drm_crtc *crtc,
|
|
+ struct drm_crtc_state *state);
|
|
+
|
|
struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc,
|
|
struct drm_crtc_state *state);
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
|
@@ -599,6 +599,36 @@ out:
|
|
drm_dev_exit(idx);
|
|
}
|
|
|
|
+static int vc4_hvs_gamma_check(struct drm_crtc *crtc,
|
|
+ struct drm_atomic_state *state)
|
|
+{
|
|
+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
|
|
+ struct drm_connector_state *conn_state;
|
|
+ struct drm_connector *connector;
|
|
+ struct drm_device *dev = crtc->dev;
|
|
+ struct vc4_dev *vc4 = to_vc4_dev(dev);
|
|
+
|
|
+ if (!vc4->is_vc5)
|
|
+ return 0;
|
|
+
|
|
+ if (!crtc_state->color_mgmt_changed)
|
|
+ return 0;
|
|
+
|
|
+ connector = vc4_get_crtc_connector(crtc, crtc_state);
|
|
+ if (!connector)
|
|
+ return -EINVAL;
|
|
+
|
|
+ if (!(connector->connector_type == DRM_MODE_CONNECTOR_HDMIA))
|
|
+ return 0;
|
|
+
|
|
+ conn_state = drm_atomic_get_connector_state(state, connector);
|
|
+ if (!conn_state)
|
|
+ return -EINVAL;
|
|
+
|
|
+ crtc_state->mode_changed = true;
|
|
+ return 0;
|
|
+}
|
|
+
|
|
int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
|
|
{
|
|
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
|
|
@@ -629,7 +659,7 @@ int vc4_hvs_atomic_check(struct drm_crtc
|
|
if (ret)
|
|
return ret;
|
|
|
|
- return 0;
|
|
+ return vc4_hvs_gamma_check(crtc, state);
|
|
}
|
|
|
|
static void vc4_hvs_install_dlist(struct drm_crtc *crtc)
|