diff --git a/drm-vc4-Fix-the-no-scaling-case-on-multi-planar-YUV-formats.patch b/drm-vc4-Fix-the-no-scaling-case-on-multi-planar-YUV-formats.patch new file mode 100644 index 0000000..195ced1 --- /dev/null +++ b/drm-vc4-Fix-the-no-scaling-case-on-multi-planar-YUV-formats.patch @@ -0,0 +1,88 @@ +From patchwork Wed Jul 25 12:29:07 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: drm/vc4: Fix the "no scaling" case on multi-planar YUV formats +From: Boris Brezillon +X-Patchwork-Id: 240917 +Message-Id: <20180725122907.13702-1-boris.brezillon@bootlin.com> +To: Eric Anholt +Cc: David Airlie , + Boris Brezillon , stable@vger.kernel.org, + dri-devel@lists.freedesktop.org +Date: Wed, 25 Jul 2018 14:29:07 +0200 + +When there's no scaling requested ->is_unity should be true no matter +the format. + +Also, when no scaling is requested and we have a multi-planar YUV +format, we should leave ->y_scaling[0] to VC4_SCALING_NONE and only +set ->x_scaling[0] to VC4_SCALING_PPF. + +Doing this fixes an hardly visible artifact (seen when using modetest +and a rather big overlay plane in YUV420). + +Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") +Cc: +Signed-off-by: Boris Brezillon +Reviewed-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index cfb50fedfa2b..a3275fa66b7b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -297,6 +297,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) + vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0], + vc4_state->crtc_h); + ++ vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE && ++ vc4_state->y_scaling[0] == VC4_SCALING_NONE); ++ + if (num_planes > 1) { + vc4_state->is_yuv = true; + +@@ -312,24 +315,17 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) + vc4_get_scaling_mode(vc4_state->src_h[1], + vc4_state->crtc_h); + +- /* YUV conversion requires that scaling be enabled, +- * even on a plane that's otherwise 1:1. Choose TPZ +- * for simplicity. ++ /* YUV conversion requires that horizontal scaling be enabled, ++ * even on a plane that's otherwise 1:1. Looks like only PPF ++ * works in that case, so let's pick that one. + */ +- if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) +- vc4_state->x_scaling[0] = VC4_SCALING_TPZ; +- if (vc4_state->y_scaling[0] == VC4_SCALING_NONE) +- vc4_state->y_scaling[0] = VC4_SCALING_TPZ; ++ if (vc4_state->is_unity) ++ vc4_state->x_scaling[0] = VC4_SCALING_PPF; + } else { + vc4_state->x_scaling[1] = VC4_SCALING_NONE; + vc4_state->y_scaling[1] = VC4_SCALING_NONE; + } + +- vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE && +- vc4_state->y_scaling[0] == VC4_SCALING_NONE && +- vc4_state->x_scaling[1] == VC4_SCALING_NONE && +- vc4_state->y_scaling[1] == VC4_SCALING_NONE); +- + /* No configuring scaling on the cursor plane, since it gets + non-vblank-synced updates, and scaling requires requires + LBM changes which have to be vblank-synced. +@@ -672,7 +668,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5); + } + +- if (!vc4_state->is_unity) { ++ if (vc4_state->x_scaling[0] != VC4_SCALING_NONE || ++ vc4_state->x_scaling[1] != VC4_SCALING_NONE || ++ vc4_state->y_scaling[0] != VC4_SCALING_NONE || ++ vc4_state->y_scaling[1] != VC4_SCALING_NONE) { + /* LBM Base Address. */ + if (vc4_state->y_scaling[0] != VC4_SCALING_NONE || + vc4_state->y_scaling[1] != VC4_SCALING_NONE) { diff --git a/drm-vc4-Reset-x-y-scaling-1-when-dealing-with-uniplanar-formats.patch b/drm-vc4-Reset-x-y-scaling-1-when-dealing-with-uniplanar-formats.patch new file mode 100644 index 0000000..dd773ff --- /dev/null +++ b/drm-vc4-Reset-x-y-scaling-1-when-dealing-with-uniplanar-formats.patch @@ -0,0 +1,40 @@ +From patchwork Tue Jul 24 13:36:01 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: drm/vc4: Reset ->{x, y}_scaling[1] when dealing with uniplanar formats +From: Boris Brezillon +X-Patchwork-Id: 240644 +Message-Id: <20180724133601.32114-1-boris.brezillon@bootlin.com> +To: Eric Anholt +Cc: David Airlie , + Boris Brezillon , stable@vger.kernel.org, + dri-devel@lists.freedesktop.org +Date: Tue, 24 Jul 2018 15:36:01 +0200 + +This is needed to ensure ->is_unity is correct when the plane was +previously configured to output a multi-planar format with scaling +enabled, and is then being reconfigured to output a uniplanar format. + +Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") +Cc: +Signed-off-by: Boris Brezillon +Reviewed-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 9d7a36f148cf..cfb50fedfa2b 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -320,6 +320,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state) + vc4_state->x_scaling[0] = VC4_SCALING_TPZ; + if (vc4_state->y_scaling[0] == VC4_SCALING_NONE) + vc4_state->y_scaling[0] = VC4_SCALING_TPZ; ++ } else { ++ vc4_state->x_scaling[1] = VC4_SCALING_NONE; ++ vc4_state->y_scaling[1] = VC4_SCALING_NONE; + } + + vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE && diff --git a/kernel.spec b/kernel.spec index 02510d3..f7d95b1 100644 --- a/kernel.spec +++ b/kernel.spec @@ -595,6 +595,11 @@ Patch331: bcm2835-cpufreq-add-CPU-frequency-control-driver.patch Patch332: bcm2835-hwmon-Add-support-for-RPi-voltage-sensor.patch +# https://patchwork.freedesktop.org/patch/240644/ +Patch333: drm-vc4-Reset-x-y-scaling-1-when-dealing-with-uniplanar-formats.patch +# https://patchwork.freedesktop.org/patch/240917/ +Patch334: drm-vc4-Fix-the-no-scaling-case-on-multi-planar-YUV-formats.patch + # Fix for AllWinner A64 Timer Errata, still not final # https://patchwork.kernel.org/patch/10392891/ Patch350: arm64-arch_timer-Workaround-for-Allwinner-A64-timer-instability.patch @@ -1894,6 +1899,9 @@ fi # # %changelog +* Tue Jul 31 2018 Peter Robinson +- Add two bcm283x vc4 stability patches + * Tue Jul 31 2018 Hans de Goede - Add patch to fix FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER on s390x and re-enable FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER on s390x