Re: [Mesa-dev] [PATCH 01/32] i965/surface_state: Use the minified depth for number of image layers

2017-07-20 Thread Pohjolainen, Topi

I already pushed an equivalent fix (which you actually reviewed).

On Wed, Jul 19, 2017 at 02:01:27PM -0700, Jason Ekstrand wrote:
> Otherwise, if the image is 3D, then we may end up with a number of
> layers that is too high for LOD > 0.
> ---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 67dc9d8..e878613 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -1662,7 +1662,7 @@ update_image_surface(struct brw_context *brw,
>   struct intel_mipmap_tree *mt = intel_obj->mt;
>   const unsigned num_layers = (!u->Layered ? 1 :
>obj->Target == GL_TEXTURE_CUBE_MAP ? 6 
> :
> -  mt->logical_depth0);
> +  mt->level[u->Level].depth);
>  
>   struct isl_view view = {
>  .format = format,
> -- 
> 2.5.0.400.gff86faf
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/32] i965/miptree: Make layer_range_length return locical layers

2017-07-20 Thread Pohjolainen, Topi

This still leaves create_aux_state_map() using physical number of layers for
the actual allocation. I toyed a little with this hoping to put it in front my
i965-to-isl work. In the end it looks to me that moving away from physical
is easier/cleaner once the conversion to isl is done. This prevents us from
addressing both isl-based and native slice table-based leaving just the
isl-based. Moreover in case of slice table-based we would need to calculate
a layer-number divider as the slice table itself stores depth as physical.

There are altogether 6 places calling get_num_phys_layers() in the end.
I think these document nicely all the locations we need to consider. How does
this sound?

On Wed, Jul 19, 2017 at 02:01:33PM -0700, Jason Ekstrand wrote:
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 3eac077..8d8ea43 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2461,12 +2461,18 @@ miptree_layer_range_length(const struct 
> intel_mipmap_tree *mt, uint32_t level,
> assert(level <= mt->last_level);
> uint32_t total_num_layers;
>  
> -   if (mt->surf.size > 0)
> +   if (mt->surf.size > 0) {
>total_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
> - minify(mt->surf.phys_level0_sa.depth, level) :
> - mt->surf.phys_level0_sa.array_len;
> -   else 
> + minify(mt->surf.logical_level0_px.depth, level) :
> + mt->surf.logical_level0_px.array_len;
> +   } else {
>total_num_layers = mt->level[level].depth;
> +  if (mt->msaa_layout == INTEL_MSAA_LAYOUT_UMS ||
> +  mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
> + assert(total_num_layers % mt->num_samples == 0);
> + total_num_layers /= mt->num_samples;
> +  }
> +   }
>  
> assert(start_layer < total_num_layers);
> if (num_layers == INTEL_REMAINING_LAYERS)
> -- 
> 2.5.0.400.gff86faf
> 
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 101843] Latest mesa git fails to compile in mesa/main/marshal.c

2017-07-20 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=101843

--- Comment #3 from Grigori Goronzy  ---
Are you sure this isn't an issue with the build infrastructure going out of
sync with changes in the source code? Please try to delete the build directory
and reconfigure and rebuild everything from scratch. This looks like the
generated code for marshalling wasn't updated properly.

I'm only using out-of-tree builds and Mesa builds fine for me too.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] egl: add linux-dmabuf-unstable-v1-protocol.c to "nodist"

2017-07-20 Thread Daniel Stone
On 19 July 2017 at 23:44, Andres Gomez  wrote:
> This fixes `make distcheck`
>
>> make[3]: *** No rule to make target 
>> 'drivers/dri2/linux-dmabuf-unstable-v1-protocol.c', needed by 'distdir'.  
>> Stop.
>> make[3]: Entering directory '/home/local/mesa/src/egl'
>> make[3]: Leaving directory '/home/local/mesa/src/egl'
>> make[2]: *** [distdir] Error 1
>> make[1]: *** [distdir] Error 1
>> make: *** [dist] Error 2

Reviewed-by: Daniel Stone 

Mark - could you please insert a 'distcheck' run into CI?

Cheers,
Daniel
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [EGL android: accquire fence implementation] i965: Queue the buffer with a sync fence for Android OS (v4)

2017-07-20 Thread Tomasz Figa
Hi Zhongmin,

Thanks for the new patch. Personally I think it looks much better now.
Still, there are some remaining comments.

