1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright (c) 2011-2013 Luc Verhaegen <libv@skynet.be>
3bf215546Sopenharmony_ci * Copyright (c) 2018 Alyssa Rosenzweig <alyssa@rosenzweig.io>
4bf215546Sopenharmony_ci * Copyright (c) 2018 Vasily Khoruzhick <anarsoul@gmail.com>
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
8bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
9bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sub license,
10bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
11bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the
14bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions
15bf215546Sopenharmony_ci * of the Software.
16bf215546Sopenharmony_ci *
17bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23bf215546Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
24bf215546Sopenharmony_ci *
25bf215546Sopenharmony_ci */
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci#ifndef H_PANFROST_TILING
28bf215546Sopenharmony_ci#define H_PANFROST_TILING
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ci#include <stdint.h>
31bf215546Sopenharmony_ci#include <util/format/u_format.h>
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci#ifdef __cplusplus
34bf215546Sopenharmony_ciextern "C" {
35bf215546Sopenharmony_ci#endif
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci/**
38bf215546Sopenharmony_ci * Load a rectangular region from a tiled image to a linear staging image.
39bf215546Sopenharmony_ci *
40bf215546Sopenharmony_ci * @dst Linear destination
41bf215546Sopenharmony_ci * @src Tiled source
42bf215546Sopenharmony_ci * @x Region of interest of source in pixels, aligned to block size
43bf215546Sopenharmony_ci * @y Region of interest of source in pixels, aligned to block size
44bf215546Sopenharmony_ci * @z Region of interest of source in pixels, aligned to block size
45bf215546Sopenharmony_ci * @w Region of interest of source in pixels, aligned to block size
46bf215546Sopenharmony_ci * @dst_stride Stride in bytes of linear destination
47bf215546Sopenharmony_ci * @src_stride Number of bytes between adjacent rows of tiles in source.
48bf215546Sopenharmony_ci * @format Format of the source and destination image
49bf215546Sopenharmony_ci */
50bf215546Sopenharmony_civoid panfrost_load_tiled_image(void *dst, const void *src,
51bf215546Sopenharmony_ci                               unsigned x, unsigned y,
52bf215546Sopenharmony_ci                               unsigned w, unsigned h,
53bf215546Sopenharmony_ci                               uint32_t dst_stride,
54bf215546Sopenharmony_ci                               uint32_t src_stride,
55bf215546Sopenharmony_ci                               enum pipe_format format);
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_ci/**
58bf215546Sopenharmony_ci * Store a linear staging image to a rectangular region of a tiled image.
59bf215546Sopenharmony_ci *
60bf215546Sopenharmony_ci * @dst Tiled destination
61bf215546Sopenharmony_ci * @src Linear source
62bf215546Sopenharmony_ci * @x Region of interest of destination in pixels, aligned to block size
63bf215546Sopenharmony_ci * @y Region of interest of destination in pixels, aligned to block size
64bf215546Sopenharmony_ci * @z Region of interest of destination in pixels, aligned to block size
65bf215546Sopenharmony_ci * @w Region of interest of destination in pixels, aligned to block size
66bf215546Sopenharmony_ci * @dst_stride Number of bytes between adjacent rows of tiles in destination.
67bf215546Sopenharmony_ci * @src_stride Stride in bytes of linear source
68bf215546Sopenharmony_ci * @format Format of the source and destination image
69bf215546Sopenharmony_ci */
70bf215546Sopenharmony_civoid panfrost_store_tiled_image(void *dst, const void *src,
71bf215546Sopenharmony_ci                                unsigned x, unsigned y,
72bf215546Sopenharmony_ci                                unsigned w, unsigned h,
73bf215546Sopenharmony_ci                                uint32_t dst_stride,
74bf215546Sopenharmony_ci                                uint32_t src_stride,
75bf215546Sopenharmony_ci                                enum pipe_format format);
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_ci
78bf215546Sopenharmony_ci#ifdef __cplusplus
79bf215546Sopenharmony_ci} /* extern C */
80bf215546Sopenharmony_ci#endif
81bf215546Sopenharmony_ci
82bf215546Sopenharmony_ci#endif
83