Home | History | Annotate | Line # | Download | only in sna
README revision 1.1
      1  1.1  riastrad SandyBridge's New Acceleration
      2  1.1  riastrad ------------------------------
      3  1.1  riastrad 
      4  1.1  riastrad The guiding principle behind the design is to avoid GPU context switches.
      5  1.1  riastrad On SandyBridge (and beyond), these are especially pernicious because the
      6  1.1  riastrad RENDER and BLT engine are now on different rings and require
      7  1.1  riastrad synchronisation of the various execution units when switching contexts.
      8  1.1  riastrad They were not cheap on early generation, but with the increasing
      9  1.1  riastrad complexity of the GPU, avoiding such serialisations is important.
     10  1.1  riastrad 
     11  1.1  riastrad Furthermore, we try very hard to avoid migrating between the CPU and GPU.
     12  1.1  riastrad Every pixmap (apart from temporary "scratch" surfaces which we intend to
     13  1.1  riastrad use on the GPU) is created in system memory. All operations are then done
     14  1.1  riastrad upon this shadow copy until we are forced to move it onto the GPU. Such
     15  1.1  riastrad migration can only be first triggered by: setting the pixmap as the
     16  1.1  riastrad scanout (we obviously need a GPU buffer here), using the pixmap as a DRI
     17  1.1  riastrad buffer (the client expects to perform hardware acceleration and we do not
     18  1.1  riastrad want to disappoint) and lastly using the pixmap as a RENDER target. This
     19  1.1  riastrad last is chosen because when we know we are going to perform hardware
     20  1.1  riastrad acceleration and will continue to do so without fallbacks, using the GPU
     21  1.1  riastrad is much, much faster than the CPU. The heuristic I chose therefore was
     22  1.1  riastrad that if the application uses RENDER, i.e. cairo, then it will only be
     23  1.1  riastrad using those paths and not intermixing core drawing operations and so
     24  1.1  riastrad unlikely to trigger a fallback.
     25  1.1  riastrad 
     26  1.1  riastrad The complicating case is front-buffer rendering. So in order to accommodate
     27  1.1  riastrad using RENDER on an application whilst running xterm without a composite
     28  1.1  riastrad manager redirecting all the pixmaps to backing surfaces, we have to
     29  1.1  riastrad perform damage tracking to avoid excess migration of portions of the
     30  1.1  riastrad buffer.
     31