Also, I'd advise waiting few days before posting new version, so that peo

On Thu, Jul 20, 2017 at 4:10 PM, Zhongmin Wu  wrote:
> Before we queued the buffer with a invalid fence (-1), it will
> make some benchmarks failed to test such as flatland.
>
> Now we get the out fence during the flushing buffer and then pass
> it to SurfaceFlinger in eglSwapbuffer function.
>
> v2: a) Also implement the fence in cancelBuffer.
> b) The last sync fence is stored in drawable object
>rather than brw context.
> c) format clear.
>
> v3: a) Save the last fence fd in DRI Context object.
> b) Return the last fence if the batch buffer is empty and
>nothing to be flushed when _intel_batchbuffer_flush_fence
> c) Add the new interface in vbtl to set the retrieve fence
>in the egl surface. This is just for cancelBuffer.
> d) For queueBuffer, the fence is get with DRI fence interface.
>For cancelBuffer, the fence is get before the context is
>reset, and the fence is then  moved to its surface.
> v3.1 a) close fd in the new vbtl interface on none Android platform
>
> v4: a) The last fence is saved in brw context.
> b) The retrieve fd is for all the platform but not just Android
> c) Add a uniform dri2 interface to initialize the surface.
>
> Change-Id: Ic0773c19788d612a98d1402f5b5619dab64c1bc2
> Tracked-On: https://jira01.devtools.intel.com/browse/OAM-43936

Please remove internal tags. They are meaningless for us.

> Reported-On: https://bugs.freedesktop.org/show_bug.cgi?id=101655
> Signed-off-by: Zhongmin Wu 
> Reported-by: Li, Guangli 
> Tested-by: Marathe, Yogesh 
> ---
>  src/egl/drivers/dri2/egl_dri2.c   |   47 
> +
>  src/egl/drivers/dri2/egl_dri2.h   |5 +++
>  src/egl/drivers/dri2/platform_android.c   |   11 +++---
>  src/egl/drivers/dri2/platform_drm.c   |2 +-
>  src/egl/drivers/dri2/platform_surfaceless.c   |2 +-
>  src/egl/drivers/dri2/platform_wayland.c   |2 +-
>  src/egl/drivers/dri2/platform_x11.c   |2 +-
>  src/egl/drivers/dri2/platform_x11_dri3.c  |2 +-
>  src/mesa/drivers/dri/i965/brw_context.c   |5 +++
>  src/mesa/drivers/dri/i965/brw_context.h   |1 +
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c |   17 +++--
>  11 files changed, 85 insertions(+), 11 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 020a0bc..94ad360 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1307,6 +1307,26 @@ dri2_destroy_context(_EGLDriver *drv, _EGLDisplay 
> *disp, _EGLContext *ctx)
> return EGL_TRUE;
>  }
>
> +EGLBoolean
> +dri2_surf_init(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
> +_EGLConfig *conf, const EGLint *attrib_list)
> +{
> +   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
> +   dri2_surf->retrieve_fd = -1;

"retrieve_fd" is a really strange name. Please change it. I'd suggest
"out_fence_fd" as already used in i965 driver.

> +   return _eglInitSurface(surf, dpy, type, conf, attrib_list);
> +}
> +
> +void

static void?

> +dri2_surface_set_retrieve_fence( _EGLSurface *surf, int fence_fd)
> +{
> +   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
> +   if (dri2_surf->retrieve_fd >=0)
> +  close(dri2_surf->retrieve_fd);
> +
> +   dri2_surf->retrieve_fd = fence_fd;
> +   return;

No need for return.

> +}
> +
>  static EGLBoolean
>  dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
>  {
> @@ -1315,9 +1335,26 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay 
> *dpy, _EGLSurface *surf)
> if (!_eglPutSurface(surf))
>return EGL_TRUE;
>
> +   dri2_surface_set_retrieve_fence(surf, -1);
> return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
>  }
>
> +static void
> +dri2_surf_get_fence_fd(_EGLContext *ctx,
> +   _EGLDisplay *dpy, _EGLSurface *surf)
> +{
> +   struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
> +   int fence_fd = -1;
> +   __DRIcontext *dri_ctx = dri2_egl_context(ctx)->dri_context;
> +   void * fence = dri2_dpy->fence->create_fence_fd(dri_ctx, -1);
> +   if (fence) {
> +  fence_fd = dri2_dpy->fence->get_fence_fd(dri2_dpy->dri_screen,
> +   fence);
> +  dri2_dpy->fence->destroy_fence(dri2_dpy->dri_screen, fence);
> +   }
> +   dri2_surface_set_retrieve_fence(surf, fence_fd);
> +}
> +
>  /**
>   * Called via eglMakeCurrent(), drv->API.MakeCurrent().
>   */
> @@ -1352,8 +1389,12 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, 
> _EGLSurface *dsurf,
> rdraw = (rsurf) ? dri2_dpy->vtbl->get_dri_drawable(rsurf) : NULL;
> cctx = 

