Tweak vc4 vblank for stability, Fix for early boot on Dragonboard 410c

This commit is contained in:
Peter Robinson 2017-06-29 10:15:29 +01:00
parent f67065ddfa
commit 69f65af1c6
3 changed files with 103 additions and 52 deletions

View File

@ -1,49 +1,7 @@
From e487709ee89a572a3a8068f33e9275479fde9bf4 Mon Sep 17 00:00:00 2001 From d40a5938a10a3ba73bce6395729fefd8b8bb1c07 Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Fri, 16 Jun 2017 10:30:33 +0200
Subject: [PATCH 1/2] drm/vc4: Send a VBLANK event when disabling a CRTC
VBLANK events are missed when the CRTC is being disabled because the
driver does not wait till the end of the frame before stopping the
HVS and PV blocks. In this case, we should explicitly issue a VBLANK
event if there's one waiting.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/gpu/drm/vc4/vc4_crtc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 9fcf05ca492b..66cffc548af2 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -526,6 +526,19 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) &
(SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) !=
SCALER_DISPSTATX_EMPTY);
+
+ /*
+ * Make sure we issue a vblank event after disabling the CRTC if
+ * someone was waiting it.
+ */
+ if (crtc->state->event) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+ drm_crtc_send_vblank_event(crtc, crtc->state->event);
+ crtc->state->event = NULL;
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+ }
}
static void vc4_crtc_enable(struct drm_crtc *crtc)
--
2.13.0
From 6c9d1ad4c10657d7d6f8455088686abee1805102 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com> From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 26 Jun 2017 09:03:28 +0100 Date: Thu, 29 Jun 2017 10:05:05 +0100
Subject: [PATCH 2/2] drm/vc4: Fix VBLANK handling in crtc->enable() path Subject: [PATCH] drm/vc4: Fix VBLANK handling in crtc->enable() path
When we are enabling a CRTC, drm_crtc_vblank_get() is called before When we are enabling a CRTC, drm_crtc_vblank_get() is called before
drm_crtc_vblank_on(), which is not supposed to happen (hence the drm_crtc_vblank_on(), which is not supposed to happen (hence the
@ -56,11 +14,11 @@ Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
1 file changed, 43 insertions(+), 23 deletions(-) 1 file changed, 43 insertions(+), 23 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 66cffc548af2..47a8ef0a755d 100644 index d86c8cce3182..316bd6210d69 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c --- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -541,6 +541,34 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) @@ -530,6 +530,34 @@ static void vc4_crtc_disable(struct drm_crtc *crtc)
} SCALER_DISPSTATX_EMPTY);
} }
+static void vc4_crtc_update_dlist(struct drm_crtc *crtc) +static void vc4_crtc_update_dlist(struct drm_crtc *crtc)
@ -94,7 +52,7 @@ index 66cffc548af2..47a8ef0a755d 100644
static void vc4_crtc_enable(struct drm_crtc *crtc) static void vc4_crtc_enable(struct drm_crtc *crtc)
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
@@ -551,6 +579,12 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) @@ -540,6 +568,12 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
require_hvs_enabled(dev); require_hvs_enabled(dev);
@ -107,7 +65,7 @@ index 66cffc548af2..47a8ef0a755d 100644
/* Turn on the scaler, which will wait for vstart to start /* Turn on the scaler, which will wait for vstart to start
* compositing. * compositing.
*/ */
@@ -562,9 +596,6 @@ static void vc4_crtc_enable(struct drm_crtc *crtc) @@ -551,9 +585,6 @@ static void vc4_crtc_enable(struct drm_crtc *crtc)
/* Turn on the pixel valve, which will emit the vstart signal. */ /* Turn on the pixel valve, which will emit the vstart signal. */
CRTC_WRITE(PV_V_CONTROL, CRTC_WRITE(PV_V_CONTROL,
CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN); CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
@ -117,7 +75,7 @@ index 66cffc548af2..47a8ef0a755d 100644
} }
static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc, static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -619,7 +650,6 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, @@ -608,7 +639,6 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_dev *vc4 = to_vc4_dev(dev);
@ -125,7 +83,7 @@ index 66cffc548af2..47a8ef0a755d 100644
struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc->state);
struct drm_plane *plane; struct drm_plane *plane;
bool debug_dump_regs = false; bool debug_dump_regs = false;
@@ -641,25 +671,15 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, @@ -630,25 +660,15 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm.size); WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm.size);

