1 /*
2 * Copyright © 2018 Rob Clark <[email protected]>
3 * Copyright © 2018 Google, Inc.
4 * SPDX-License-Identifier: MIT
5 *
6 * Authors:
7 * Rob Clark <[email protected]>
8 */
9
10 #ifndef FD6_RESOURCE_H_
11 #define FD6_RESOURCE_H_
12
13 #include "freedreno_resource.h"
14
15 enum fd6_format_status {
16 FORMAT_OK,
17 DEMOTE_TO_LINEAR,
18 DEMOTE_TO_TILED,
19 };
20
21 enum fd6_format_status fd6_check_valid_format(struct fd_resource *rsc,
22 enum pipe_format format);
23 void fd6_validate_format(struct fd_context *ctx, struct fd_resource *rsc,
24 enum pipe_format format) assert_dt;
25
26 static inline void
fd6_assert_valid_format(struct fd_resource * rsc,enum pipe_format format)27 fd6_assert_valid_format(struct fd_resource *rsc, enum pipe_format format)
28 {
29 assert(fd6_check_valid_format(rsc, format) == FORMAT_OK);
30 }
31
32 void fd6_emit_flag_reference(struct fd_ringbuffer *ring,
33 struct fd_resource *rsc, int level, int layer);
34 template <chip CHIP>
35 void fd6_resource_screen_init(struct pipe_screen *pscreen);
36
37 #endif /* FD6_RESOURCE_H_ */
38