Re: [Mesa-dev] [PATCH] Revert "i965: Call intel_prepare_render() from intel_update_state()"

2017-07-20 Thread Tapani Pälli

Works for Android-IA:
Tested-by: Tapani Pälli 

On 07/20/2017 09:00 AM, Kenneth Graunke wrote:

This reverts commit b7153c3e9f9d2d430b0338313587a00e531e4800.

The point of that commit was to ensure intel_prepare_render() occurred
before color resolves on the current framebuffer.  In 0673bbfd9ba16be8
(i965: Move surface resolves back to draw/dispatch time), Jason moved
brw_predraw_resolve_framebuffer back to draw time, which is already
after a intel_prepare_render() call.  So, this is no longer necessary.

Furthermore, it caused problems.  "mpv" would only display a small
corner of movies, and Android started failing camera CTS tests.

This is because intel_prepare_render() ended up handling DRI2 events
which caused the drawable to be resized at an inopportune time, flagging
ctx->NewState |= _NEW_BUFFERS, but at a point where we've already copied
ctx->NewState, and failed to notice the newly set flag.

The lack of _NEW_BUFFERS caused us to skip 3DSTATE_DRAWING_RECTANGLE,
so the drawing ended up being clipped to an outdated framebuffer size.

Just drop the hack and go back to handling this at the proper time.

Thanks to Matti Hämäläinen (ccr) and Tomasz Figa (tfiga) for reporting
these issues.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101558
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101704
---
  src/mesa/drivers/dri/i965/brw_context.c | 2 --
  1 file changed, 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index bd26e2332c7..102d7223a93 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -194,8 +194,6 @@ intel_update_state(struct gl_context * ctx)
 if (new_state & _NEW_POLYGON)
brw->polygon_front_bit = _mesa_polygon_get_front_bit(ctx);
  
-   intel_prepare_render(brw);

-
 if (new_state & _NEW_BUFFERS) {
intel_update_framebuffer(ctx, ctx->DrawBuffer);
if (ctx->DrawBuffer != ctx->ReadBuffer)


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [EGL android: accquire fence implementation] i965: Queue the buffer with a sync fence for Android OS (v4)

2017-07-20 Thread Zhongmin Wu
Before we queued the buffer with a invalid fence (-1), it will
make some benchmarks failed to test such as flatland.

Now we get the out fence during the flushing buffer and then pass
it to SurfaceFlinger in eglSwapbuffer function.

v2: a) Also implement the fence in cancelBuffer.
b) The last sync fence is stored in drawable object
   rather than brw context.
c) format clear.

v3: a) Save the last fence fd in DRI Context object.
b) Return the last fence if the batch buffer is empty and
   nothing to be flushed when _intel_batchbuffer_flush_fence
c) Add the new interface in vbtl to set the retrieve fence
   in the egl surface. This is just for cancelBuffer.
d) For queueBuffer, the fence is get with DRI fence interface.
   For cancelBuffer, the fence is get before the context is
   reset, and the fence is then  moved to its surface.
v3.1 a) close fd in the new vbtl interface on none Android platform

v4: a) The last fence is saved in brw context.
b) The retrieve fd is for all the platform but not just Android
c) Add a uniform dri2 interface to initialize the surface.

