Skip to content
  1. Sep 24, 2019
    • Andreas Baierl's avatar
      WIP: lima/ppir: Introduce late abs modifier lowering · fbfe42b8
      Andreas Baierl authored
      
      
      Some ops can't deal with abs sources directly, so we have to lower
      the abs modifier. Lower abs like sqrt(mul(x, x)).
      
      This is what the blob does and we pass some more piglit tests.
      This ppir lowering pass is executed at the very end when lowering
      of all the other alu instructions is already done but before
      lowering the consts.
      
      Signed-off-by: default avatarAndreas Baierl <ichgeh@imkreisrum.de>
      fbfe42b8
    • Connor Abbott's avatar
      lima/gpir: Fix 64-bit shift in scheduler spilling · fed5b605
      Connor Abbott authored
      
      
      There are 64 physical registers so the shift must be 64 bits.
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      fed5b605
    • Connor Abbott's avatar
      lima/gpir: Don't emit movs when translating from NIR · ef38a659
      Connor Abbott authored
      
      
      The scheduler doesn't expect them. To do this, I had to refactor the
      registration part of gpir_node_create_dest() to be separate from
      creating and inserting the node, since the last two now aren't done when
      handling moves. This adds more code but creates the possibility of
      automatically inserting input dependencies when inserting nodes, similar
      to what's done in NIR with the use-def lists (this isn't done yet).
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      ef38a659
    • Connor Abbott's avatar
      lima/gpir: Fix postlog2 fixup handling · 96c31d9a
      Connor Abbott authored
      
      
      We guarantee that a complex1 op is always used by postlog2 directly by
      rewriting the postlog2 op to be a move when there would be a move
      inserted between them. But we weren't doing this in all circumstances
      where there might be a move. Move the logic to place_move() so that it
      always happens. Fixes a few log tests that happened to start failing due
      to changes in the register allocator leading to a different scheduling
      order.
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      96c31d9a
    • Connor Abbott's avatar
      lima/gpir: Use registers for values live in multiple blocks · 1cd1cce0
      Connor Abbott authored
      
      
      This commit adds the framework for cross-basic-block register
      allocation. Like ARM's compiler, we assume that the value registers
      aren't usable across branches, which means we have to use physical
      registers to store any value that crosses a basic block. There are three
      parts to this:
      
      1. When translating from NIR, we rely on the NIR out-of-ssa pass to
      coalesce values into registers. We insert store_reg instructions for
      values used in more than one basic block, and load_reg instructions for
      values not defined in the same basic block (or defined after their use,
      for loops). So by the time we've translated out of NIR we've already
      split things into values (which are only used in the same basic block)
      and registers (which are only used in different basic blocks than where
      they're defined).
      
      2. We allocate the registers at the same time that we allocate the
      values, before the final scheduler. Unlike the values, where the
      assigned color is fake, we assign the actual physical index & component
      to physregs at this stage. load_reg and store_reg are treated as moves
      in the allocator and when creating write-after-read dependencies.
      
      3. Finally, in the main scheduler we have to avoid overwriting existing
      live physregs when spilling. First, we have to tell the scheduler which
      physical registers are live at the end of each block, to avoid
      overwriting those. If a register is only live at the beginning, we can
      reuse it for spilling after the last original use in the final program
      happens, i.e. before any original use is scheduled, but we have to be
      careful to add the proper dependencies so that the spill write is
      scheduled before the original reads. To handle this we repurpose
      reg_link for uses to be used by the scheduler.
      
      A few register-related things copied over from NIR or from other
      drivers can be dropped.
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      1cd1cce0
    • Connor Abbott's avatar
      lima/gpir: Support branch instructions · 7594ef6e
      Connor Abbott authored
      
      
      Because branch conditions have to be in the pass slot, there is no
      unconditional branch, and realistically the pass slot has to contain a
      move when branching (there's nothing it does that would be useful for
      operating on booleans, so we can't use it for anything when computing
      the branch condition), we put the branch instruction in the pass slot
      and at codegen time turn it into a move of the branch condition. This
      means that it doesn't have to be special-cased like store instructions
      are in the scheduler. Because of this decision we can remove the
      half-implemented BRANCH codegen slot. Finally, we (ab)use the existing
      schedule_first mechanism to make sure that branches are always last in
      the basic block.
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      7594ef6e
    • Connor Abbott's avatar
      lima/gpir: Only try to place actual children · 2df2e081
      Connor Abbott authored
      
      
      When picking a node to be scheduled, we try to schedule its children as
      well. But we shouldn't try to schedule nodes which only have a fake
      dependency on the original node, since this isn't the point of
      scheduling children at the same time and can break some expectations of
      the rest of the code.
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      2df2e081
    • Connor Abbott's avatar
      lima/gpir: Fix compiler warning · f989a024
      Connor Abbott authored
      
      
      Reviewed-by: default avatarVasily Khoruzhick <anarsoul@gmail.com>
      f989a024
    • Adam Jackson's avatar
      glx: Implement GLX_EXT_no_config_context · 0d635ccc
      Adam Jackson authored
      This is the GLX counterpart to EGL_KHR_no_config_context. Contexts may
      now be created without reference to an fbconfig, in which case it is
      treated as compatible with any fbconfig (and thus any GLX drawable).
      
      Khronos: https://github.com/KhronosGroup/OpenGL-Registry/pull/102
      
      
      Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      0d635ccc
    • Adam Jackson's avatar
      glx: Lift sending the MakeCurrent request to top-level code · 999c2aed
      Adam Jackson authored
      Somewhat terrifyingly, we never sent this for direct contexts, which
      means the server never knew the context/drawable bindings. To handle
      this sanely, pull the request code up out of the indirect backend, and
      rewrite the context switch path to call it as appropriate.  This
      attempts to preserve the existing behavior of not calling unbind() on
      the context if its refcount would not drop to zero.
      
      Of course, you can't just do this indiscriminately, because this is GLX
      and extant X servers have bugs and everything is terrible. To wit:
      
      - For 1.20.x prior to 1.20.6, you can bind a direct context once, but
      the second time you try to modify the context's binding you will get
      GLXBadContextTag. This includes unbinding the context. And "deleting"
      the context will leak memory, because it will still appear to be
      current.
      
      - For 1.19 and earlier, glXMakeCurrent(dpy, None, ctx) should be legal
      for GL 3.0+ contexts, but the server will throw BadMatch.
      
      To guard against this, we only send the request for indirect contexts
      unless the server is known good, and only mention one context at a time
      in such a request; if switching between contexts, we first unbind the
      old, and then bind the new. Note that the second VendorRelease() version
      is to catch XFree86 4.x and Xorg [67].x, which almost certainly have the
      above bugs. Other servers might report different version numbers here,
      but we can't do direct rendering against them, so this should be safe.
      
      Fixes glx-make-context, glx-multi-window-single-context and
      glx-query-drawable-glx_fbconfig_id-window. Sufficiently old piglit will
      regress on glx-make-glxdrawable-current (throwing BadMatch), which is
      fixed by piglit!116.
      999c2aed
    • Adam Jackson's avatar
      glx: Move vertex array protocol state into the indirect backend · 01e43798
      Adam Jackson authored
      Only relevant for indirect contexts, so let's get that code out of the
      common path.
      01e43798
  2. Sep 23, 2019
Loading