adrdown
(usa Outra)
Enviado em 22/03/2017 - 01:58h
Boa noite,
Uso o Manjaro com Kernel 4.10.3 que apresenta o problema de tela piscando na TV ligada a HDMI, esta falha iniciou aqui após atualização do Kernel acima do 4.3 e se mantem até hoje no 4.10 ou seja tem quase 1 ano com esta falha,
Após pesquisar bastante o único teste que não consegui fazer foi implementar os Patchs abaixo, alguém que entenda poderia me dar um norte de como implementar os Patchs abaixo?
Fonte
https://bugs.freedesktop.org/show_bug.cgi?id=94605
==============================================================================================
From df6e5778c41549d320b66eae32979a6fab1b9c72 Mon Sep 17 00:00:00 2001
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date: Mon, 12 Dec 2016 17:59:01 -0200
Subject: [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on
everything >= gen8
BSpec got updated and this workaround is now listed as standard
required programming for all subsequent projects.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index efc0e74..b1c8897 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
return -ENODEV;
/* See the comment at the drm_mm_init() call for more about this check.
- * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
+ * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
*/
- if (start < 4096 && (IS_GEN8(dev_priv) ||
- IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0)))
+ if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
start = 4096;
mutex_lock(&dev_priv->mm.stolen_lock);
--
2.7.4
=========================================================================================
From 8ea2b2aa66703cafff657ca49a22e123822ba21f Mon Sep 17 00:00:00 2001
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
Date: Mon, 12 Dec 2016 18:22:47 -0200
Subject: [PATCH 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage
Reserve the first page of stolen memory right after initializing the
mm allocator. This means that we won't inherit the FB in case
the BIOS decides to put it at the start of stolen.
TODO: the goal is to ask everybody with screen flickering problems to
test this patch. Hopefully we'll be able to add a bunch of Bugzilla
tags here before merging it.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 3 +++
drivers/gpu/drm/i915/i915_gem_stolen.c | 26 +++++++++-----------------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 727d2aa..994eb24 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1531,6 +1531,9 @@ struct i915_gem_mm {
/** LRU list of objects with fence regs on them. */
struct list_head fence_list;
+ /** First page of stolen, for platforms where it's reserved. */
+ struct drm_mm_node first_page;
+
/**
* Are we in a non-interruptible section of code like
* modesetting?
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index b1c8897..30d645d 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -54,12 +54,6 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
if (!drm_mm_initialized(&dev_priv->mm.stolen))
return -ENODEV;
- /* See the comment at the drm_mm_init() call for more about this check.
- * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
- */
- if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
- start = 4096;
-
mutex_lock(&dev_priv->mm.stolen_lock);
ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, node, size,
alignment, start, end,
@@ -491,19 +485,17 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
ggtt->stolen_usable_size = ggtt->stolen_size - reserved_total;
- /*
- * Basic memrange allocator for stolen space.
- *
- * TODO: Notice that some platforms require us to not use the first page
- * of the stolen memory but their BIOSes may still put the framebuffer
- * on the first page. So we don't reserve this page for now because of
- * that. Our current solution is to just prevent new nodes from being
- * inserted on the first page - see the check we have at
- * i915_gem_stolen_insert_node_in_range(). We may want to fix the fbcon
- * problem later.
- */
+ /* Basic memrange allocator for stolen space. */
drm_mm_init(&dev_priv->mm.stolen, 0, ggtt->stolen_usable_size);
+ /* WaSkipStolenMemoryFirstPage:bdw+ */
+ if (INTEL_GEN(dev_priv) >= 8) {
+ dev_priv->mm.first_page.start = 0;
+ dev_priv->mm.first_page.size = 4096;
+ drm_mm_reserve_node(&dev_priv->mm.stolen,
+ &dev_priv->mm.first_page);
+ }
+
return 0;
}
--
2.7.4