Change-Id: Ic0773c19788d612a98d1402f5b5619dab64c1bc2
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-43936
Reported-On: https://bugs.freedesktop.org/show_bug.cgi?id=101655
Signed-off-by: Zhongmin Wu 
Reported-by: Li, Guangli 
Tested-by: Marathe, Yogesh 
---
 src/egl/drivers/dri2/egl_dri2.c   |   47 +
 src/egl/drivers/dri2/egl_dri2.h   |5 +++
 src/egl/drivers/dri2/platform_android.c   |   11 +++---
 src/egl/drivers/dri2/platform_drm.c   |2 +-
 src/egl/drivers/dri2/platform_surfaceless.c   |2 +-
 src/egl/drivers/dri2/platform_wayland.c   |2 +-
 src/egl/drivers/dri2/platform_x11.c   |2 +-
 src/egl/drivers/dri2/platform_x11_dri3.c  |2 +-
 src/mesa/drivers/dri/i965/brw_context.c   |5 +++
 src/mesa/drivers/dri/i965/brw_context.h   |1 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.c |   17 +++--
 11 files changed, 85 insertions(+), 11 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 020a0bc..94ad360 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1307,6 +1307,26 @@ dri2_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLContext *ctx)
return EGL_TRUE;
 }
 
+EGLBoolean
+dri2_surf_init(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
+_EGLConfig *conf, const EGLint *attrib_list)
+{
+   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
+   dri2_surf->retrieve_fd = -1;
+   return _eglInitSurface(surf, dpy, type, conf, attrib_list);
+}
+
+void
+dri2_surface_set_retrieve_fence( _EGLSurface *surf, int fence_fd)
+{
+   struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
+   if (dri2_surf->retrieve_fd >=0)
+  close(dri2_surf->retrieve_fd);
+
+   dri2_surf->retrieve_fd = fence_fd;
+   return;
+}
+
 static EGLBoolean
 dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 {
@@ -1315,9 +1335,26 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, 
_EGLSurface *surf)
if (!_eglPutSurface(surf))
   return EGL_TRUE;
 
+   dri2_surface_set_retrieve_fence(surf, -1);
return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf);
 }
 
+static void
+dri2_surf_get_fence_fd(_EGLContext *ctx,
+   _EGLDisplay *dpy, _EGLSurface *surf)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+   int fence_fd = -1;
+   __DRIcontext *dri_ctx = dri2_egl_context(ctx)->dri_context;
+   void * fence = dri2_dpy->fence->create_fence_fd(dri_ctx, -1);
+   if (fence) {
+  fence_fd = dri2_dpy->fence->get_fence_fd(dri2_dpy->dri_screen,
+   fence);
+  dri2_dpy->fence->destroy_fence(dri2_dpy->dri_screen, fence);
+   }
+   dri2_surface_set_retrieve_fence(surf, fence_fd);
+}
+
 /**
  * Called via eglMakeCurrent(), drv->API.MakeCurrent().
  */
@@ -1352,8 +1389,12 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *dsurf,
rdraw = (rsurf) ? dri2_dpy->vtbl->get_dri_drawable(rsurf) : NULL;
cctx = (dri2_ctx) ? dri2_ctx->dri_context : NULL;
 
+   int fence_fd = -1;
if (old_ctx) {
   __DRIcontext *old_cctx = dri2_egl_context(old_ctx)->dri_context;
+  if (old_dsurf) {
+ dri2_surf_get_fence_fd(old_ctx, disp, old_dsurf);
+  }
   dri2_dpy->core->unbindContext(old_cctx);
}
 
@@ -1490,6 +1531,9 @@ static EGLBoolean
 dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 {
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
+   _EGLContext *ctx = _eglGetCurrentContext();
+   if (ctx && surf)
+  dri2_surf_get_fence_fd(ctx, dpy, surf);
return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
 }
 
@@ -1499,6 +1543,9 @@ 

Re: [Mesa-dev] [PATCH 2/2] android: fix spirv_info generation

2017-07-20 Thread Tapani Pälli



On 07/19/2017 05:01 PM, Rob Herring wrote:

On Wed, Jul 19, 2017 at 8:56 AM, Emil Velikov  wrote:

On 19 July 2017 at 14:14, Tapani Pälli  wrote:

On 07/19/2017 03:29 PM, Emil Velikov wrote:


On 19 July 2017 at 08:12, Tapani Pälli  wrote:


Depending on build order, LOCAL_PATH maybe set or not (and can't
be trusted to have assumed path), change modifies all occurences
of LOCAL_PATH as locally defined COMPILER_PATH instead.


Sounds like a bug somewhere or a fundamental breakage in the Android
world.

$cat src/compiler/Android.mk
...
LOCAL_PATH := $(call my-dir)

