mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
20ea6adbf1
Build system: x86_64 Build-tested: bcm2708, bcm2709, bcm2710, bcm2711 Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B Signed-off-by: Marty Jones <mj8263788@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
72 lines
2.4 KiB
Diff
72 lines
2.4 KiB
Diff
From 849b51e0dea1746f17b8b0b59c5e6cc831e23697 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Mon, 6 Dec 2021 16:31:33 +0100
|
|
Subject: [PATCH] drm/vc4: hvs: Move the dlist setup to its own
|
|
function
|
|
|
|
The vc4_hvs_update_dlist function mostly deals with setting up the
|
|
vblank events and setting up the dlist entry pointer to our current
|
|
active one.
|
|
|
|
We'll want to do the former separately from the vblank handling in later
|
|
patches, so let's move it to a function of its own.
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/gpu/drm/vc4/vc4_hvs.c | 19 ++++++++++++++-----
|
|
1 file changed, 14 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_hvs.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hvs.c
|
|
@@ -596,10 +596,19 @@ int vc4_hvs_atomic_check(struct drm_crtc
|
|
return vc4_hvs_gamma_check(crtc, state);
|
|
}
|
|
|
|
-static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
|
|
+static void vc4_hvs_install_dlist(struct drm_crtc *crtc)
|
|
{
|
|
struct drm_device *dev = crtc->dev;
|
|
struct vc4_dev *vc4 = to_vc4_dev(dev);
|
|
+ struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
|
|
+
|
|
+ HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel),
|
|
+ vc4_state->mm.start);
|
|
+}
|
|
+
|
|
+static void vc4_hvs_update_dlist(struct drm_crtc *crtc)
|
|
+{
|
|
+ struct drm_device *dev = crtc->dev;
|
|
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
|
struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
|
|
unsigned long flags;
|
|
@@ -619,9 +628,6 @@ static void vc4_hvs_update_dlist(struct
|
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
|
}
|
|
|
|
- HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel),
|
|
- vc4_state->mm.start);
|
|
-
|
|
spin_lock_irqsave(&vc4_crtc->irq_lock, flags);
|
|
vc4_crtc->current_dlist = vc4_state->mm.start;
|
|
spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags);
|
|
@@ -648,6 +654,7 @@ void vc4_hvs_atomic_enable(struct drm_cr
|
|
struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
|
|
bool oneshot = vc4_crtc->feeds_txp;
|
|
|
|
+ vc4_hvs_install_dlist(crtc);
|
|
vc4_hvs_update_dlist(crtc);
|
|
vc4_hvs_init_channel(vc4, crtc, mode, oneshot);
|
|
}
|
|
@@ -723,8 +730,10 @@ void vc4_hvs_atomic_flush(struct drm_crt
|
|
* If the CRTC is being disabled, there's no point in updating this
|
|
* information.
|
|
*/
|
|
- if (crtc->state->active && old_state->active)
|
|
+ if (crtc->state->active && old_state->active) {
|
|
+ vc4_hvs_install_dlist(crtc);
|
|
vc4_hvs_update_dlist(crtc);
|
|
+ }
|
|
|
|
if (crtc->state->color_mgmt_changed) {
|
|
u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel));
|