Re: [Mesa-dev] [PATCH] i965: Skip update_texture_surface when the plane doesn't exist
On Mon, Jul 18, 2016 at 9:50 AM, Jordan Justenwrote: > On 2016-07-18 09:14:48, Jason Ekstrand wrote: > > Thanks to rebase fail, recent surface state changes effectively reverted > > This happened in 09b5a71517fadd6c20b72e7ad9ea1f7539c93a42, right? > Should we mention that commit? > Done > Reviewed-by: Jordan Justen > Thanks! > > > 727a9b24933 and 367cf3a2e3e which was unintentional. This should bring > it > > back. > > > > Signed-off-by: Jason Ekstrand > > Cc: Jordan Justen > > --- > > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 18 ++ > > 1 file changed, 10 insertions(+), 8 deletions(-) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > index c1a7579..d896789 100644 > > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > @@ -385,6 +385,13 @@ brw_update_texture_surface(struct gl_context *ctx, > > } else { > >struct intel_texture_object *intel_obj = > intel_texture_object(obj); > >struct intel_mipmap_tree *mt = intel_obj->mt; > > + > > + if (plane > 0) { > > + if (mt->plane[plane - 1] == NULL) > > +return; > > + mt = mt->plane[plane - 1]; > > + } > > + > >struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, > unit); > >/* If this is a view with restricted NumLayers, then our > effective depth > > * is not just the miptree depth. > > @@ -406,8 +413,9 @@ brw_update_texture_surface(struct gl_context *ctx, > >const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW : > > brw_get_texture_swizzle(>ctx, > obj)); > > > > - unsigned format = translate_tex_format( > > - brw, intel_obj->_Format, sampler->sRGBDecode); > > + mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : > mt->format; > > + unsigned format = translate_tex_format(brw, mesa_fmt, > > + sampler->sRGBDecode); > > > >/* Implement gen6 and gen7 gather work-around */ > >bool need_green_to_blue = false; > > @@ -449,12 +457,6 @@ brw_update_texture_surface(struct gl_context *ctx, > > assert(brw->gen >= 8); > > mt = mt->stencil_mt; > > format = BRW_SURFACEFORMAT_R8_UINT; > > - } else if (obj->Target == GL_TEXTURE_EXTERNAL_OES) { > > - if (plane > 0) > > -mt = mt->plane[plane - 1]; > > - if (mt == NULL) > > -return; > > - format = translate_tex_format(brw, mt->format, > sampler->sRGBDecode); > >} > > > >const int surf_index = surf_offset - >wm.base.surf_offset[0]; > > -- > > 2.5.0.400.gff86faf > > > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Skip update_texture_surface when the plane doesn't exist
On 2016-07-18 09:14:48, Jason Ekstrand wrote: > Thanks to rebase fail, recent surface state changes effectively reverted This happened in 09b5a71517fadd6c20b72e7ad9ea1f7539c93a42, right? Should we mention that commit? Reviewed-by: Jordan Justen> 727a9b24933 and 367cf3a2e3e which was unintentional. This should bring it > back. > > Signed-off-by: Jason Ekstrand > Cc: Jordan Justen > --- > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 18 ++ > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > index c1a7579..d896789 100644 > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > @@ -385,6 +385,13 @@ brw_update_texture_surface(struct gl_context *ctx, > } else { >struct intel_texture_object *intel_obj = intel_texture_object(obj); >struct intel_mipmap_tree *mt = intel_obj->mt; > + > + if (plane > 0) { > + if (mt->plane[plane - 1] == NULL) > +return; > + mt = mt->plane[plane - 1]; > + } > + >struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit); >/* If this is a view with restricted NumLayers, then our effective > depth > * is not just the miptree depth. > @@ -406,8 +413,9 @@ brw_update_texture_surface(struct gl_context *ctx, >const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW : > brw_get_texture_swizzle(>ctx, obj)); > > - unsigned format = translate_tex_format( > - brw, intel_obj->_Format, sampler->sRGBDecode); > + mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : mt->format; > + unsigned format = translate_tex_format(brw, mesa_fmt, > + sampler->sRGBDecode); > >/* Implement gen6 and gen7 gather work-around */ >bool need_green_to_blue = false; > @@ -449,12 +457,6 @@ brw_update_texture_surface(struct gl_context *ctx, > assert(brw->gen >= 8); > mt = mt->stencil_mt; > format = BRW_SURFACEFORMAT_R8_UINT; > - } else if (obj->Target == GL_TEXTURE_EXTERNAL_OES) { > - if (plane > 0) > -mt = mt->plane[plane - 1]; > - if (mt == NULL) > -return; > - format = translate_tex_format(brw, mt->format, sampler->sRGBDecode); >} > >const int surf_index = surf_offset - >wm.base.surf_offset[0]; > -- > 2.5.0.400.gff86faf > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Skip update_texture_surface when the plane doesn't exist
On Fri, Jun 24, 2016 at 9:02 PM, Mark Janeswrote: > On snb and ilk, this patch breaks > piglit.spec.ext_image_dma_buf_import.ext_image_dma_buf_import-sample_nv1 > > https://bugs.freedesktop.org/show_bug.cgi?id=96674 Looks like rebase fail to me. > > Jordan Justen writes: > > > Reported-by: Grazvydas Ignotas > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96607 > > Signed-off-by: Jordan Justen > > Cc: Kristian Høgsberg > > Cc: "12.0" > > --- > > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 15 ++- > > src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 21 > ++--- > > src/mesa/drivers/dri/i965/gen8_surface_state.c| 19 > ++- > > 3 files changed, 26 insertions(+), 29 deletions(-) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > index 133a944..e93847b 100644 > > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > > @@ -332,21 +332,18 @@ brw_update_texture_surface(struct gl_context *ctx, > >return; > > } > > > > + if (plane > 0) { > > + if (mt->plane[plane - 1] == NULL) > > + return; > > + mt = mt->plane[plane - 1]; > > + } > > + > > surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, > > 6 * 4, 32, surf_offset); > > > > uint32_t tex_format = translate_tex_format(brw, mt->format, > >sampler->sRGBDecode); > > > > - if (tObj->Target == GL_TEXTURE_EXTERNAL_OES) { > > - if (plane > 0) > > - mt = mt->plane[plane - 1]; > > - if (mt == NULL) > > - return; > > - > > - tex_format = translate_tex_format(brw, mt->format, > sampler->sRGBDecode); > > - } > > - > > if (for_gather) { > >/* Sandybridge's gather4 message is broken for integer formats. > > * To work around this, we pretend the surface is UNORM for > > diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > > index 60589bc..b8f9740 100644 > > --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > > +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > > @@ -365,6 +365,13 @@ gen7_update_texture_surface(struct gl_context *ctx, > > } else { > >struct intel_texture_object *intel_obj = > intel_texture_object(obj); > >struct intel_mipmap_tree *mt = intel_obj->mt; > > + > > + if (plane > 0) { > > + if (mt->plane[plane - 1] == NULL) > > +return; > > + mt = mt->plane[plane - 1]; > > + } > > + > >struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, > unit); > >/* If this is a view with restricted NumLayers, then our > effective depth > > * is not just the miptree depth. > > @@ -383,17 +390,9 @@ gen7_update_texture_surface(struct gl_context *ctx, > >const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW : > > brw_get_texture_swizzle(>ctx, > obj)); > > > > - unsigned format = translate_tex_format( > > - brw, intel_obj->_Format, sampler->sRGBDecode); > > - > > - if (obj->Target == GL_TEXTURE_EXTERNAL_OES) { > > - if (plane > 0) > > -mt = mt->plane[plane - 1]; > > - if (mt == NULL) > > -return; > > - > > - format = translate_tex_format(brw, mt->format, > sampler->sRGBDecode); > > - } > > + mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : > mt->format; > the gen4-6 version of what got pushed is missing this hunk. I pushed a patch on Thursday that changed it to grab the format from the gl_texture_object rather than the miptree. > > + unsigned format = translate_tex_format(brw, mesa_fmt, > > + sampler->sRGBDecode); > > > >if (for_gather && format == BRW_SURFACEFORMAT_R32G32_FLOAT) > > format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD; > > diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c > b/src/mesa/drivers/dri/i965/gen8_surface_state.c > > index ee4781b..e2af9c9 100644 > > --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c > > +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c > > @@ -374,6 +374,13 @@ gen8_update_texture_surface(struct gl_context *ctx, > >struct gl_texture_image *firstImage = > obj->Image[0][obj->BaseLevel]; > >struct intel_texture_object *intel_obj = > intel_texture_object(obj); > >struct intel_mipmap_tree *mt = intel_obj->mt; > > + > > + if (plane > 0) { > > + if (mt->plane[plane - 1] == NULL) > > +return; > > + mt = mt->plane[plane - 1]; > > + } > > + > >struct gl_sampler_object *sampler =
Re: [Mesa-dev] [PATCH] i965: Skip update_texture_surface when the plane doesn't exist
On snb and ilk, this patch breaks piglit.spec.ext_image_dma_buf_import.ext_image_dma_buf_import-sample_nv1 https://bugs.freedesktop.org/show_bug.cgi?id=96674 Jordan Justenwrites: > Reported-by: Grazvydas Ignotas > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96607 > Signed-off-by: Jordan Justen > Cc: Kristian Høgsberg > Cc: "12.0" > --- > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 15 ++- > src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 21 ++--- > src/mesa/drivers/dri/i965/gen8_surface_state.c| 19 ++- > 3 files changed, 26 insertions(+), 29 deletions(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > index 133a944..e93847b 100644 > --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c > @@ -332,21 +332,18 @@ brw_update_texture_surface(struct gl_context *ctx, >return; > } > > + if (plane > 0) { > + if (mt->plane[plane - 1] == NULL) > + return; > + mt = mt->plane[plane - 1]; > + } > + > surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, > 6 * 4, 32, surf_offset); > > uint32_t tex_format = translate_tex_format(brw, mt->format, >sampler->sRGBDecode); > > - if (tObj->Target == GL_TEXTURE_EXTERNAL_OES) { > - if (plane > 0) > - mt = mt->plane[plane - 1]; > - if (mt == NULL) > - return; > - > - tex_format = translate_tex_format(brw, mt->format, > sampler->sRGBDecode); > - } > - > if (for_gather) { >/* Sandybridge's gather4 message is broken for integer formats. > * To work around this, we pretend the surface is UNORM for > diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > index 60589bc..b8f9740 100644 > --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c > @@ -365,6 +365,13 @@ gen7_update_texture_surface(struct gl_context *ctx, > } else { >struct intel_texture_object *intel_obj = intel_texture_object(obj); >struct intel_mipmap_tree *mt = intel_obj->mt; > + > + if (plane > 0) { > + if (mt->plane[plane - 1] == NULL) > +return; > + mt = mt->plane[plane - 1]; > + } > + >struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit); >/* If this is a view with restricted NumLayers, then our effective > depth > * is not just the miptree depth. > @@ -383,17 +390,9 @@ gen7_update_texture_surface(struct gl_context *ctx, >const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW : > brw_get_texture_swizzle(>ctx, obj)); > > - unsigned format = translate_tex_format( > - brw, intel_obj->_Format, sampler->sRGBDecode); > - > - if (obj->Target == GL_TEXTURE_EXTERNAL_OES) { > - if (plane > 0) > -mt = mt->plane[plane - 1]; > - if (mt == NULL) > -return; > - > - format = translate_tex_format(brw, mt->format, sampler->sRGBDecode); > - } > + mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : mt->format; > + unsigned format = translate_tex_format(brw, mesa_fmt, > + sampler->sRGBDecode); > >if (for_gather && format == BRW_SURFACEFORMAT_R32G32_FLOAT) > format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD; > diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c > b/src/mesa/drivers/dri/i965/gen8_surface_state.c > index ee4781b..e2af9c9 100644 > --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c > +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c > @@ -374,6 +374,13 @@ gen8_update_texture_surface(struct gl_context *ctx, >struct gl_texture_image *firstImage = obj->Image[0][obj->BaseLevel]; >struct intel_texture_object *intel_obj = intel_texture_object(obj); >struct intel_mipmap_tree *mt = intel_obj->mt; > + > + if (plane > 0) { > + if (mt->plane[plane - 1] == NULL) > +return; > + mt = mt->plane[plane - 1]; > + } > + >struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit); >/* If this is a view with restricted NumLayers, then our effective > depth > * is not just the miptree depth. > @@ -391,19 +398,13 @@ gen8_update_texture_surface(struct gl_context *ctx, >const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW : > brw_get_texture_swizzle(>ctx, obj)); > > - unsigned format = translate_tex_format(brw, intel_obj->_Format, > + mesa_format mesa_fmt = plane == 0
Re: [Mesa-dev] [PATCH] i965: Skip update_texture_surface when the plane doesn't exist
On Mon 20 Jun 2016, Jordan Justen wrote: > Reported-by: Grazvydas Ignotas> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96607 > Signed-off-by: Jordan Justen > Cc: Kristian Høgsberg > Cc: "12.0" > --- > src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 15 ++- > src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 21 ++--- > src/mesa/drivers/dri/i965/gen8_surface_state.c| 19 ++- > 3 files changed, 26 insertions(+), 29 deletions(-) Reviewed-by: Chad Versace ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev