<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 19, 2017 at 5:49 AM, Eero Tamminen <span dir="ltr"><<a href="mailto:eero.t.tamminen@intel.com" target="_blank">eero.t.tamminen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I run this on few GEN9 machines and SynMark v7 DeferredAA test improved ~3%, so it seems multisample fast-clears do help. :-)<br></blockquote><div><br></div><div>Thanks!  I'll add that to the commit message on patch 5.<br><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
        - Eero<div><div class="h5"><br>
<br>
On 17.06.2017 01:41, Jason Ekstrand wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This series is a rework of Ben's series to enable the CCS format modifier.<br>
It started as an attempt to rebase his original patches on top of my<br>
resolve reworks inside the miptree code.  However, as I started to dive<br>
deeper, I found a number of subtle issues:<br>
<br>
 1) Thanks to the terrible set of INTEL_AUX_DISABLE_* flags that we use to<br>
    choose what aux buffers to use, we were set up to never use CCS_E for<br>
    any external buffers.  Even when Y-tiled on gen9, the most they would<br>
    ever get was CCS_D.<br>
<br>
 2) Whether to do a full or partial resolve or not was based on is_scanout<br>
    and not on the actual modifier.  If we use I915_FORMAT_MOD_Y_TILED (not<br>
    the CCS modifier) and choose to use CCS_E with it, it would only get<br>
    partial resolves and not full resolves.  Of course, this wasn't<br>
    actually a problem thanks to problem 1 above.<br>
<br>
 3) If a user ever imported an image with I915_FORMAT_MOD_Y_TILED_CCS<br>
    through EGL or GBM and did glClear on it, they would get a fast clear<br>
    with no way to force a resolve before handing it off to the other<br>
    process.  Since the other process doesn't know the clear color, this<br>
    means that any blocks in the clear state in the surface will get<br>
    whatever random clear color process B thinks it has.<br>
<br>
 4) There were three different places where we computed the pitch of the<br>
    CCS and they all did so differently.  When we go to create the image,<br>
    we would allocate the CCS with the same pitch as the main surface.  We<br>
    would then calculate the CCS pitch with ISL when we created mt->mcs_buf.<br>
    Finally, we had a different mechanism to compute the pitch when we pass<br>
    it back to the user.  Fortunately, the first only caused us to over-<br>
    allocate and I think the last two were equivalent (at least for the<br>
    simple case) so nothing exploded.<br>
<br>
 5) Thanks again to our confusing aux enable/disable, we haven't been doing<br>
    multisample fast-clears since cec30a666930ddb8476a9452a89364<wbr>a24979ff62<br>
    around a year ago.<br>
<br>
This series takes a bit more round-about approach to enabling the CCS<br>
modifier that should fix these issues:<br>
<br>
 * Patches 1-5 do a bit of refactoring and then rework the way we choose<br>
   the type of aux compression to use.  They move us away from the crazy<br>
   enable/disable system to a simple choice system.  This fixes (1) and (5)<br>
   above.<br>
<br>
 * Patches 6-15 refactor things so that we have only one path for going<br>
   from a __DRIimage to an intel_mipmap_tree.  This was rather painful<br>
   because we have to be careful to take into account the differences<br>
   between window system images regular images.<br>
<br>
 * Patches 16-22 rework image creation and import to use ISL to do their<br>
   surface layout calculations.  Previously, all of the surface layout<br>
   calculations were simply hand-rolled here.  In the particular case of<br>
   images, the hand-rolling was fairly safe because they were only ever<br>
   simple 2D non-array images.  However, with the addition of CCS, things<br>
   were going to get a bit tricky.<br>
<br>
 * Patches 23-30 add support for I915_FORMAT_MOD_Y_TILED.<br>
