[Mesa-dev] Gallium interface little cleanup

José Fonseca jfonseca at vmware.com
Fri Mar 11 07:57:34 PST 2011


Look ok to me..

Jose

On Thu, 2011-03-10 at 20:32 -0800, Marek Olšák wrote:
> Hi,
> 
> I have done some of the changes in the gallium interface we discussed in the thread called "7 questions...".
> 
> There are 4 patches in total:
> 
> 1) gallium: kill is_resource_referenced
> 
> The function is_resource_referenced is removed. Considering that only st/xorg used it, I don't think this can cause any regressions in hardware drivers. However softpipe and llvmpipe use it internally, so I have kept it there and added driver-specific flags instead:
> 
> #define LP_UNREFERENCED 0
> #define LP_REFERENCED_FOR_READ (1 << 0)
> #define LP_REFERENCED_FOR_WRITE (1 << 1)
> 
> The same for softpipe (SP_*).
> 
> 
> 2) gallium: cleanup fence_signalled and fence_finish
> 
> This removes the "flags" parameter from both the functions and changes the return type to boolean (TRUE=success).
> 
> 
> 3) gallium: remove the geom_flags param from is_format_supported
> 
> This was unused anyway.
> 
> 
> 4) gallium: remove flags from the flush function
> 
> The drivers have been changed so that they behave as if all of the flags were set (if used at all). This is already implicit in most hardware drivers and required for multiple contexts anyway (besides maybe SWAPBUFFERS and FRAME, the exact meaning of which is undefined). Some state trackers were also abusing the PIPE_FLUSH_RENDER_CACHE flag to decide whether flush_frontbuffer should be called. New flag ST_FLUSH_FRONT has been added to st_api.h as a replacement, since the PIPE_FLUSH_* flags no longer exist.
> 
> 
> The patches are here (they are too large to be posted on ML):
>   http://cgit.freedesktop.org/~mareko/mesa/log/?h=gallium-cleanup
> 
> Please review.
> 
>  src/gallium/auxiliary/util/u_blit.c                |    7 +-
>  src/gallium/auxiliary/util/u_blitter.c             |    4 +-
>  src/gallium/auxiliary/util/u_caps.c                |    3 +-
>  src/gallium/auxiliary/util/u_gen_mipmap.c          |    2 +-
>  src/gallium/auxiliary/util/u_resource.c            |    8 -
>  src/gallium/auxiliary/util/u_surface.c             |    2 +-
>  src/gallium/auxiliary/util/u_transfer.c            |    7 -
>  src/gallium/auxiliary/util/u_transfer.h            |   12 --
>  src/gallium/auxiliary/util/u_vbuf_mgr.c            |   14 +-
>  src/gallium/docs/d3d11ddi.txt                      |    4 +-
>  src/gallium/drivers/cell/ppu/cell_context.c        |   14 --
>  src/gallium/drivers/cell/ppu/cell_fence.c          |    7 +-
>  src/gallium/drivers/cell/ppu/cell_fence.h          |    2 +-
>  src/gallium/drivers/cell/ppu/cell_flush.c          |    7 +-
>  src/gallium/drivers/cell/ppu/cell_screen.c         |    3 +-
>  src/gallium/drivers/failover/fo_context.c          |   17 +--
>  src/gallium/drivers/galahad/glhd_context.c         |   20 --
>  src/gallium/drivers/galahad/glhd_screen.c          |   18 +--
>  src/gallium/drivers/i915/i915_flush.c              |    2 +-
>  src/gallium/drivers/i915/i915_resource.c           |    1 -
>  src/gallium/drivers/i915/i915_resource_buffer.c    |    1 -
>  src/gallium/drivers/i915/i915_resource_texture.c   |    1 -
>  src/gallium/drivers/i915/i915_screen.c             |   15 +-
>  src/gallium/drivers/i965/brw_pipe_flush.c          |    1 -
>  src/gallium/drivers/i965/brw_resource_buffer.c     |   20 --
>  src/gallium/drivers/i965/brw_resource_texture.c    |   43 ----
>  src/gallium/drivers/i965/brw_screen.c              |   15 +-
>  src/gallium/drivers/identity/id_context.c          |   20 --
>  src/gallium/drivers/identity/id_screen.c           |   18 +--
>  src/gallium/drivers/llvmpipe/lp_context.c          |    3 +-
>  src/gallium/drivers/llvmpipe/lp_flush.c            |   47 ++---
>  src/gallium/drivers/llvmpipe/lp_flush.h            |    2 -
>  src/gallium/drivers/llvmpipe/lp_query.c            |    4 +-
>  src/gallium/drivers/llvmpipe/lp_screen.c           |   13 +-
>  src/gallium/drivers/llvmpipe/lp_setup.c            |   16 +-
>  src/gallium/drivers/llvmpipe/lp_setup.h            |    1 -
>  src/gallium/drivers/llvmpipe/lp_surface.c          |    2 -
>  src/gallium/drivers/llvmpipe/lp_texture.c          |    6 +-
>  src/gallium/drivers/llvmpipe/lp_texture.h          |   10 +
>  src/gallium/drivers/noop/noop_pipe.c               |   13 +-
>  src/gallium/drivers/nouveau/nouveau_buffer.c       |    1 -
>  src/gallium/drivers/nouveau/nouveau_screen.c       |   32 +---
>  src/gallium/drivers/nouveau/nouveau_screen.h       |    4 -
>  src/gallium/drivers/nv50/nv50_context.c            |   10 +-
>  src/gallium/drivers/nv50/nv50_miptree.c            |    1 -
>  src/gallium/drivers/nv50/nv50_resource.c           |   17 --
>  src/gallium/drivers/nv50/nv50_screen.c             |    2 +-
>  src/gallium/drivers/nvc0/nvc0_context.c            |   15 +-
>  src/gallium/drivers/nvc0/nvc0_miptree.c            |    1 -
>  src/gallium/drivers/nvc0/nvc0_resource.c           |   20 --
>  src/gallium/drivers/nvc0/nvc0_screen.c             |    2 +-
>  src/gallium/drivers/nvfx/nvfx_context.c            |    7 +-
>  src/gallium/drivers/nvfx/nvfx_miptree.c            |    6 +-
>  src/gallium/drivers/nvfx/nvfx_resource.c           |    9 -
>  src/gallium/drivers/nvfx/nvfx_screen.c             |    2 +-
>  src/gallium/drivers/nvfx/nvfx_state_emit.c         |    2 +-
>  src/gallium/drivers/r300/r300_blit.c               |    4 +-
>  src/gallium/drivers/r300/r300_flush.c              |    2 -
>  src/gallium/drivers/r300/r300_resource.c           |    8 -
>  src/gallium/drivers/r300/r300_screen.c             |   23 +--
>  src/gallium/drivers/r300/r300_screen_buffer.c      |   16 --
>  src/gallium/drivers/r300/r300_screen_buffer.h      |    3 -
>  src/gallium/drivers/r300/r300_texture.c            |    1 -
>  src/gallium/drivers/r300/r300_transfer.c           |    2 +-
>  src/gallium/drivers/r600/r600_buffer.c             |    9 -
>  src/gallium/drivers/r600/r600_pipe.c               |    5 +-
>  src/gallium/drivers/r600/r600_query.c              |    2 +-
>  src/gallium/drivers/r600/r600_resource.c           |    1 -
>  src/gallium/drivers/r600/r600_texture.c            |   17 +--
>  src/gallium/drivers/rbug/rbug_context.c            |   20 --
>  src/gallium/drivers/rbug/rbug_core.c               |    2 +-
>  src/gallium/drivers/rbug/rbug_screen.c             |   18 +--
>  src/gallium/drivers/softpipe/sp_context.c          |   26 ++--
>  src/gallium/drivers/softpipe/sp_context.h          |    9 +
>  src/gallium/drivers/softpipe/sp_fence.c            |   12 +-
>  src/gallium/drivers/softpipe/sp_flush.c            |   79 ++++----
>  src/gallium/drivers/softpipe/sp_flush.h            |    9 +-
>  src/gallium/drivers/softpipe/sp_screen.c           |    3 +-
>  src/gallium/drivers/svga/svga_context.c            |    2 +-
>  src/gallium/drivers/svga/svga_pipe_draw.c          |    2 +-
>  src/gallium/drivers/svga/svga_pipe_flush.c         |   33 ++--
>  src/gallium/drivers/svga/svga_resource.c           |    1 -
>  src/gallium/drivers/svga/svga_resource_buffer.c    |   37 ----
>  src/gallium/drivers/svga/svga_resource_texture.c   |   26 ---
>  src/gallium/drivers/svga/svga_screen.c             |   15 +-
>  src/gallium/drivers/trace/tr_context.c             |   30 +---
>  src/gallium/drivers/trace/tr_screen.c              |   24 +--
>  src/gallium/include/pipe/p_context.h               |   19 +--
>  src/gallium/include/pipe/p_defines.h               |   26 ---
>  src/gallium/include/pipe/p_screen.h                |   20 +--
>  src/gallium/include/state_tracker/st_api.h         |    5 +
>  .../state_trackers/d3d1x/dxgi/src/dxgi_native.cpp  |    2 +-
>  .../state_trackers/d3d1x/gd3d11/d3d11_context.h    |    2 +-
>  .../state_trackers/d3d1x/gd3d11/d3d11_screen.h     |   20 +-
>  .../state_trackers/dri/common/dri_context.c        |    4 +-
>  src/gallium/state_trackers/dri/common/dri_screen.c |   24 ++--
>  src/gallium/state_trackers/dri/sw/drisw.c          |    2 +-
>  src/gallium/state_trackers/egl/common/egl_g3d.c    |    2 +-
>  .../state_trackers/egl/common/egl_g3d_api.c        |   19 +--
>  .../state_trackers/egl/common/egl_g3d_sync.c       |    4 +-
>  .../state_trackers/egl/common/native_helper.c      |    4 +-
>  src/gallium/state_trackers/egl/drm/native_drm.c    |    2 +-
>  .../state_trackers/egl/fbdev/native_fbdev.c        |    2 +-
>  src/gallium/state_trackers/egl/gdi/native_gdi.c    |    2 +-
>  src/gallium/state_trackers/egl/x11/native_dri2.c   |    2 +-
>  src/gallium/state_trackers/glx/xlib/xm_api.c       |    6 +-
>  src/gallium/state_trackers/vega/api_context.c      |    6 +-
>  src/gallium/state_trackers/vega/image.c            |    2 +-
>  src/gallium/state_trackers/vega/renderer.c         |    8 +-
>  src/gallium/state_trackers/vega/vg_context.c       |    2 +-
>  src/gallium/state_trackers/vega/vg_manager.c       |    4 +-
>  src/gallium/state_trackers/wgl/stw_pixelformat.c   |    4 +-
>  src/gallium/state_trackers/xorg/xorg_dri2.c        |   10 +-
>  src/gallium/state_trackers/xorg/xorg_driver.c      |    6 +-
>  src/gallium/state_trackers/xorg/xorg_exa.c         |   20 +-
>  src/gallium/state_trackers/xorg/xorg_exa.h         |    2 +-
>  src/gallium/state_trackers/xorg/xorg_renderer.c    |    9 +-
>  src/gallium/state_trackers/xorg/xorg_xv.c          |   16 --
>  src/gallium/tests/graw/clear.c                     |    2 +-
>  src/gallium/tests/graw/fs-test.c                   |    2 +-
>  src/gallium/tests/graw/gs-test.c                   |    2 +-
>  src/gallium/tests/graw/quad-sample.c               |    2 +-
>  src/gallium/tests/graw/quad-tex.c                  |    2 +-
>  src/gallium/tests/graw/shader-leak.c               |    2 +-
>  src/gallium/tests/graw/tri-gs.c                    |    2 +-
>  src/gallium/tests/graw/tri-instanced.c             |    2 +-
>  src/gallium/tests/graw/tri.c                       |    2 +-
>  src/gallium/tests/graw/vs-test.c                   |    2 +-
>  src/gallium/tests/trivial/quad-tex.c               |    2 +-
>  src/gallium/tests/trivial/tri.c                    |    2 +-
>  src/gallium/winsys/r600/drm/r600_bo.c              |    2 +-
>  src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c  |    2 +-
>  src/mesa/state_tracker/st_cb_bitmap.c              |    6 +-
>  src/mesa/state_tracker/st_cb_drawpixels.c          |    2 +-
>  src/mesa/state_tracker/st_cb_fbo.c                 |    2 +-
>  src/mesa/state_tracker/st_cb_flush.c               |   10 +-
>  src/mesa/state_tracker/st_cb_flush.h               |    2 +-
>  src/mesa/state_tracker/st_cb_syncobj.c             |    6 +-
>  src/mesa/state_tracker/st_cb_texture.c             |   11 +-
>  src/mesa/state_tracker/st_extensions.c             |   44 ++--
>  src/mesa/state_tracker/st_format.c                 |  210 ++++++++------------
>  src/mesa/state_tracker/st_gen_mipmap.c             |    2 +-
>  src/mesa/state_tracker/st_manager.c                |    4 +-
>  src/mesa/state_tracker/st_texture.c                |    2 +-
>  144 files changed, 497 insertions(+), 1065 deletions(-)
> 
> Best regards
> Marek




More information about the mesa-dev mailing list