From 42954857190b9df16d9d873ecc7f6cc38e013e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 9 Jul 2019 20:32:28 +0200 Subject: brcm2708: add linux 4.19 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot tested on Raspberry Pi B+ (BCM2708) and Raspberry Pi 2 (BCM2709) Signed-off-by: Álvaro Fernández Rojas --- ...p-SET_CURSOR_INFO-when-the-cursor-content.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 target/linux/brcm2708/patches-4.19/950-0120-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch (limited to 'target/linux/brcm2708/patches-4.19/950-0120-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch') diff --git a/target/linux/brcm2708/patches-4.19/950-0120-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch b/target/linux/brcm2708/patches-4.19/950-0120-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch new file mode 100644 index 0000000000..3b734aa940 --- /dev/null +++ b/target/linux/brcm2708/patches-4.19/950-0120-drm-vc4-Skip-SET_CURSOR_INFO-when-the-cursor-content.patch @@ -0,0 +1,57 @@ +From b77d51293dce1ff08da64c4bb95c13d2cb4c3ee7 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 5 Feb 2018 18:02:30 +0000 +Subject: [PATCH 120/703] drm/vc4: Skip SET_CURSOR_INFO when the cursor + contents didn't change. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 30 +++++++++++++++++--------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -204,10 +204,6 @@ static void vc4_cursor_plane_atomic_upda + state->crtc_y, + 0 + }; +- u32 packet_info[] = { state->crtc_w, state->crtc_h, +- 0, /* unused */ +- bo->paddr + fb->offsets[0], +- 0, 0, /* hotx, hoty */}; + WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); + + DRM_DEBUG_ATOMIC("[PLANE:%d:%s] update %dx%d cursor at %d,%d (0x%08x/%d)", +@@ -232,12 +228,26 @@ static void vc4_cursor_plane_atomic_upda + if (ret || packet_state[0] != 0) + DRM_ERROR("Failed to set cursor state: 0x%08x\n", packet_state[0]); + +- ret = rpi_firmware_property(vc4->firmware, +- RPI_FIRMWARE_SET_CURSOR_INFO, +- &packet_info, +- sizeof(packet_info)); +- if (ret || packet_info[0] != 0) +- DRM_ERROR("Failed to set cursor info: 0x%08x\n", packet_info[0]); ++ /* Note: When the cursor contents change, the modesetting ++ * driver calls drm_mode_cursor_univeral() with ++ * DRM_MODE_CURSOR_BO, which means a new fb will be allocated. ++ */ ++ if (!old_state || ++ state->crtc_w != old_state->crtc_w || ++ state->crtc_h != old_state->crtc_h || ++ fb != old_state->fb) { ++ u32 packet_info[] = { state->crtc_w, state->crtc_h, ++ 0, /* unused */ ++ bo->paddr + fb->offsets[0], ++ 0, 0, /* hotx, hoty */}; ++ ++ ret = rpi_firmware_property(vc4->firmware, ++ RPI_FIRMWARE_SET_CURSOR_INFO, ++ &packet_info, ++ sizeof(packet_info)); ++ if (ret || packet_info[0] != 0) ++ DRM_ERROR("Failed to set cursor info: 0x%08x\n", packet_info[0]); ++ } + } + + static void vc4_cursor_plane_atomic_disable(struct drm_plane *plane, -- cgit v1.2.3