2018-11-10 11:03:18 +00:00
|
|
|
From 7771310ee7e9b7291e549e36771de6176d57e24b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Stefan Schake <stschake@gmail.com>
|
|
|
|
Date: Fri, 9 Mar 2018 01:53:35 +0100
|
|
|
|
Subject: [PATCH 345/454] drm/vc4: Check if plane requires background fill
|
|
|
|
|
|
|
|
commit 3d67b68a6a3c2deb689c29759a20150c668c286e upstream.
|
|
|
|
|
|
|
|
Considering a single plane only, we have to enable background color
|
|
|
|
when the plane has an alpha format and could be blending from the
|
|
|
|
background or when it doesn't cover the entire screen.
|
|
|
|
|
|
|
|
Changes from v1:
|
|
|
|
- Drop unrelated change
|
|
|
|
- Move needs_bg_fill to plane state
|
|
|
|
|
|
|
|
Signed-off-by: Stefan Schake <stschake@gmail.com>
|
|
|
|
Signed-off-by: Eric Anholt <eric@anholt.net>
|
|
|
|
Reviewed-by: Eric Anholt <eric@anholt.net>
|
|
|
|
Link: https://patchwork.freedesktop.org/patch/msgid/1520556817-97297-3-git-send-email-stschake@gmail.com
|
|
|
|
---
|
|
|
|
drivers/gpu/drm/vc4/vc4_plane.c | 17 +++++++++++++++++
|
|
|
|
1 file changed, 17 insertions(+)
|
|
|
|
|
|
|
|
--- a/drivers/gpu/drm/vc4/vc4_plane.c
|
|
|
|
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
|
|
|
|
@@ -73,6 +73,12 @@ struct vc4_plane_state {
|
|
|
|
|
|
|
|
/* Our allocation in LBM for temporary storage during scaling. */
|
|
|
|
struct drm_mm_node lbm;
|
|
|
|
+
|
|
|
|
+ /* Set when the plane has per-pixel alpha content or does not cover
|
|
|
|
+ * the entire screen. This is a hint to the CRTC that it might need
|
|
|
|
+ * to enable background color fill.
|
|
|
|
+ */
|
|
|
|
+ bool needs_bg_fill;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline struct vc4_plane_state *
|
kernel: bump 4.14 to 4.14.93
Refresh patches.
Remove upstreamed patches:
- backport/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch
- pending/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch
- brcm2708/950-0415-qmi_wwan-apply-SET_DTR-quirk-to-the-SIMCOM-shared-de.patch
Compile-tested: ar71xx, ath79, brcm2708/bcm27{08,10}, octeon, x86/64
Runtime-tested: ar71xx, ath79, brcm2708/bcm27{08,10}, octeon, x86/64
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-01-13 19:50:36 +00:00
|
|
|
@@ -522,6 +528,7 @@ static int vc4_plane_mode_set(struct drm
|
2018-11-10 11:03:18 +00:00
|
|
|
u32 ctl0_offset = vc4_state->dlist_count;
|
|
|
|
const struct hvs_format *format = vc4_get_hvs_format(fb->format->format);
|
|
|
|
int num_planes = drm_format_num_planes(format->drm);
|
|
|
|
+ bool covers_screen;
|
|
|
|
u32 scl0, scl1, pitch0;
|
|
|
|
u32 lbm_size, tiling;
|
|
|
|
unsigned long irqflags;
|
kernel: bump 4.14 to 4.14.93
Refresh patches.
Remove upstreamed patches:
- backport/096-mips-math-emu-Write-protect-delay-slot-emulation-pages.patch
- pending/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch
- brcm2708/950-0415-qmi_wwan-apply-SET_DTR-quirk-to-the-SIMCOM-shared-de.patch
Compile-tested: ar71xx, ath79, brcm2708/bcm27{08,10}, octeon, x86/64
Runtime-tested: ar71xx, ath79, brcm2708/bcm27{08,10}, octeon, x86/64
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-01-13 19:50:36 +00:00
|
|
|
@@ -705,6 +712,16 @@ static int vc4_plane_mode_set(struct drm
|
2018-11-10 11:03:18 +00:00
|
|
|
vc4_state->dlist[ctl0_offset] |=
|
|
|
|
VC4_SET_FIELD(vc4_state->dlist_count, SCALER_CTL0_SIZE);
|
|
|
|
|
|
|
|
+ /* crtc_* are already clipped coordinates. */
|
|
|
|
+ covers_screen = vc4_state->crtc_x == 0 && vc4_state->crtc_y == 0 &&
|
|
|
|
+ vc4_state->crtc_w == state->crtc->mode.hdisplay &&
|
|
|
|
+ vc4_state->crtc_h == state->crtc->mode.vdisplay;
|
|
|
|
+ /* Background fill might be necessary when the plane has per-pixel
|
|
|
|
+ * alpha content and blends from the background or does not cover
|
|
|
|
+ * the entire screen.
|
|
|
|
+ */
|
|
|
|
+ vc4_state->needs_bg_fill = format->has_alpha || !covers_screen;
|
|
|
|
+
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|