From d140a19ee06aebe6f70cd6a1cbeb40812a393b81 Mon Sep 17 00:00:00 2001 From: Dan Ziemba Date: Fri, 1 Jan 2016 17:19:45 -0500 Subject: [PATCH] 4.3.3-2 --- ...g-primary-plane-in-the-noatomic-case.patch | 56 +++++++++++++++++++ PKGBUILD | 8 ++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 0001-disabling-primary-plane-in-the-noatomic-case.patch diff --git a/0001-disabling-primary-plane-in-the-noatomic-case.patch b/0001-disabling-primary-plane-in-the-noatomic-case.patch new file mode 100644 index 0000000..241b101 --- /dev/null +++ b/0001-disabling-primary-plane-in-the-noatomic-case.patch @@ -0,0 +1,56 @@ +From 634b3a4a476e96816d5d6cd5bb9f8900a53f56ba Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Nov 2015 10:25:28 +0100 +Subject: drm/i915: Do a better job at disabling primary plane in the noatomic + case. + +When disable_noatomic is called plane_mask is not correct yet, and +plane_state->visible = true is left as true after disabling the primary +plane. + +Other planes are already disabled as part of crtc sanitization, only the +primary is left active. But the plane_mask is not updated here. It gets +updated during fb takeover in modeset_gem_init, or set to the new value +on resume. + +This means that to disable the primary plane 1 << drm_plane_index(primary) +needs to be used. + +Afterwards because the crtc is no longer active it's forbidden to keep +plane_state->visible set, or a WARN_ON in +intel_plane_atomic_calc_changes triggers. There are other code points +that rely on accurate plane_state->visible too, so make sure the bool is +cleared. + +The other planes are already disabled in intel_sanitize_crtc, so they +don't have to be handled here. + +Cc: stable@vger.kernel.org #v4.3, v4.2? +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92655 +Tested-by: Tomas Mezzadra +Signed-off-by: Maarten Lankhorst +Reviewed-by: Daniel Vetter +Link: http://patchwork.freedesktop.org/patch/msgid/5652DB88.9070208@linux.intel.com +(cherry picked from commit 54a4196188eab82e6f0a5f05716626e9f18b8fb6) +Signed-off-by: Jani Nikula + +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c +index 22e86d2..62211ab 100644 +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -6309,9 +6309,11 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc) + if (to_intel_plane_state(crtc->primary->state)->visible) { + intel_crtc_wait_for_pending_flips(crtc); + intel_pre_disable_primary(crtc); ++ ++ intel_crtc_disable_planes(crtc, 1 << drm_plane_index(crtc->primary)); ++ to_intel_plane_state(crtc->primary->state)->visible = false; + } + +- intel_crtc_disable_planes(crtc, crtc->state->plane_mask); + dev_priv->display.crtc_disable(crtc); + intel_crtc->active = false; + intel_update_watermarks(crtc); +-- +cgit v0.10.2 + diff --git a/PKGBUILD b/PKGBUILD index f6a3ee9..93aa59a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgbase=linux-vfio _srcname=linux-4.3 pkgver=4.3.3 -pkgrel=1 +pkgrel=2 arch=('i686' 'x86_64') url="http://www.kernel.org/" license=('GPL2') @@ -13,6 +13,7 @@ source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign" "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz" "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign" + "0001-disabling-primary-plane-in-the-noatomic-case.patch" # the main kernel config files 'config' 'config.x86_64' # standard config files for mkinitcpio ramdisk @@ -24,6 +25,7 @@ sha256sums=('4a622cc84b8a3c38d39bc17195b0c064d2b46945dfde0dae18f77b120bc9f3ae' 'SKIP' '95cd81fcbb87953f672150d60950548edc04a88474c42de713b91811557fefa5' 'SKIP' + 'abdd04bd6beecb7c961130a68d71e6332bd260462eeaa2f4f8e634de813dcc4d' 'f4084c6d43abc40819f4535f827d3d8e643d25e67fedf0bab46346ead8c08b84' '98caa62b4759f6ae180660cc1be4aeda7198e50fb7cf51aee4e677ae6ee2d19e' 'f0d90e756f14533ee67afda280500511a62465b4f76adcc5effa95a40045179c' @@ -51,6 +53,10 @@ prepare() { # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227) patch -p1 -i "${srcdir}/change-default-console-loglevel.patch" + # fix #46968 + # hangs on older intel hardware + patch -Np1 -i "${srcdir}/0001-disabling-primary-plane-in-the-noatomic-case.patch" + if [ "${CARCH}" = "x86_64" ]; then cat "${srcdir}/config.x86_64" > ./.config else