Commit Graph

47 Commits

Author SHA1 Message Date
Brian Paul
31deacb8d3 softpipe: include sp_winsys.h to silence warning (unprototyped function) 2009-05-27 19:30:07 -06:00
Michel Dänzer
13cb8264d8 gallium/intel/gem: Use softpipe rather than i915simple if INTEL_SOFTPIPE is set. 2009-04-23 12:57:46 +01:00
Brian Paul
fbcd78b5d1 softpipe: minor debug-help changes in softpipe_transfer_map() 2009-04-07 17:31:49 -06:00
Michel Dänzer
e9d156e9e4 gallium: Remove remnants of reference counting internals outside of p_refcnt.h. 2009-03-23 18:03:13 +01:00
Michal Krol
47c18b35b0 softpipe: Use p_atomic_read, not atomic_read. 2009-03-16 12:22:50 +01:00
Thomas Hellstrom
cf25ef9072 gallium: Use struct pipe_atomic for pipe refcounts.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
2009-03-16 11:40:47 +01:00
Michel Dänzer
5e27cd46c0 gallium: Unify reference counting.
The core reference counting code is centralized in p_refcnt.h.

This has some consequences related to struct pipe_buffer:

* The screen member of struct pipe_buffer must be initialized, or
  pipe_buffer_reference() will crash trying to destroy a buffer with reference
  count 0. u_simple_screen takes care of this, but I may have missed some of
  the drivers not using it.
* Except for rare exceptions deep in winsys code, buffers must always be
  allocated via pipe_buffer_create() or via screen->*buffer_create() rather
  than via winsys->*buffer_create().
2009-03-04 11:58:48 +01:00
Brian Paul
981b7c08ae softpipe: minor code simplification for face/zslice offset calculation 2009-02-24 21:01:34 -07:00
Brian Paul
d6677fd9bc softpipe: minor code movement in softpipe_get_tex_transfer() 2009-02-24 08:33:50 -07:00
Keith Whitwell
59d54334c9 Merge branch 'master' into gallium-texture-transfer
Conflicts:

	src/mesa/state_tracker/st_cb_accum.c
	src/mesa/state_tracker/st_cb_drawpixels.c
2009-02-16 19:50:48 +00:00
Brian Paul
2473ded886 softpipe: simplify an assertion 2009-02-07 13:03:24 -07:00
Michel Dänzer
4617981ec7 gallium: No longer allow CPU mapping surfaces directly.
Instead, a new pipe_transfer object has to be created and mapped for
transferring data between the CPU and a texture. This gives the driver more
flexibility for textures in address spaces that aren't CPU accessible.

This is a first pass; softpipe/xlib builds and runs glxgears, but it only shows
a black window. Looks like something's off related to the Z buffer, so the
depth test always fails.
2009-02-05 19:41:18 +01:00
Zack Rusin
5069bfed29 gallium: remove pipe_buffer from surfaces
this change disassociates, at least from the driver perspective,
the surface from buffer. surfaces are technically now views on the
textures so make it so by hiding the buffer in the internals of
textures.
2009-02-02 23:47:16 -05:00
Zack Rusin
adfbba476d gallium: make p_winsys internal
move it to pipe/internal/p_winsys_screen.h and start converting
the state trackers to the screen usage
2009-01-30 15:57:33 -05:00
Zack Rusin
b3028acd98 gallium: give the screen priority when it comes to buffer allocations
allows the driver to overwrite buffer allocation, first step on the way
to making winsys interface internal to the drivers. state trackers and
the code above it will go through the screen
2009-01-29 21:43:15 -05:00
José Fonseca
5897383344 gallium: Remove the standalone surfaces.
This commit is mostly just a cosmetic change that cleans-up the interfaces,
replacing pipe_winsys::surface_* calls by

   /**
    * Allocate storage for a display target surface.
    *
    * Often surfaces which are meant to be blitted to the front screen (i.e.,
    * display targets) must be allocated with special characteristics, memory
    * pools, or obtained directly from the windowing system.
    *
    * This callback is invoked by the pipe_screenwhen creating a texture marked
    * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag  to get the underlying
    * buffer storage.
    */
   struct pipe_buffer *(*surface_buffer_create)(struct pipe_winsys *ws,
                                        unsigned width, unsigned height,
                                        enum pipe_format format,
                                        unsigned usage,
                                        unsigned *stride);