View File

@ -609,6 +609,10 @@ Patch314: bcm2835-fix-potential-null-pointer-dereferences.patch
# https://patchwork.freedesktop.org/patch/161978/ # https://patchwork.freedesktop.org/patch/161978/
Patch315: bcm283x-vc4-fix-vblank.patch Patch315: bcm283x-vc4-fix-vblank.patch
# https://patchwork.kernel.org/patch/9815555/
# https://patchwork.kernel.org/patch/9815651/
Patch316: qcom-rmsg-spmi-fixes.patch
# 400 - IBM (ppc/s390x) patches # 400 - IBM (ppc/s390x) patches
# 500 - Temp fixes/CVEs etc # 500 - Temp fixes/CVEs etc
@ -2193,6 +2197,10 @@ fi
# #
# #
%changelog %changelog
* Wed Jun 28 2017 Peter Robinson <pbrobinson@fedoraproject.org>
- Tweak vc4 vblank for stability
- Fix for early boot on Dragonboard 410c
* Tue Jun 27 2017 Laura Abbott <labbott@fedoraproject.org> - 4.12.0-0.rc7.git1.1 * Tue Jun 27 2017 Laura Abbott <labbott@fedoraproject.org> - 4.12.0-0.rc7.git1.1
- Linux v4.12-rc7-8-g3c2bfba - Linux v4.12-rc7-8-g3c2bfba

View File

@ -0,0 +1,85 @@
From patchwork Wed Jun 28 21:53:23 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [v2] rpmsg: Make modalias work for DeviceTree based devices
From: Bjorn Andersson <bjorn.andersson@linaro.org>
X-Patchwork-Id: 9815555
Message-Id: <20170628215323.5658-1-bjorn.andersson@linaro.org>
To: Ohad Ben-Cohen <ohad@wizery.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
Rob Clark <robdclark@gmail.com>
Date: Wed, 28 Jun 2017 14:53:23 -0700
When rpmsg devices are expected to be matched based on their compatible
the modalias should reflect this, so that module autoloading has a
chance to match and load the appropriate module.
Tested-by: Rob Clark <robdclark@gmail.com>
Reported-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
- Also update rpmsg_uevent()
drivers/rpmsg/rpmsg_core.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index ad3d2a9df287..067650c5bcb6 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -343,6 +343,11 @@ static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+ ssize_t len;
+
+ len = of_device_modalias(dev, buf, PAGE_SIZE);
+ if (len != -ENODEV)
+ return len;
return sprintf(buf, RPMSG_DEVICE_MODALIAS_FMT "\n", rpdev->id.name);
}
@@ -387,6 +392,11 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv)
static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+ int ret;
+
+ ret = of_device_uevent_modalias(dev, env);
+ if (ret != -ENODEV)
+ return ret;
return add_uevent_var(env, "MODALIAS=" RPMSG_DEVICE_MODALIAS_FMT,
rpdev->id.name);
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index 2b9b0941d9eb..6d23226e5f69 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)
return 0;
}
+static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ int ret;
+
+ ret = of_device_uevent_modalias(dev, env);
+ if (ret != -ENODEV)
+ return ret;
+
+ return 0;
+}
+
static struct bus_type spmi_bus_type = {
.name = "spmi",
.match = spmi_device_match,
.probe = spmi_drv_probe,
.remove = spmi_drv_remove,
+ .uevent = spmi_drv_uevent,
};
/**