<br>
I've tested this series on our Jenkins system which runs piglit as well as<br>
the OpenGL and OpenGL ES test suites.  Both piglit and the OpenGL ES suite<br>
have some number of EGL tests which I hope have tested some of this.  I've<br>
also tested with kmscube and have verified that I get basically the same<br>
bandwidth numbers as Ben got on his original series, so I think CCS is<br>
working properly.<br>
<br>
This series can be found here:<br>
<br>
<a href="https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=review/i965-ccs-mod" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/~<wbr>jekstrand/mesa/log/?h=review/i<wbr>965-ccs-mod</a><br>
<br>
Cc: Ben Widawsky <<a href="mailto:ben@bwidawsk.net" target="_blank">ben@bwidawsk.net</a>><br>
Cc: Daniel Stone <<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>><br>
Cc: Varad Gautam <<a href="mailto:varad.gautam@collabora.com" target="_blank">varad.gautam@collabora.com</a>><br>
Cc: Chad Versace <<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>><br>
Cc: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com" target="_blank">topi.pohjolainen@intel.com</a>><br>
<br>
Ben Widawsky (6):<br>
  i965/miptree: Add a return for updating of winsys<br>
  i965/miptree: Allocate mt earlier in update winsys<br>
  i965: Support images with aux buffers<br>
  i965/miptree: Allocate mcs_buf for an image's CCS<br>
  i965: Pretend that CCS modified images are two planes<br>
  i965: Advertise the CCS modifier<br>
<br>
Jason Ekstrand (24):<br>
  i965/miptree: Delete the layered rendering resolve<br>
  i965/miptree: Rename the non_msrt_mcs functions to _ccs<br>
  i965: Don't bother with HiZ in renderbuffer_move_to_temp<br>
  i965: Clamp clear colors to the representable range<br>
  i965/miptree: Rework aux enabling<br>
  i965: Move the DRIimage -> miptree code to intel_mipmap_tree.c<br>
  i965/miptree: Pass the offset into create_for_bo in<br>
    create_for_dri_image<br>
  i965/miptree: Add tile_x/y to total_width/height<br>
  i965/miptree: Set level_x/h in create_for_dri_image<br>
  i965: Use miptree_create_for_dri_image in<br>
    image_target_renderbuffer_stor<wbr>age<br>
  i965/miptree: Add an explicit format parameter to create_for_dri_image<br>
  i965/miptree: Add support for window system images to<br>
    create_for_dri_image<br>
  i965: Use create_for_dri_image in intel_update_image_buffer<br>
  i965/miptree: Move CCS allocation into create_for_dri_image<br>
  i965: Add an isl_device to intel_screen<br>
  intel/isl: Add basic modifier introspection<br>
  intel/isl: Add a helper to convert tilings fro ISL to i915<br>
  i965/screen: Use ISL for allocating image BOs<br>
  i965/screen: Use ISL for doing image import checks<br>
  i965/screen: Drop get_tiled_height<br>
  intel/isl: Add support for I915_FORMAT_MOD_Y_TILED_CCS<br>
  intel/isl: Add a row_pitch parameter to surf_get_ccs_surf<br>
  i965/screen: Support import and export of surfaces with CCS<br>
  i965/miptree: More conservatively resolve external images<br>
<br>
 src/intel/Makefile.am                         |   1 +<br>
 src/intel/Makefile.sources                    |   1 +<br>
 src/intel/isl/isl.c                           |   4 +-<br>
 src/intel/isl/isl.h                           |  28 +-<br>
 src/intel/isl/isl_drm.c                       |  93 +++++<br>
 src/intel/vulkan/anv_image.c                  |   2 +-<br>
 src/mesa/drivers/dri/i965/<wbr>brw_blorp.c         |   4 +-<br>
 src/mesa/drivers/dri/i965/<wbr>brw_context.c       |  44 ++-<br>
 src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c     |  40 +++<br>
 src/mesa/drivers/dri/i965/int<wbr>el_fbo.c         |  30 +-<br>
 src/mesa/drivers/dri/i965/int<wbr>el_image.h       |   6 +<br>
 src/mesa/drivers/dri/i965/int<wbr>el_mipmap_tree.c | 496 ++++++++++++++++++--------<br>
 src/mesa/drivers/dri/i965/int<wbr>el_mipmap_tree.h |  77 ++--<br>
 src/mesa/drivers/dri/i965/int<wbr>el_screen.c      | 216 +++++++----<br>
 src/mesa/drivers/dri/i965/int<wbr>el_screen.h      |   4 +<br>
 src/mesa/drivers/dri/i965/int<wbr>el_tex_image.c   |  98 +----<br>
 16 files changed, 767 insertions(+), 377 deletions(-)<br>
 create mode 100644 src/intel/isl/isl_drm.c<br>
<br>
</blockquote>
<br></div></div>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>