include $(LOCAL_PATH)/Android.glsl.mk
include $(LOCAL_PATH)/Android.nir.mk
...

$cat src/compiler/Android.nir.mk
...
LOCAL_PATH := $(call my-dir)
...
include $(CLEAR_VARS) // is this one one causing problems?
...
include $(LOCAL_PATH)/Android.nir.gen.mk
...

Hence LOCAL_PATH should be set, and should point to the correct place.



Signed-off-by: Tapani Pälli 
---
   src/compiler/Android.nir.gen.mk | 38
--
   1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/compiler/Android.nir.gen.mk
b/src/compiler/Android.nir.gen.mk
index 4507ac4..81511de 100644
--- a/src/compiler/Android.nir.gen.mk
+++ b/src/compiler/Android.nir.gen.mk
@@ -27,6 +27,8 @@ ifeq ($(LOCAL_MODULE_CLASS),)
   LOCAL_MODULE_CLASS := STATIC_LIBRARIES
   endif

+COMPILER_PATH := $(MESA_TOP)/src/compiler
+


A define LOCAL_PATH at the top of the file should also work, right?



Right but this would override what LOCAL_PATH was before so did not want to
do that. I can try alternative approach. Maybe it is CLEAR_VARS that causes
this as in my case LOCAL_PATH had something like 'build/core' or
'core/build' and that did not work.


Not sure what causes the fallout here, but if LOCAL_PATH is off then
we should be fine with correcting it.


Agreed.


I've tried this and it does not work. Setting LOCAL_PATH in the file 
results in following (same as before) error:


--- 8< ---
FAILED: /bin/bash -c "python build/core/spirv/spirv_info_c.py 
build/core/spirv/spirv.core.grammar.json 
out/target/product/androidia_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/spirv/spirv_info.c 
|| ( 
out/target/product/androidia_64/gen/STATIC_LIBRARIES/libmesa_nir_intermediates/spirv/spirv_info.c; 
false)"
python: can't open file 'build/core/spirv/spirv_info_c.py': [Errno 2] No 
such file or directory

--- 8< ---

Only using something else than LOCAL_PATH, like MY_LOCAL_PATH works.


Quick grep through my very limited checkout shows the following odd
bits. Seemingly unrelated, yet wrong.

system/core/liblog/Android.mk:LOCAL_PATH := $(my-dir)
system/core/Android.mk:LOCAL_PATH := $(my-dir)


"call" is not required when there are no parameters.

Rob


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] Revert "i965: Call intel_prepare_render() from intel_update_state()"

2017-07-20 Thread Kenneth Graunke
This reverts commit b7153c3e9f9d2d430b0338313587a00e531e4800.

The point of that commit was to ensure intel_prepare_render() occurred
before color resolves on the current framebuffer.  In 0673bbfd9ba16be8
(i965: Move surface resolves back to draw/dispatch time), Jason moved
brw_predraw_resolve_framebuffer back to draw time, which is already
after a intel_prepare_render() call.  So, this is no longer necessary.

Furthermore, it caused problems.  "mpv" would only display a small
corner of movies, and Android started failing camera CTS tests.

This is because intel_prepare_render() ended up handling DRI2 events
which caused the drawable to be resized at an inopportune time, flagging
ctx->NewState |= _NEW_BUFFERS, but at a point where we've already copied
ctx->NewState, and failed to notice the newly set flag.

The lack of _NEW_BUFFERS caused us to skip 3DSTATE_DRAWING_RECTANGLE,
so the drawing ended up being clipped to an outdated framebuffer size.

Just drop the hack and go back to handling this at the proper time.

Thanks to Matti Hämäläinen (ccr) and Tomasz Figa (tfiga) for reporting
these issues.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101558
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101704
---
 src/mesa/drivers/dri/i965/brw_context.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c
index bd26e2332c7..102d7223a93 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -194,8 +194,6 @@ intel_update_state(struct gl_context * ctx)
if (new_state & _NEW_POLYGON)
   brw->polygon_front_bit = _mesa_polygon_get_front_bit(ctx);
 
-   intel_prepare_render(brw);
-
if (new_state & _NEW_BUFFERS) {
   intel_update_framebuffer(ctx, ctx->DrawBuffer);
   if (ctx->DrawBuffer != ctx->ReadBuffer)
-- 
2.13.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


<    1   2