Processed: Re: Bug#983466: Is a mesa-bug

2021-03-13 Thread Debian Bug Tracking System
Processing control commands:

> retitle -1 Black screen at dual monitor with warn from i915_gem_ww_ctx_backoff
Bug #983466 [src:linux] linux-image-5.10.0-3-686-pae: Black screen at dual 
monitor with warn from i915_gem_ww_ctx_backoff
Changed Bug title to 'Black screen at dual monitor with warn from 
i915_gem_ww_ctx_backoff' from 'linux-image-5.10.0-3-686-pae: Black screen at 
dual monitor with warn from i915_gem_ww_ctx_backoff'.
> reassign -1 src:mesa 20.3.4-1
Bug #983466 [src:linux] Black screen at dual monitor with warn from 
i915_gem_ww_ctx_backoff
Bug reassigned from package 'src:linux' to 'src:mesa'.
No longer marked as found in versions linux/5.10.13-1.
Ignoring request to alter fixed versions of bug #983466 to the same values 
previously set
Bug #983466 [src:mesa] Black screen at dual monitor with warn from 
i915_gem_ww_ctx_backoff
Marked as found in versions mesa/20.3.4-1.
> forwarded -1 https://gitlab.freedesktop.org/mesa/mesa/-/issues/790
Bug #983466 [src:mesa] Black screen at dual monitor with warn from 
i915_gem_ww_ctx_backoff
Set Bug forwarded-to-address to 
'https://gitlab.freedesktop.org/mesa/mesa/-/issues/790'.

-- 
983466: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983466
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#983466: Is a mesa-bug

2021-03-13 Thread Salvatore Bonaccorso
Control: retitle -1 Black screen at dual monitor with warn from 
i915_gem_ww_ctx_backoff
Control: reassign -1 src:mesa 20.3.4-1
Control: forwarded -1 https://gitlab.freedesktop.org/mesa/mesa/-/issues/790

Hi,

On Mon, Mar 08, 2021 at 09:42:04PM +0100, Gert van de Kraats wrote:
> because wayland itself needs 2 fence registers for 2 momitors  i
> and X11 only 1.
> A trace without using wayland shows the 15th register is used without
> giving any problem:
> 
> Feb 24 20:10:59 debian systemd[1270]: Started GNOME Shell on X11.
> 
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 0 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 1 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 2 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 3 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 4 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 5 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 6 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 7 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 8 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 9 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 10 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 11 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 12 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 13 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 14 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 15 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 1 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 2 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 3 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 4 0
> Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 5 0
> .
> 
> So this seems to be  a mesa bug and an exact duplicate
> of https://gitlab.freedesktop.org/mesa/mesa/-/issues/790 .
> 
> Only the kernel-driver-error has changed and is misleading now.
> 
> I add the mesa-2.3.4-patch I currently use, which solves the problem.
> 
> Testing for register-overflow is done after updating the batch, If overflow
> occurs
> 
> the batch is restored to the situation before the last update, the buffer is
> flushed
> 
> and the batch again is updated with the last update.

So reassigning this for now to src:mesa and updating the metadata.

Regards,
Salvatore



Bug#983466: Is a mesa-bug

2021-03-08 Thread Gert van de Kraats

because wayland itself needs 2 fence registers for 2 momitors  i
and X11 only 1.
A trace without using wayland shows the 15th register is used without
giving any problem:

Feb 24 20:10:59 debian systemd[1270]: Started GNOME Shell on X11.

Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 0 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 1 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 2 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 3 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 4 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 5 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 6 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 7 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 8 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 9 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 10 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 11 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 12 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 13 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 14 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 15 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 1 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 2 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 3 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 4 0
Feb 24 20:11:29 debian gnome-shell[1505]: GK_intelClearWithBlit_fences 5 0
.

So this seems to be  a mesa bug and an exact duplicate
of https://gitlab.freedesktop.org/mesa/mesa/-/issues/790 .

Only the kernel-driver-error has changed and is misleading now.

I add the mesa-2.3.4-patch I currently use, which solves the problem.

Testing for register-overflow is done after updating the batch, If 
overflow occurs


the batch is restored to the situation before the last update, the 
buffer is flushed


and the batch again is updated with the last update.

--- a/src/mesa/drivers/dri/i915/intel_blit.c2021-01-29 19:33:19.919872300 
+0100
+++ b/src/mesa/drivers/dri/i915/intel_blit.c2021-02-27 11:52:41.779536510 
+0100
@@ -93,9 +93,10 @@
GLuint CMD, BR13, pass = 0;
int dst_y2 = dst_y + h;
int dst_x2 = dst_x + w;
-   drm_intel_bo *aper_array[3];
+   drm_intel_bo *aper_array[1];
bool dst_y_tiled = dst_tiling == I915_TILING_Y;
bool src_y_tiled = src_tiling == I915_TILING_Y;
+   int reloc_count;
BATCH_LOCALS;
 
if (dst_tiling != I915_TILING_NONE) {
@@ -109,22 +110,6 @@
if (dst_y_tiled || src_y_tiled)
   return false;
 
-   /* do space check before going any further */
-   do {
-   aper_array[0] = intel->batch.bo;
-   aper_array[1] = dst_buffer;
-   aper_array[2] = src_buffer;
-
-   if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) {
-   intel_batchbuffer_flush(intel);
-   pass++;
-   } else
-   break;
-   } while (pass < 2);
-
-   if (pass >= 2)
-  return false;
-
intel_batchbuffer_require_space(intel, 8 * 4);
DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__func__,
@@ -177,15 +162,32 @@
assert(dst_x < dst_x2);
assert(dst_y < dst_y2);
 
-   BEGIN_BATCH(8);
+   do {
+   reloc_count = drm_intel_gem_bo_get_reloc_count(intel->batch.bo);
+   BEGIN_BATCH(8);
+
+   OUT_BATCH(CMD | (8 - 2));
+   OUT_BATCH(BR13 | (uint16_t)dst_pitch);
+   OUT_BATCH((dst_y << 16) | dst_x);
+   OUT_BATCH((dst_y2 << 16) | dst_x2);
+   OUT_RELOC_FENCED(dst_buffer,
+   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+   dst_offset);
+   /* do space check before going any further */
+   aper_array[0] = intel->batch.bo;
+   if (dri_bufmgr_check_aperture_space(aper_array, 1) != 0) {
+   drm_intel_gem_bo_clear_relocs(intel->batch.bo, reloc_count);
+   intel_batchbuffer_emit_reset(intel);
+   intel_batchbuffer_flush(intel);
+   pass++;
+   } else
+   break;
+   } while (pass < 2);
+
+   if (pass >= 2)
+   return false;
+
 
-   OUT_BATCH(CMD | (8 - 2));
-   OUT_BATCH(BR13 | (uint16_t)dst_pitch);
-   OUT_BATCH((dst_y << 16) | dst_x);
-   OUT_BATCH((dst_y2 << 16) | dst_x2);
-   OUT_RELOC_FENCED(dst_buffer,
-   I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
-   dst_offset);
OUT_BATCH((src_y << 16) | src_x);
OUT_BATCH((uint16_t)src_pitch);
OUT_RELOC_FENCED(src_buffer,
@@ -335,6 +337,8 @@
GLuint clear_depth_value, clear_depth_mask;
GLint cx, cy, cw, ch;
GLbitfield fail_mask = 0;
+   int reloc_count;
+   bool flushed;