Most drivers were updated but not all were tested. Use the softpipe pipe
driver and the xlib winsys changes as a reference when fixing other drivers.
2009-01-20 12:22:49 +00:00
José Fonseca
417a78bdad softpipe: Don't fill surfaces's winsys fields.
This is sometimes checked to distinguish between texture views and
(deprecated) standalone surfaces.
2008-12-22 20:23:59 +00:00
José Fonseca
fc16ba8553 softpipe: Call surface_alloc_storage to get the pipebuffer for display targets.
Otherwise blitting from display target surfaces to front screen fails in
several platforms.
2008-12-22 20:20:58 +00:00
Jerome Glisse
5f36c5b2c5 softpipe: initialize refcount and winsys 2008-12-22 18:56:20 +00:00
Jerome Glisse
85bc49a6f1 softpipe: convert to use texture instead of surface 2008-12-22 18:56:09 +00:00
José Fonseca
c93fff86ea softpipe: Use pipe_buffer_* inlines as much as possible. 2008-09-04 09:38:23 +09:00
José Fonseca
f637a96e85 gallium: Have pipe_buffer_* receive a pipe_screen instead of a pipe_context.
We want to use the pipe_buffer_* inlines everywhere, but a pipe context
is not always available nor is it needed.
2008-09-03 11:53:39 +09:00
Brian Paul
4f25420bdd gallium: refactor/replace p_util.h with util/u_memory.h and util/u_math.h
Also, rename p_tile.[ch] to u_tile.[ch]
2008-08-24 17:48:55 -06:00
José Fonseca
c23b64f164 softpipe: Compute block size for display targets. 2008-07-05 03:51:25 +09:00
José Fonseca
1942e29bf7 softpipe: Implement texture blankets. 2008-07-05 00:55:18 +09:00
José Fonseca
4ddd659679 gallium: Drop pipe_texture->cpp and pipe_surface->cpp.
The chars-per-pixel concept falls apart with compressed and yuv images,
where more than one pixel are coded in a single data block.
2008-06-27 19:37:56 +09:00
Brian Paul
25da42a650 gallium: in softpipe_get_tex_surface() use the pitch specified in the softpipe_texture object.
Fixes a pitch/width mix-up.
2008-06-23 11:28:38 -06:00
Brian Paul
f38bb10969 gallium: fix some surface usage bugs
When a surface is created with GPU_WRITE that really means "GPU render"
and that can involve reads (blending).  Set surface usage to
PIPE_BUFFER_USAGE_CPU_READ + WRITE.  Fixes progs/demos/lodbias demo.

Also, mark texture as 'modified' when mapped for writing so that the tile
cache can know when to freshen a cached tile.  Fixes glTexSubImage2D().
2008-06-20 15:58:19 -06:00
José Fonseca
c7ad942c54 gallium: Propagate tex_usage flags down to winsys. 2008-05-07 14:17:59 +09:00
Keith Whitwell
a73ae3d5eb gallium: Add texture usage flags, special-case allocation of display targets
For many envirionments it's necessary to allocate display targets
in a window-system friendly manner.  Add facilities so that a driver
can tell if a texture is likely to be used to generate a display surface
and if use special allocation paths if necessary.

Hook up softpipe to call into the winsys->surface_alloc_storage()
routine in this case, though we probably want to change that interface
slightly also.
2008-05-02 16:46:31 +01:00
Keith Whitwell
27e46611f0 softpipe: use CPU flags for mapping
But when creating surfaces, adjust incoming flags from GPU->CPU usage.
2008-05-01 12:00:45 +01:00
Keith Whitwell
c9ed86a964 gallium: tex surface checkpoint 2008-05-01 12:00:45 +01:00
Brian
2f8f6c2918 gallium: remove temporary _screen suffix from function names 2008-03-22 09:15:23 -06:00
Brian Paul
4984487bc3 gallium: add face, dirtyLevels params to pipe->texture_update()
This provides better information about which images in texture object have changed.
Also, call texture_update() from more places previously missed.
2008-03-19 17:15:14 -06:00
Brian
344356a0ed gallium: remove DOS carriage returns 2008-03-14 16:01:24 -06:00
Keith Whitwell
4528287e04 gallium: michel's patch to rework texture/sampler binding interface
Bind all the samplers/textures at once rather than piecemeal.
This is easier for drivers to understand.
2008-03-05 10:56:49 +01:00
Brian
681b78fc60 gallium: remove unnecessary assignment 2008-02-27 15:48:00 -07:00
Brian
6f715dcc21 gallium: remove pipe_context->texture_create/release/get_tex_surface()
These functions are now per-screen, not per-context.
2008-02-27 14:21:12 -07:00
Brian
4f36cf5858 gallium: implement pipe_screen for softpipe driver 2008-02-27 09:47:46 -07:00
Brian
e8c0162fa0 gallium: softpipe_init_texture_funcs(), make texture func static 2008-02-27 08:58:12 -07:00
Brian
4da19dbcaa gallium: remove pipe parameter from pipe_texture_reference()
Added pipe field to pipe_texture (temporary, see comments).
First step toward context-less texture creation...
2008-02-26 19:31:22 -07:00
Brian
12c14c31b7 gallium: fix brokenb build 2008-02-22 08:56:55 -07:00
Michal Krol
e0de82fbcb gallium: Fix build on Windows. 2008-02-23 00:51:19 +09:00
Brian
25ea1901b4 gallium: replace some ordinary assignments with pipe_reference_texture()
This fixes at least one instance of dereferencing an invalid texture pointer.
2008-02-20 15:09:44 -07:00
Brian
fce61f341f gallium: fix bad ptr comparison 2008-02-20 15:09:44 -07:00
Brian
d5640a2dbd gallium: new pipe->texture_update() function
Called whenever texture data is changed (glTexImage, glTexSubImage,
glCopyTexSubImage, etc).
2008-02-20 13:24:52 -07:00
José Fonseca
b642730be9 Code reorganization: move files into their places.
This is in a separate commit to ensure renames are properly preserved.
2008-02-15 17:45:40 +09:00