1. 18 Dec, 2013 7 commits
    • Chris Wilson's avatar
      Fixup glx support · 556adfa6
      Chris Wilson authored
      Renaming glamor_priv->dispatch and wrapping the access to
      the dispatch table with a function that also ensured the
      context was bound.
      
       dispatch = glamor_get_dispatch(glamor_priv);
       ...
       glamor_put_dispatch(glamor_priv);
      
      So that we catch all places where we attempt to call into GL withouta
      context. As an optimisation we can then do glamor_get_context();
      glamor_put_context() around the rendering entry points to reduce the
      frequency of having to restore the old context. (Along with allowing
      the context to be recursively acquired and making the old context part of
      the glamor_egl state.)
      Reviewed-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      556adfa6
    • Zhigang Gong's avatar
      GLX: Enable glx support. · 430bc16c
      Zhigang Gong authored
      If we are using MESA as our GL library, then both xserver's
      GLX and glamor are link to the same library. As xserver's
      GLX has its own _glapi_get/set_context/dispatch etc, and it
      is a simplified version derived from mesa thus is not
      sufficient for mesa/egl's dri loader which is used by glamor.
      
      Then if glx module is loaded before glamoregl module, the
      initialization of mesa/egl/opengl will not be correct, and
      will fail at a very early stage, most likely fail to map
      the element buffer.
      
      Two methodis to fix this problem, first is to modify the xserver's
      glx's glapi.c to fit mesa's requirement. The second is to put
      a glamor.conf as below, to the system's xorg.conf path.
      
      Section "Module"
              Load  "glamoregl"
      EndSection
      
      Then glamor will be loaded firstly, and the mesa's libglapi.so
      will be used. As current xserver's dispatch table is the same
      as mesa's, then the glx's dri loader can work without problem.
      
      We took the second method as it don't need any change to xorg.:)
      Although this is not a graceful implementation as it depends
      on the xserver's dispatch table and the mesa's dispatch table
      is the same and the context set and get is using the same method.
      Anyway it works.
      
      As by default, xserver will enable GLX_USE_TLS. But mesa will not
      enable it, you may need to enable that when build mesa.
      
      Three pre-requirements to make this glamor version work:
      
      0. Make sure xserver has commit 66e603, if not please pull the latest
         master branch.
      1. Rebuild mesa by enable GLX_USE_TLS.
      2. Put the glamor.conf to your system's xorg.conf path and make sure
         it loaded prior to glx module.
      
      Preliminary testing shows indirect glxgears works fine.
      
      If user want to use GLES2 for glamor by using MESA, GLX will not
      work correctly.
      
      If you are not using normal MESA, for example PVR's private GLES
      implementation, then it should be ok to use GLES2 glamor and the
      GLX should work as expected. In this commit, I use gbm to check
      whether we are using MESA or non-mesa. Maybe not the best way.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      430bc16c
    • Zhigang Gong's avatar
      Fixed a rendering bug at fillspans. · fbccc4bb
      Zhigang Gong authored
      We should not change the points coords when loop for the clip
      rects. Change to use another variable to store the clipped
      coords and keep the original coords. This bug cause some
      XTS failures. Now fix it.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      fbccc4bb
    • Zhigang Gong's avatar
      glamor-for-ddx: Exports all rendering/drawing functions. · 8c7fcefb
      Zhigang Gong authored
      This commit exports all the rest rendering/drawing functions
      to the DDX drivers. And introduce some new pixmap type. For
      a pixmap which has a separated texture, we never fallback
      it to the DDX layer.
      
      This commit also adds the following new functions:
      glamor_composite_rects, glamor_get_image_nf which are needed
      by UXA framework. Just a simple wrapper function of miXXX.
      Will consider to optimize them next few weeks.
      
      This commit also Fixed a glyphs rendering bug pointed by Chris.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      8c7fcefb
    • Zhigang Gong's avatar
      Remove the access mode from private pixmap structure. · 92fd8387
      Zhigang Gong authored
      Change the finish_access to pass in the access mode, and remove
      the access mode from the pixmap structure. This element should
      not be a pixmap's property.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      92fd8387
    • Zhigang Gong's avatar
      Add new version glamor_fillspans without internal fallback. · ba1b3b53
      Zhigang Gong authored
      For the purpose of incrementally intergration of existing intel
      driver, for the GC operations we may don't want to use glamor's
      internal fallback which is in general much slower than the
      implementation in intel driver. If the parameter "fallback" is
      false when call the glamor_fillspans, then if glamor found it
      can't accelerate it then it will just return a FALSE rather than
      fallback to a slow path.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      ba1b3b53
    • Zhigang Gong's avatar
      Initial version. · b861aad8
      Zhigang Gong authored
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      b861aad8
  2. 26 Sep, 2011 7 commits
    • Zhigang Gong's avatar
      glamor: Change to use the original drawable in glamor_fill. · bd0ea43f
      Zhigang Gong authored
      As glamor_fill may fallback to software rasterization, we'd
      better to use the original drawable as input paramter.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      bd0ea43f
    • Zhigang Gong's avatar
      glamor : Add dynamic texture uploading feature. · 355334fc
      Zhigang Gong authored
      Major refactoring.
      1. Rewrite the pixmap texture uploading and downloading functions.
         Add some new functions for both the prepare/finish access and
         the new performance feature dynamic texture uploading, which
         could download and upload the current image to/from a private
         texture/fbo. In the uploading or downloading phase, we need to
         handle two things:
         The first is the yInverted option, If it set, then we don't need
         to flip y. If not set, if it is from a dynamic texture uploading
         then we don't need to flip either if the current drawing process
         will flip it latter. If it is from finish_access, then we must
         flip the y axis.
      
         The second thing is the alpha channel hanlding, if the pixmap's
         format is something like x8a8r8g8, x1r5g5b5 which means it doesn't
         has alpha channel, but it do has those extra bits. Then we need to
         wire those bits to 1.
      
      2. Add almost all the required picture format support.
         This is not as trivial as it looks like. The previous implementation
         only support GL_a8,GL_a8r8g8b8,GL_x8r8g8b8. All the other format,
         we have to fallback to cpu. The reason why we can't simply add those
         other color format is because the exists of picture. one drawable
         pixmap may has one or even more container pictures. The drawable pixmap's
         depth can't map to a specified color format, for example depth 16 can
         mapped to r5g6b5, x1r5g5b5, a1r5g5b5, or even b5g6r5. So we can't get
         get the color format just from the depth value. But the pixmap do not
         has a pict_format element. We have to make a new one in the pixmap
         private data structure. Reroute the CreatePicture to glamor_create_picture
         and then store the picture's format to the pixmap's private structure.
      
         This is not an ideal solution, as there may be more than one pictures
         refer to the same pixmap. Then we will have trouble. There is an example
         in glamor_composite_with_shader. The source and mask often share the
         same pixmap, but use different picture format. Our current solution is to
         combine those two different picture formats to one which will not lose any
         data. Then change the source's format to this new format and then upload
         the pixmap to texture once. It works. If we fail to find a matched new
         format then we fallback.
      
         There still is a potential problem, if two pictures refer to the same
         pixmap, and one of them destroy the picture, but the other still remained
         to be used latter. We don't handle that situation currently. To be fixed.
      
      3. Dynamic texture uploading.
         This is a performance feature. Although we don't like the client to hold
         a pixmap data to shared memory and we can't accelerate it. And even worse,
         we may need to fallback all the required pixmaps to cpu memory and then
         process them on CPU. This feature is to mitigate this penalty. When the
         target pixmap has a valid gl fbo attached to it. But the other pixmaps are
         not. Then it will be more efficient to upload the other pixmaps to GPU and
         then do the blitting or rendering on GPU than fallback all the pixmaps to CPU.
         To enable this feature, I experienced a significant performance improvement
         in the Game "Mines" :).
      
      4. Debug facility.
         Modify the debug output mechanism. Now add a new macro:
         glamor_debug_output(_level_, _format_,...) to conditional output some messages
         according to the environment variable GLAMOR_DEBUG. We have the following
         levels currently.
          exports GLAMOR_DEBUG to 3 will enable all the above messages.
      
      5. Changes in pixmap private data structure.
         Add some for the full color format supports and relate it to the pictures which
         already described. Also Add the following new elements:
         gl_fbo - to indicates whether this pixmap is on gpu only.
         gl_tex - to indicates whether the tex is valid and is containing the pixmap's
                  image originally.
         As we bring the dynamic pixmap uploading feature, so a cpu memory pixmap may
         also has a valid fbo or tex attached to it. So we will have to use the above
         new element to check it true type.
      
      After this commit, we can pass the rendercheck testing for all the picture formats.
      And is much much fater than fallback to cpu when doing rendercheck testing.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      355334fc
    • Zhigang Gong's avatar
      glamor: Simplify fill acceleration for spans/polyfillrect by only clipping once. · ba6dd8aa
      Zhigang Gong authored
          This commit was borrowed from uxa driver contributed by Eric.
          commit number is e0066e77e026b0dd0daa0c3765473c7d63aa6753. commit log paste as
          below:
          We were clipping each span against the bounds of the clip, throwing
          out the span early if it was all clipped, and then walked the clip box
          clipping against each of the cliprects.  We would expect spans to
          typically be clipped against one box, and not thrown out, so we were
          not saving any work there.  For multiple cliprects, we were adding
          work.  Only for many spans clipped entirely out of a complicated clip
          region would it have saved work, and it clearly didn't save bugs as
          evidenced by the many fix attempts here.
      Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
      ba6dd8aa
    • Eric Anholt's avatar
      glamor: Enable glamor_fill_spans(). · f88d76cf
      Eric Anholt authored
      x11perf -wline100 performance goes from 8.8/sec to 111/sec.
      f88d76cf
    • Eric Anholt's avatar
      glamor: All the fallbacks in the world. · d8d3fa10
      Eric Anholt authored
      Bringup is really not flying when I can't see anything.  So dump back
      to all software so I can turn on a bit at a time.
      d8d3fa10
    • Eric Anholt's avatar
      glamor: Create FBOs for pixmaps. · 51910356
      Eric Anholt authored
      51910356
    • Eric Anholt's avatar
  3. 06 Jun, 2010 1 commit
    • Keith Packard's avatar
      Rename region macros to eliminate screen argument · 2dc13892
      Keith Packard authored
      This is a combination of a huge mechanical patch and a few small
      fixups required to finish the job. They were reviewed separately, but
      because the server does not build without both pieces, I've merged
      them together at this time.
      
      The mechanical changes were performed by running the included
      'fix-region' script over the whole tree:
      
      $ git ls-files | grep -v '^fix-' | xargs ./fix-region
      
      And then, the white space errors in the resulting patch were fixed
      using the provided fix-patch-whitespace script.
      
      $ sh ./fix-patch-whitespace
      
      Thanks to Jamey Sharp for the mighty fine sed-generating sed script.
      
      The hand-done changes involve removing functions from dix/region.c
      that duplicate inline functions in include/regionstr.h, along with
      their declarations in regionstr.h, mi.h and mispans.h.
      Reviewed-by: Jamey Sharp's avatarJamey Sharp <jamey@minilop.net>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      2dc13892
  4. 03 Dec, 2008 1 commit
    • Paulo Cesar Pereira de Andrade's avatar
      Rework symbol visibility for easier maintenance · 49f77fff
      Paulo Cesar Pereira de Andrade authored
        Save in a few special cases, _X_EXPORT should not be used in C source
      files. Instead, it should be used in headers, and the proper C source
      include that header. Some special cases are symbols that need to be
      shared between modules, but not expected to be used by external drivers,
      and symbols that are accessible via LoaderSymbol/dlopen.
      
        This patch also adds conditionally some new sdk header files, depending
      on extensions enabled. These files were added to match pattern for
      other extensions/modules, that is, have the headers "deciding" symbol
      visibility in the sdk. These headers are:
      o Xext/panoramiXsrv.h, Xext/panoramiX.h
      o fbpict.h (unconditionally)
      o vidmodeproc.h
      o mioverlay.h (unconditionally, used only by xaa)
      o xfixes.h (unconditionally, symbols required by dri2)
      
        LoaderSymbol and similar functions now don't have different prototypes,
      in loaderProcs.h and xf86Module.h, so that both headers can be included,
      without the need of defining IN_LOADER.
      
        xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
      not exported (and with a comment about it).
      49f77fff
  5. 30 Nov, 2008 1 commit
    • Paulo Cesar Pereira de Andrade's avatar
      Export symbols defined in the sdk. · d6cbd451
      Paulo Cesar Pereira de Andrade authored
        This is the biggest "visibility" patch. Instead of doing a "export"
      symbol on demand, export everything in the sdk, so that if some module
      fails due to an unresolved symbol, it is because it is using a symbol
      not in the sdk.
      
        Most exported symbols shouldn't really be made visible, neither
      advertised in the sdk, as they are only used by a single shared object.
      
        Symbols in the sdk (or referenced in sdk macros), but not defined
      anywhere include:
      XkbBuildCoreState()
      XkbInitialMap
      XkbXIUnsupported
      XkbCheckActionVMods()
      XkbSendCompatNotify()
      XkbDDXFakePointerButton()
      XkbDDXApplyConfig()
      _XkbStrCaseCmp()
      _XkbErrMessages[]
      _XkbErrCode
      _XkbErrLocation
      _XkbErrData
      XkbAccessXDetailText()
      XkbNKNDetailMaskText()
      XkbLookupGroupAndLevel()
      XkbInitAtoms()
      XkbGetOrderedDrawables()
      XkbFreeOrderedDrawables()
      XkbConvertXkbComponents()
      XkbWriteXKBSemantics()
      XkbWriteXKBLayout()
      XkbWriteXKBKeymap()
      XkbWriteXKBFile()
      XkbWriteCFile()
      XkbWriteXKMFile()
      XkbWriteToServer()
      XkbMergeFile()
      XkmFindTOCEntry()
      XkmReadFileSection()
      XkmReadFileSectionName()
      InitExtInput()
      xf86CheckButton()
      xf86SwitchCoreDevice()
      RamDacSetGamma()
      RamDacRestoreDACValues()
      xf86Bpp
      xf86ConfigPix24
      xf86MouseCflags[]
      xf86SupportedMouseTypes[]
      xf86NumMouseTypes
      xf86ChangeBusIndex()
      xf86EntityEnter()
      xf86EntityLeave()
      xf86WrapperInit()
      xf86RingBell()
      xf86findOptionBoolean()
      xf86debugListOptions()
      LoadSubModuleLocal()
      LoaderSymbolLocal()
      getInt10Rec()
      xf86CurrentScreen
      xf86ReallocatePciResources()
      xf86NewSerialNumber()
      xf86RandRSetInitialMode()
      fbCompositeSolidMask_nx1xn
      fbCompositeSolidMask_nx8888x0565C
      fbCompositeSolidMask_nx8888x8888C
      fbCompositeSolidMask_nx8x0565
      fbCompositeSolidMask_nx8x0888
      fbCompositeSolidMask_nx8x8888
      fbCompositeSrc_0565x0565
      fbCompositeSrc_8888x0565
      fbCompositeSrc_8888x0888
      fbCompositeSrc_8888x8888
      fbCompositeSrcAdd_1000x1000
      fbCompositeSrcAdd_8000x8000
      fbCompositeSrcAdd_8888x8888
      fbGeneration
      fbIn
      fbOver
      fbOver24
      fbOverlayGeneration
      fbRasterizeEdges
      fbRestoreAreas
      fbSaveAreas
      composeFunctions
      VBEBuildVbeModeList()
      VBECalcVbeModeIndex()
      TIramdac3030CalculateMNPForClock()
      shadowBufPtr
      shadowFindBuf()
      miRRGetScreenInfo()
      RRSetScreenConfig()
      RRModePruneUnused()
      PixmanImageFromPicture()
      extern int miPointerGetMotionEvents()
      miClipPicture()
      miRasterizeTriangle()
      fbPush1toN()
      fbInitializeBackingStore()
      ddxBeforeReset()
      SetupSprite()
      InitSprite()
      DGADeliverEvent()
      
        SPECIAL CASES
      o defined as _X_INTERNAL
      	xf86NewInputDevice()
      o defined as static
      	fbGCPrivateKey
      	fbOverlayScreenPrivateKey
      	fbScreenPrivateKey
      	fbWinPrivateKey
      o defined in libXfont.so, but declared in xorg/dixfont.h
      	GetGlyphs()
      	QueryGlyphExtents()
      	QueryTextExtents()
      	ParseGlyphCachingMode()
      	InitGlyphCaching()
      	SetGlyphCachingMode()
      d6cbd451
  6. 29 Jun, 2007 1 commit
  7. 21 Jul, 2006 1 commit
  8. 03 Jul, 2005 1 commit
  9. 04 Dec, 2004 1 commit
  10. 23 Apr, 2004 1 commit
  11. 14 Mar, 2004 1 commit
  12. 05 Mar, 2004 1 commit
  13. 03 Mar, 2004 1 commit
  14. 26 Feb, 2004 2 commits
  15. 14 Nov, 2003 1 commit