* [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers
@ 2018-10-16 16:00 Imre Deak
2018-10-16 17:56 ` Ville Syrjälä
2018-10-17 9:02 ` Life is hard, and then you die
0 siblings, 2 replies; 3+ messages in thread
From: Imre Deak @ 2018-10-16 16:00 UTC (permalink / raw)
To: intel-gfx
Cc: Ville Syrjälä, Mika Westerberg, Hans de Goede, ronald,
stable
If BIOS configured a Y tiled FB we failed to set up the backing object
tiling accordingly, leading to a lack of GT fence installed and a
garbled console.
The problem was bisected to
commit 011f22eb545a ("drm/i915: Do NOT skip the first 4k of stolen memory for pre-allocated buffers v2")
but it just revealed a pre-existing issue.
Kudos to Ville who suspected a missing fence looking at the corruption
on the screen.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: ronald@innovation.ch
Cc: <stable@vger.kernel.org>
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reported-by: ronald@innovation.ch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108264
Fixes: bc8d7dffacb1 ("drm/i915/skl: Provide a Skylake version of get_plane_config()")
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a2e729fa8d64..3d34b98c4634 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2674,6 +2674,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
if (size_aligned * 2 > dev_priv->stolen_usable_size)
return false;
+ switch (fb->modifier) {
+ case DRM_FORMAT_MOD_LINEAR:
+ case I915_FORMAT_MOD_X_TILED:
+ case I915_FORMAT_MOD_Y_TILED:
+ break;
+ default:
+ DRM_DEBUG_DRIVER("Unsupported modifier for initial FB: 0x%llx\n",
+ fb->modifier);
+ return false;
+ }
+
mutex_lock(&dev->struct_mutex);
obj = i915_gem_object_create_stolen_for_preallocated(dev_priv,
base_aligned,
@@ -2683,8 +2694,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
if (!obj)
return false;
- if (plane_config->tiling == I915_TILING_X)
- obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X;
+ switch (plane_config->tiling) {
+ case I915_TILING_NONE:
+ break;
+ case I915_TILING_X:
+ case I915_TILING_Y:
+ obj->tiling_and_stride = fb->pitches[0] | plane_config->tiling;
+ break;
+ default:
+ MISSING_CASE(plane_config->tiling);
+ return false;
+ }
mode_cmd.pixel_format = fb->format->format;
mode_cmd.width = fb->width;
@@ -8827,6 +8847,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
fb->modifier = I915_FORMAT_MOD_X_TILED;
break;
case PLANE_CTL_TILED_Y:
+ plane_config->tiling = I915_TILING_Y;
if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
else
--
2.13.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers
2018-10-16 16:00 [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers Imre Deak
@ 2018-10-16 17:56 ` Ville Syrjälä
2018-10-17 9:02 ` Life is hard, and then you die
1 sibling, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2018-10-16 17:56 UTC (permalink / raw)
To: Imre Deak; +Cc: intel-gfx, Mika Westerberg, Hans de Goede, ronald, stable
On Tue, Oct 16, 2018 at 07:00:11PM +0300, Imre Deak wrote:
> If BIOS configured a Y tiled FB we failed to set up the backing object
> tiling accordingly, leading to a lack of GT fence installed and a
> garbled console.
>
> The problem was bisected to
> commit 011f22eb545a ("drm/i915: Do NOT skip the first 4k of stolen memory for pre-allocated buffers v2")
> but it just revealed a pre-existing issue.
>
> Kudos to Ville who suspected a missing fence looking at the corruption
> on the screen.
>
> Cc: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: ronald@innovation.ch
> Cc: <stable@vger.kernel.org>
> Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Reported-by: ronald@innovation.ch
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108264
> Fixes: bc8d7dffacb1 ("drm/i915/skl: Provide a Skylake version of get_plane_config()")
> Signed-off-by: Imre Deak <imre.deak@intel.com>
lgtm
Reviewed-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a2e729fa8d64..3d34b98c4634 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2674,6 +2674,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> if (size_aligned * 2 > dev_priv->stolen_usable_size)
> return false;
>
> + switch (fb->modifier) {
> + case DRM_FORMAT_MOD_LINEAR:
> + case I915_FORMAT_MOD_X_TILED:
> + case I915_FORMAT_MOD_Y_TILED:
> + break;
> + default:
> + DRM_DEBUG_DRIVER("Unsupported modifier for initial FB: 0x%llx\n",
> + fb->modifier);
> + return false;
> + }
> +
> mutex_lock(&dev->struct_mutex);
> obj = i915_gem_object_create_stolen_for_preallocated(dev_priv,
> base_aligned,
> @@ -2683,8 +2694,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> if (!obj)
> return false;
>
> - if (plane_config->tiling == I915_TILING_X)
> - obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X;
> + switch (plane_config->tiling) {
> + case I915_TILING_NONE:
> + break;
> + case I915_TILING_X:
> + case I915_TILING_Y:
> + obj->tiling_and_stride = fb->pitches[0] | plane_config->tiling;
> + break;
> + default:
> + MISSING_CASE(plane_config->tiling);
> + return false;
> + }
>
> mode_cmd.pixel_format = fb->format->format;
> mode_cmd.width = fb->width;
> @@ -8827,6 +8847,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
> fb->modifier = I915_FORMAT_MOD_X_TILED;
> break;
> case PLANE_CTL_TILED_Y:
> + plane_config->tiling = I915_TILING_Y;
> if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
> fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
> else
> --
> 2.13.2
--
Ville Syrj�l�
Intel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers
2018-10-16 16:00 [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers Imre Deak
2018-10-16 17:56 ` Ville Syrjälä
@ 2018-10-17 9:02 ` Life is hard, and then you die
1 sibling, 0 replies; 3+ messages in thread
From: Life is hard, and then you die @ 2018-10-17 9:02 UTC (permalink / raw)
To: Imre Deak
Cc: intel-gfx, Ville Syrjälä, Mika Westerberg,
Hans de Goede, stable
On Tue, Oct 16, 2018 at 07:00:11PM +0300, Imre Deak wrote:
> If BIOS configured a Y tiled FB we failed to set up the backing object
> tiling accordingly, leading to a lack of GT fence installed and a
> garbled console.
>
> The problem was bisected to
> commit 011f22eb545a ("drm/i915: Do NOT skip the first 4k of stolen memory for pre-allocated buffers v2")
> but it just revealed a pre-existing issue.
>
> Kudos to Ville who suspected a missing fence looking at the corruption
> on the screen.
>
> Cc: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: ronald@innovation.ch
> Cc: <stable@vger.kernel.org>
> Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Reported-by: ronald@innovation.ch
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108264
> Fixes: bc8d7dffacb1 ("drm/i915/skl: Provide a Skylake version of get_plane_config()")
> Signed-off-by: Imre Deak <imre.deak@intel.com>
I can confirm it fixes the issue for MBP13,3 (Skylake) on kernels
4.18.14, 4.19.0-rc8, and drm-tip.
Cheers,
Ronald
> ---
> drivers/gpu/drm/i915/intel_display.c | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a2e729fa8d64..3d34b98c4634 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2674,6 +2674,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> if (size_aligned * 2 > dev_priv->stolen_usable_size)
> return false;
>
> + switch (fb->modifier) {
> + case DRM_FORMAT_MOD_LINEAR:
> + case I915_FORMAT_MOD_X_TILED:
> + case I915_FORMAT_MOD_Y_TILED:
> + break;
> + default:
> + DRM_DEBUG_DRIVER("Unsupported modifier for initial FB: 0x%llx\n",
> + fb->modifier);
> + return false;
> + }
> +
> mutex_lock(&dev->struct_mutex);
> obj = i915_gem_object_create_stolen_for_preallocated(dev_priv,
> base_aligned,
> @@ -2683,8 +2694,17 @@ intel_alloc_initial_plane_obj(struct intel_crtc *crtc,
> if (!obj)
> return false;
>
> - if (plane_config->tiling == I915_TILING_X)
> - obj->tiling_and_stride = fb->pitches[0] | I915_TILING_X;
> + switch (plane_config->tiling) {
> + case I915_TILING_NONE:
> + break;
> + case I915_TILING_X:
> + case I915_TILING_Y:
> + obj->tiling_and_stride = fb->pitches[0] | plane_config->tiling;
> + break;
> + default:
> + MISSING_CASE(plane_config->tiling);
> + return false;
> + }
>
> mode_cmd.pixel_format = fb->format->format;
> mode_cmd.width = fb->width;
> @@ -8827,6 +8847,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
> fb->modifier = I915_FORMAT_MOD_X_TILED;
> break;
> case PLANE_CTL_TILED_Y:
> + plane_config->tiling = I915_TILING_Y;
> if (val & PLANE_CTL_RENDER_DECOMPRESSION_ENABLE)
> fb->modifier = I915_FORMAT_MOD_Y_TILED_CCS;
> else
> --
> 2.13.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-17 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 16:00 [PATCH] drm/i915/gen9+: Fix initial readout for Y tiled framebuffers Imre Deak
2018-10-16 17:56 ` Ville Syrjälä
2018-10-17 9:02 ` Life is hard, and then you die
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).