5 #include "pipe/p_format.h"
12 /* The number of tiles */
16 /* size of each tile expressed in blocks */
20 /* Describe the tile in pixels */
21 struct pipe_format_block tile
;
23 /* Describe each block within the tile */
24 struct pipe_format_block block
;
27 void pipe_linear_to_tile(size_t src_stride
, const void *src_ptr
,
28 struct pipe_tile_info
*t
, void *dst_ptr
);
30 void pipe_linear_from_tile(struct pipe_tile_info
*t
, const void *src_ptr
,
31 size_t dst_stride
, void *dst_ptr
);
34 * Convenience function to fillout a pipe_tile_info struct.
35 * @t info to fill out.
36 * @block block info about pixel layout
37 * @tile_width the width of the tile in pixels
38 * @tile_height the height of the tile in pixels
39 * @tiles_x number of tiles in x axis
40 * @tiles_y number of tiles in y axis
42 void pipe_linear_fill_info(struct pipe_tile_info
*t
,
43 const struct pipe_format_block
*block
,
44 unsigned tile_width
, unsigned tile_height
,
45 unsigned tiles_x
, unsigned tiles_y
);
47 static INLINE boolean
pipe_linear_check_tile(const struct pipe_tile_info
*t
)
49 if (t
->tile
.size
!= t
->block
.size
* t
->cols
* t
->rows
)
52 if (t
->stride
!= t
->block
.size
* t
->cols
* t
->tiles_x
)
55 if (t
->size
< t
->stride
* t
->rows
* t
->tiles_y
)
61 #endif /* U_LINEAR_H */