summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/p_tile.c42
-rw-r--r--src/gallium/auxiliary/util/p_tile.h19
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c16
3 files changed, 30 insertions, 47 deletions
diff --git a/src/gallium/auxiliary/util/p_tile.c b/src/gallium/auxiliary/util/p_tile.c
index 93abef9879..1a1a2d96cc 100644
--- a/src/gallium/auxiliary/util/p_tile.c
+++ b/src/gallium/auxiliary/util/p_tile.c
@@ -45,12 +45,10 @@
* This should be usable by any hw driver that has mappable surfaces.
*/
void
-pipe_get_tile_raw(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_raw(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
void *dst, int dst_stride)
{
- struct pipe_screen *screen = pipe->screen;
const void *src;
if (pipe_clip_tile(x, y, &w, &h, ps))
@@ -59,14 +57,14 @@ pipe_get_tile_raw(struct pipe_context *pipe,
if (dst_stride == 0)
dst_stride = pf_get_nblocksx(&ps->block, w) * ps->block.size;
- src = screen->surface_map(screen, ps, PIPE_BUFFER_USAGE_CPU_READ);
+ src = pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_READ);
assert(src);
if(!src)
return;
pipe_copy_rect(dst, &ps->block, dst_stride, 0, 0, w, h, src, ps->stride, x, y);
- screen->surface_unmap(screen, ps);
+ pipe_surface_unmap(ps);
}
@@ -75,12 +73,10 @@ pipe_get_tile_raw(struct pipe_context *pipe,
* This should be usable by any hw driver that has mappable surfaces.
*/
void
-pipe_put_tile_raw(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_raw(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const void *src, int src_stride)
{
- struct pipe_screen *screen = pipe->screen;
void *dst;
if (pipe_clip_tile(x, y, &w, &h, ps))
@@ -89,14 +85,14 @@ pipe_put_tile_raw(struct pipe_context *pipe,
if (src_stride == 0)
src_stride = pf_get_nblocksx(&ps->block, w) * ps->block.size;
- dst = screen->surface_map(screen, ps, PIPE_BUFFER_USAGE_CPU_WRITE);
+ dst = pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_WRITE);
assert(dst);
if(!dst)
return;
pipe_copy_rect(dst, &ps->block, ps->stride, x, y, w, h, src, src_stride, 0, 0);
- screen->surface_unmap(screen, ps);
+ pipe_surface_unmap(ps);
}
@@ -686,8 +682,7 @@ ycbcr_get_tile_rgba(ushort *src,
void
-pipe_get_tile_rgba(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_rgba(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
float *p)
{
@@ -702,7 +697,7 @@ pipe_get_tile_rgba(struct pipe_context *pipe,
if (!packed)
return;
- pipe_get_tile_raw(pipe, ps, x, y, w, h, packed, 0);
+ pipe_get_tile_raw(ps, x, y, w, h, packed, 0);
switch (ps->format) {
case PIPE_FORMAT_A8R8G8B8_UNORM:
@@ -768,8 +763,7 @@ pipe_get_tile_rgba(struct pipe_context *pipe,
void
-pipe_put_tile_rgba(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_rgba(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const float *p)
{
@@ -838,7 +832,7 @@ pipe_put_tile_rgba(struct pipe_context *pipe,
assert(0);
}
- pipe_put_tile_raw(pipe, ps, x, y, w, h, packed, 0);
+ pipe_put_tile_raw(ps, x, y, w, h, packed, 0);
FREE(packed);
}
@@ -848,12 +842,10 @@ pipe_put_tile_rgba(struct pipe_context *pipe,
* Get a block of Z values, converted to 32-bit range.
*/
void
-pipe_get_tile_z(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_z(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
uint *z)
{
- struct pipe_screen *screen = pipe->screen;
const uint dstStride = w;
ubyte *map;
uint *pDest = z;
@@ -862,7 +854,7 @@ pipe_get_tile_z(struct pipe_context *pipe,
if (pipe_clip_tile(x, y, &w, &h, ps))
return;
- map = (ubyte *)screen->surface_map(screen, ps, PIPE_BUFFER_USAGE_CPU_READ);
+ map = (ubyte *)pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_READ);
if (!map) {
assert(0);
return;
@@ -913,17 +905,15 @@ pipe_get_tile_z(struct pipe_context *pipe,
assert(0);
}
- screen->surface_unmap(screen, ps);
+ pipe_surface_unmap(ps);
}
void
-pipe_put_tile_z(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_z(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const uint *zSrc)
{
- struct pipe_screen *screen = pipe->screen;
const uint srcStride = w;
const uint *pSrc = zSrc;
ubyte *map;
@@ -932,7 +922,7 @@ pipe_put_tile_z(struct pipe_context *pipe,
if (pipe_clip_tile(x, y, &w, &h, ps))
return;
- map = (ubyte *)screen->surface_map(screen, ps, PIPE_BUFFER_USAGE_CPU_WRITE);
+ map = (ubyte *)pipe_surface_map(ps, PIPE_BUFFER_USAGE_CPU_WRITE);
if (!map) {
assert(0);
return;
@@ -980,7 +970,7 @@ pipe_put_tile_z(struct pipe_context *pipe,
assert(0);
}
- screen->surface_unmap(screen, ps);
+ pipe_surface_unmap(ps);
}
diff --git a/src/gallium/auxiliary/util/p_tile.h b/src/gallium/auxiliary/util/p_tile.h
index fdc80a13b3..adfec8bcee 100644
--- a/src/gallium/auxiliary/util/p_tile.h
+++ b/src/gallium/auxiliary/util/p_tile.h
@@ -30,7 +30,6 @@
#include "pipe/p_compiler.h"
-struct pipe_context;
struct pipe_surface;
@@ -57,40 +56,34 @@ extern "C" {
#endif
void
-pipe_get_tile_raw(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_raw(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
void *p, int dst_stride);
void
-pipe_put_tile_raw(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_raw(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const void *p, int src_stride);
void
-pipe_get_tile_rgba(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_rgba(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
float *p);
void
-pipe_put_tile_rgba(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_rgba(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const float *p);
void
-pipe_get_tile_z(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_get_tile_z(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
uint *z);
void
-pipe_put_tile_z(struct pipe_context *pipe,
- struct pipe_surface *ps,
+pipe_put_tile_z(struct pipe_surface *ps,
uint x, uint y, uint w, uint h,
const uint *z);
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 2d5d2b50f5..bfdaaa6b8f 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -339,7 +339,7 @@ sp_tile_cache_flush_clear(struct pipe_context *pipe,
for (y = 0; y < h; y += TILE_SIZE) {
for (x = 0; x < w; x += TILE_SIZE) {
if (is_clear_flag_set(tc->clear_flags, x, y)) {
- pipe_put_tile_raw(pipe, ps,
+ pipe_put_tile_raw(ps,
x, y, TILE_SIZE, TILE_SIZE,
tc->tile.data.color32, 0/*STRIDE*/);
@@ -374,12 +374,12 @@ sp_flush_tile_cache(struct softpipe_context *softpipe,
struct softpipe_cached_tile *tile = tc->entries + pos;
if (tile->x >= 0) {
if (tc->depth_stencil) {
- pipe_put_tile_raw(pipe, ps,
+ pipe_put_tile_raw(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
else {
- pipe_put_tile_rgba(pipe, ps,
+ pipe_put_tile_rgba(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
(float *) tile->data.color);
}
@@ -431,12 +431,12 @@ sp_get_cached_tile(struct softpipe_context *softpipe,
if (tile->x != -1) {
/* put dirty tile back in framebuffer */
if (tc->depth_stencil) {
- pipe_put_tile_raw(pipe, ps,
+ pipe_put_tile_raw(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
else {
- pipe_put_tile_rgba(pipe, ps,
+ pipe_put_tile_rgba(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
(float *) tile->data.color);
}
@@ -458,12 +458,12 @@ sp_get_cached_tile(struct softpipe_context *softpipe,
else {
/* get new tile data from surface */
if (tc->depth_stencil) {
- pipe_get_tile_raw(pipe, ps,
+ pipe_get_tile_raw(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
tile->data.depth32, 0/*STRIDE*/);
}
else {
- pipe_get_tile_rgba(pipe, ps,
+ pipe_get_tile_rgba(ps,
tile->x, tile->y, TILE_SIZE, TILE_SIZE,
(float *) tile->data.color);
}
@@ -544,7 +544,7 @@ sp_get_cached_tile_tex(struct pipe_context *pipe,
}
/* get tile from the surface (view into texture) */
- pipe_get_tile_rgba(pipe, tc->tex_surf,
+ pipe_get_tile_rgba(tc->tex_surf,
tile_x, tile_y, TILE_SIZE, TILE_SIZE,
(float *) tile->data.color);
tile->x = tile_x;