2 * Copyright © 2014-2015 Broadcom
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * DOC: Render command list generation
27 * In the V3D hardware, render command lists are what load and store
28 * tiles of a framebuffer and optionally call out to binner-generated
29 * command lists to do the 3D drawing for that tile.
31 * In the VC4 driver, render command list generation is performed by the
32 * kernel instead of userspace. We do this because validating a
33 * user-submitted command list is hard to get right and has high CPU overhead,
34 * while the number of valid configurations for render command lists is
35 * actually fairly low.
38 #include "uapi/drm/vc4_drm.h"
40 #include "vc4_packet.h"
42 struct vc4_rcl_setup
{
43 struct drm_gem_cma_object
*color_read
;
44 struct drm_gem_cma_object
*color_write
;
45 struct drm_gem_cma_object
*zs_read
;
46 struct drm_gem_cma_object
*zs_write
;
47 struct drm_gem_cma_object
*msaa_color_write
;
48 struct drm_gem_cma_object
*msaa_zs_write
;
50 struct drm_gem_cma_object
*rcl
;
53 u32 next_write_bo_index
;
56 static inline void rcl_u8(struct vc4_rcl_setup
*setup
, u8 val
)
58 *(u8
*)(setup
->rcl
->vaddr
+ setup
->next_offset
) = val
;
59 setup
->next_offset
+= 1;
62 static inline void rcl_u16(struct vc4_rcl_setup
*setup
, u16 val
)
64 *(u16
*)(setup
->rcl
->vaddr
+ setup
->next_offset
) = val
;
65 setup
->next_offset
+= 2;
68 static inline void rcl_u32(struct vc4_rcl_setup
*setup
, u32 val
)
70 *(u32
*)(setup
->rcl
->vaddr
+ setup
->next_offset
) = val
;
71 setup
->next_offset
+= 4;
75 * Emits a no-op STORE_TILE_BUFFER_GENERAL.
77 * If we emit a PACKET_TILE_COORDINATES, it must be followed by a store of
78 * some sort before another load is triggered.
80 static void vc4_store_before_load(struct vc4_rcl_setup
*setup
)
82 rcl_u8(setup
, VC4_PACKET_STORE_TILE_BUFFER_GENERAL
);
84 VC4_SET_FIELD(VC4_LOADSTORE_TILE_BUFFER_NONE
,
85 VC4_LOADSTORE_TILE_BUFFER_BUFFER
) |
86 VC4_STORE_TILE_BUFFER_DISABLE_COLOR_CLEAR
|
87 VC4_STORE_TILE_BUFFER_DISABLE_ZS_CLEAR
|
88 VC4_STORE_TILE_BUFFER_DISABLE_VG_MASK_CLEAR
);
89 rcl_u32(setup
, 0); /* no address, since we're in None mode */
93 * Calculates the physical address of the start of a tile in a RCL surface.
95 * Unlike the other load/store packets,
96 * VC4_PACKET_LOAD/STORE_FULL_RES_TILE_BUFFER don't look at the tile
97 * coordinates packet, and instead just store to the address given.
99 static uint32_t vc4_full_res_offset(struct vc4_exec_info
*exec
,
100 struct drm_gem_cma_object
*bo
,
101 struct drm_vc4_submit_rcl_surface
*surf
,
102 uint8_t x
, uint8_t y
)
104 return bo
->paddr
+ surf
->offset
+ VC4_TILE_BUFFER_SIZE
*
105 (DIV_ROUND_UP(exec
->args
->width
, 32) * y
+ x
);
109 * Emits a PACKET_TILE_COORDINATES if one isn't already pending.
111 * The tile coordinates packet triggers a pending load if there is one, are
112 * used for clipping during rendering, and determine where loads/stores happen
113 * relative to their base address.
115 static void vc4_tile_coordinates(struct vc4_rcl_setup
*setup
,
116 uint32_t x
, uint32_t y
)
118 rcl_u8(setup
, VC4_PACKET_TILE_COORDINATES
);
123 static void emit_tile(struct vc4_exec_info
*exec
,
124 struct vc4_rcl_setup
*setup
,
125 uint8_t x
, uint8_t y
, bool first
, bool last
)
127 struct drm_vc4_submit_cl
*args
= exec
->args
;
128 bool has_bin
= args
->bin_cl_size
!= 0;
130 /* Note that the load doesn't actually occur until the
131 * tile coords packet is processed, and only one load
132 * may be outstanding at a time.
134 if (setup
->color_read
) {
135 if (args
->color_read
.flags
&
136 VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
137 rcl_u8(setup
, VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER
);
139 vc4_full_res_offset(exec
, setup
->color_read
,
140 &args
->color_read
, x
, y
) |
141 VC4_LOADSTORE_FULL_RES_DISABLE_ZS
);
143 rcl_u8(setup
, VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
);
144 rcl_u16(setup
, args
->color_read
.bits
);
145 rcl_u32(setup
, setup
->color_read
->paddr
+
146 args
->color_read
.offset
);
150 if (setup
->zs_read
) {
151 if (setup
->color_read
) {
152 /* Exec previous load. */
153 vc4_tile_coordinates(setup
, x
, y
);
154 vc4_store_before_load(setup
);
157 if (args
->zs_read
.flags
&
158 VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
159 rcl_u8(setup
, VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER
);
161 vc4_full_res_offset(exec
, setup
->zs_read
,
162 &args
->zs_read
, x
, y
) |
163 VC4_LOADSTORE_FULL_RES_DISABLE_COLOR
);
165 rcl_u8(setup
, VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
);
166 rcl_u16(setup
, args
->zs_read
.bits
);
167 rcl_u32(setup
, setup
->zs_read
->paddr
+
168 args
->zs_read
.offset
);
172 /* Clipping depends on tile coordinates having been
173 * emitted, so we always need one here.
175 vc4_tile_coordinates(setup
, x
, y
);
177 /* Wait for the binner before jumping to the first
180 if (first
&& has_bin
)
181 rcl_u8(setup
, VC4_PACKET_WAIT_ON_SEMAPHORE
);
184 rcl_u8(setup
, VC4_PACKET_BRANCH_TO_SUB_LIST
);
185 rcl_u32(setup
, (exec
->tile_alloc_offset
+
186 (y
* exec
->bin_tiles_x
+ x
) * 32));
189 if (setup
->msaa_color_write
) {
190 bool last_tile_write
= (!setup
->msaa_zs_write
&&
192 !setup
->color_write
);
193 uint32_t bits
= VC4_LOADSTORE_FULL_RES_DISABLE_ZS
;
195 if (!last_tile_write
)
196 bits
|= VC4_LOADSTORE_FULL_RES_DISABLE_CLEAR_ALL
;
198 bits
|= VC4_LOADSTORE_FULL_RES_EOF
;
199 rcl_u8(setup
, VC4_PACKET_STORE_FULL_RES_TILE_BUFFER
);
201 vc4_full_res_offset(exec
, setup
->msaa_color_write
,
202 &args
->msaa_color_write
, x
, y
) |
206 if (setup
->msaa_zs_write
) {
207 bool last_tile_write
= (!setup
->zs_write
&&
208 !setup
->color_write
);
209 uint32_t bits
= VC4_LOADSTORE_FULL_RES_DISABLE_COLOR
;
211 if (setup
->msaa_color_write
)
212 vc4_tile_coordinates(setup
, x
, y
);
213 if (!last_tile_write
)
214 bits
|= VC4_LOADSTORE_FULL_RES_DISABLE_CLEAR_ALL
;
216 bits
|= VC4_LOADSTORE_FULL_RES_EOF
;
217 rcl_u8(setup
, VC4_PACKET_STORE_FULL_RES_TILE_BUFFER
);
219 vc4_full_res_offset(exec
, setup
->msaa_zs_write
,
220 &args
->msaa_zs_write
, x
, y
) |
224 if (setup
->zs_write
) {
225 bool last_tile_write
= !setup
->color_write
;
227 if (setup
->msaa_color_write
|| setup
->msaa_zs_write
)
228 vc4_tile_coordinates(setup
, x
, y
);
230 rcl_u8(setup
, VC4_PACKET_STORE_TILE_BUFFER_GENERAL
);
231 rcl_u16(setup
, args
->zs_write
.bits
|
233 0 : VC4_STORE_TILE_BUFFER_DISABLE_COLOR_CLEAR
));
235 (setup
->zs_write
->paddr
+ args
->zs_write
.offset
) |
236 ((last
&& last_tile_write
) ?
237 VC4_LOADSTORE_TILE_BUFFER_EOF
: 0));
240 if (setup
->color_write
) {
241 if (setup
->msaa_color_write
|| setup
->msaa_zs_write
||
243 vc4_tile_coordinates(setup
, x
, y
);
247 rcl_u8(setup
, VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF
);
249 rcl_u8(setup
, VC4_PACKET_STORE_MS_TILE_BUFFER
);
253 static int vc4_create_rcl_bo(struct drm_device
*dev
, struct vc4_exec_info
*exec
,
254 struct vc4_rcl_setup
*setup
)
256 struct drm_vc4_submit_cl
*args
= exec
->args
;
257 bool has_bin
= args
->bin_cl_size
!= 0;
258 uint8_t min_x_tile
= args
->min_x_tile
;
259 uint8_t min_y_tile
= args
->min_y_tile
;
260 uint8_t max_x_tile
= args
->max_x_tile
;
261 uint8_t max_y_tile
= args
->max_y_tile
;
262 uint8_t xtiles
= max_x_tile
- min_x_tile
+ 1;
263 uint8_t ytiles
= max_y_tile
- min_y_tile
+ 1;
265 uint32_t size
, loop_body_size
;
266 bool positive_x
= true;
267 bool positive_y
= true;
269 if (args
->flags
& VC4_SUBMIT_CL_FIXED_RCL_ORDER
) {
270 if (!(args
->flags
& VC4_SUBMIT_CL_RCL_ORDER_INCREASING_X
))
272 if (!(args
->flags
& VC4_SUBMIT_CL_RCL_ORDER_INCREASING_Y
))
276 size
= VC4_PACKET_TILE_RENDERING_MODE_CONFIG_SIZE
;
277 loop_body_size
= VC4_PACKET_TILE_COORDINATES_SIZE
;
279 if (args
->flags
& VC4_SUBMIT_CL_USE_CLEAR_COLOR
) {
280 size
+= VC4_PACKET_CLEAR_COLORS_SIZE
+
281 VC4_PACKET_TILE_COORDINATES_SIZE
+
282 VC4_PACKET_STORE_TILE_BUFFER_GENERAL_SIZE
;
285 if (setup
->color_read
) {
286 if (args
->color_read
.flags
&
287 VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
288 loop_body_size
+= VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER_SIZE
;
290 loop_body_size
+= VC4_PACKET_LOAD_TILE_BUFFER_GENERAL_SIZE
;
293 if (setup
->zs_read
) {
294 if (setup
->color_read
) {
295 loop_body_size
+= VC4_PACKET_TILE_COORDINATES_SIZE
;
296 loop_body_size
+= VC4_PACKET_STORE_TILE_BUFFER_GENERAL_SIZE
;
299 if (args
->zs_read
.flags
&
300 VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
301 loop_body_size
+= VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER_SIZE
;
303 loop_body_size
+= VC4_PACKET_LOAD_TILE_BUFFER_GENERAL_SIZE
;
308 size
+= VC4_PACKET_WAIT_ON_SEMAPHORE_SIZE
;
309 loop_body_size
+= VC4_PACKET_BRANCH_TO_SUB_LIST_SIZE
;
312 if (setup
->msaa_color_write
)
313 loop_body_size
+= VC4_PACKET_STORE_FULL_RES_TILE_BUFFER_SIZE
;
314 if (setup
->msaa_zs_write
)
315 loop_body_size
+= VC4_PACKET_STORE_FULL_RES_TILE_BUFFER_SIZE
;
318 loop_body_size
+= VC4_PACKET_STORE_TILE_BUFFER_GENERAL_SIZE
;
319 if (setup
->color_write
)
320 loop_body_size
+= VC4_PACKET_STORE_MS_TILE_BUFFER_SIZE
;
322 /* We need a VC4_PACKET_TILE_COORDINATES in between each store. */
323 loop_body_size
+= VC4_PACKET_TILE_COORDINATES_SIZE
*
324 ((setup
->msaa_color_write
!= NULL
) +
325 (setup
->msaa_zs_write
!= NULL
) +
326 (setup
->color_write
!= NULL
) +
327 (setup
->zs_write
!= NULL
) - 1);
329 size
+= xtiles
* ytiles
* loop_body_size
;
331 setup
->rcl
= &vc4_bo_create(dev
, size
, true, VC4_BO_TYPE_RCL
)->base
;
332 if (IS_ERR(setup
->rcl
))
333 return PTR_ERR(setup
->rcl
);
334 list_add_tail(&to_vc4_bo(&setup
->rcl
->base
)->unref_head
,
337 /* The tile buffer gets cleared when the previous tile is stored. If
338 * the clear values changed between frames, then the tile buffer has
339 * stale clear values in it, so we have to do a store in None mode (no
340 * writes) so that we trigger the tile buffer clear.
342 if (args
->flags
& VC4_SUBMIT_CL_USE_CLEAR_COLOR
) {
343 rcl_u8(setup
, VC4_PACKET_CLEAR_COLORS
);
344 rcl_u32(setup
, args
->clear_color
[0]);
345 rcl_u32(setup
, args
->clear_color
[1]);
346 rcl_u32(setup
, args
->clear_z
);
347 rcl_u8(setup
, args
->clear_s
);
349 vc4_tile_coordinates(setup
, 0, 0);
351 rcl_u8(setup
, VC4_PACKET_STORE_TILE_BUFFER_GENERAL
);
352 rcl_u16(setup
, VC4_LOADSTORE_TILE_BUFFER_NONE
);
353 rcl_u32(setup
, 0); /* no address, since we're in None mode */
356 rcl_u8(setup
, VC4_PACKET_TILE_RENDERING_MODE_CONFIG
);
358 (setup
->color_write
? (setup
->color_write
->paddr
+
359 args
->color_write
.offset
) :
361 rcl_u16(setup
, args
->width
);
362 rcl_u16(setup
, args
->height
);
363 rcl_u16(setup
, args
->color_write
.bits
);
365 for (yi
= 0; yi
< ytiles
; yi
++) {
366 int y
= positive_y
? min_y_tile
+ yi
: max_y_tile
- yi
;
367 for (xi
= 0; xi
< xtiles
; xi
++) {
368 int x
= positive_x
? min_x_tile
+ xi
: max_x_tile
- xi
;
369 bool first
= (xi
== 0 && yi
== 0);
370 bool last
= (xi
== xtiles
- 1 && yi
== ytiles
- 1);
372 emit_tile(exec
, setup
, x
, y
, first
, last
);
376 BUG_ON(setup
->next_offset
!= size
);
377 exec
->ct1ca
= setup
->rcl
->paddr
;
378 exec
->ct1ea
= setup
->rcl
->paddr
+ setup
->next_offset
;
383 static int vc4_full_res_bounds_check(struct vc4_exec_info
*exec
,
384 struct drm_gem_cma_object
*obj
,
385 struct drm_vc4_submit_rcl_surface
*surf
)
387 struct drm_vc4_submit_cl
*args
= exec
->args
;
388 u32 render_tiles_stride
= DIV_ROUND_UP(exec
->args
->width
, 32);
390 if (surf
->offset
> obj
->base
.size
) {
391 DRM_DEBUG("surface offset %d > BO size %zd\n",
392 surf
->offset
, obj
->base
.size
);
396 if ((obj
->base
.size
- surf
->offset
) / VC4_TILE_BUFFER_SIZE
<
397 render_tiles_stride
* args
->max_y_tile
+ args
->max_x_tile
) {
398 DRM_DEBUG("MSAA tile %d, %d out of bounds "
399 "(bo size %zd, offset %d).\n",
400 args
->max_x_tile
, args
->max_y_tile
,
409 static int vc4_rcl_msaa_surface_setup(struct vc4_exec_info
*exec
,
410 struct drm_gem_cma_object
**obj
,
411 struct drm_vc4_submit_rcl_surface
*surf
)
413 if (surf
->flags
!= 0 || surf
->bits
!= 0) {
414 DRM_DEBUG("MSAA surface had nonzero flags/bits\n");
418 if (surf
->hindex
== ~0)
421 *obj
= vc4_use_bo(exec
, surf
->hindex
);
425 exec
->rcl_write_bo
[exec
->rcl_write_bo_count
++] = *obj
;
427 if (surf
->offset
& 0xf) {
428 DRM_DEBUG("MSAA write must be 16b aligned.\n");
432 return vc4_full_res_bounds_check(exec
, *obj
, surf
);
435 static int vc4_rcl_surface_setup(struct vc4_exec_info
*exec
,
436 struct drm_gem_cma_object
**obj
,
437 struct drm_vc4_submit_rcl_surface
*surf
,
440 uint8_t tiling
= VC4_GET_FIELD(surf
->bits
,
441 VC4_LOADSTORE_TILE_BUFFER_TILING
);
442 uint8_t buffer
= VC4_GET_FIELD(surf
->bits
,
443 VC4_LOADSTORE_TILE_BUFFER_BUFFER
);
444 uint8_t format
= VC4_GET_FIELD(surf
->bits
,
445 VC4_LOADSTORE_TILE_BUFFER_FORMAT
);
449 if (surf
->flags
& ~VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
450 DRM_DEBUG("Extra flags set\n");
454 if (surf
->hindex
== ~0)
457 *obj
= vc4_use_bo(exec
, surf
->hindex
);
462 exec
->rcl_write_bo
[exec
->rcl_write_bo_count
++] = *obj
;
464 if (surf
->flags
& VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES
) {
465 if (surf
== &exec
->args
->zs_write
) {
466 DRM_DEBUG("general zs write may not be a full-res.\n");
470 if (surf
->bits
!= 0) {
471 DRM_DEBUG("load/store general bits set with "
472 "full res load/store.\n");
476 ret
= vc4_full_res_bounds_check(exec
, *obj
, surf
);
483 if (surf
->bits
& ~(VC4_LOADSTORE_TILE_BUFFER_TILING_MASK
|
484 VC4_LOADSTORE_TILE_BUFFER_BUFFER_MASK
|
485 VC4_LOADSTORE_TILE_BUFFER_FORMAT_MASK
)) {
486 DRM_DEBUG("Unknown bits in load/store: 0x%04x\n",
491 if (tiling
> VC4_TILING_FORMAT_LT
) {
492 DRM_DEBUG("Bad tiling format\n");
496 if (buffer
== VC4_LOADSTORE_TILE_BUFFER_ZS
) {
498 DRM_DEBUG("No color format should be set for ZS\n");
502 } else if (buffer
== VC4_LOADSTORE_TILE_BUFFER_COLOR
) {
504 case VC4_LOADSTORE_TILE_BUFFER_BGR565
:
505 case VC4_LOADSTORE_TILE_BUFFER_BGR565_DITHER
:
508 case VC4_LOADSTORE_TILE_BUFFER_RGBA8888
:
512 DRM_DEBUG("Bad tile buffer format\n");
516 DRM_DEBUG("Bad load/store buffer %d.\n", buffer
);
520 if (surf
->offset
& 0xf) {
521 DRM_DEBUG("load/store buffer must be 16b aligned.\n");
525 if (!vc4_check_tex_size(exec
, *obj
, surf
->offset
, tiling
,
526 exec
->args
->width
, exec
->args
->height
, cpp
)) {
534 vc4_rcl_render_config_surface_setup(struct vc4_exec_info
*exec
,
535 struct vc4_rcl_setup
*setup
,
536 struct drm_gem_cma_object
**obj
,
537 struct drm_vc4_submit_rcl_surface
*surf
)
539 uint8_t tiling
= VC4_GET_FIELD(surf
->bits
,
540 VC4_RENDER_CONFIG_MEMORY_FORMAT
);
541 uint8_t format
= VC4_GET_FIELD(surf
->bits
,
542 VC4_RENDER_CONFIG_FORMAT
);
545 if (surf
->flags
!= 0) {
546 DRM_DEBUG("No flags supported on render config.\n");
550 if (surf
->bits
& ~(VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK
|
551 VC4_RENDER_CONFIG_FORMAT_MASK
|
552 VC4_RENDER_CONFIG_MS_MODE_4X
|
553 VC4_RENDER_CONFIG_DECIMATE_MODE_4X
)) {
554 DRM_DEBUG("Unknown bits in render config: 0x%04x\n",
559 if (surf
->hindex
== ~0)
562 *obj
= vc4_use_bo(exec
, surf
->hindex
);
566 exec
->rcl_write_bo
[exec
->rcl_write_bo_count
++] = *obj
;
568 if (tiling
> VC4_TILING_FORMAT_LT
) {
569 DRM_DEBUG("Bad tiling format\n");
574 case VC4_RENDER_CONFIG_FORMAT_BGR565_DITHERED
:
575 case VC4_RENDER_CONFIG_FORMAT_BGR565
:
578 case VC4_RENDER_CONFIG_FORMAT_RGBA8888
:
582 DRM_DEBUG("Bad tile buffer format\n");
586 if (!vc4_check_tex_size(exec
, *obj
, surf
->offset
, tiling
,
587 exec
->args
->width
, exec
->args
->height
, cpp
)) {
594 int vc4_get_rcl(struct drm_device
*dev
, struct vc4_exec_info
*exec
)
596 struct vc4_rcl_setup setup
= {0};
597 struct drm_vc4_submit_cl
*args
= exec
->args
;
598 bool has_bin
= args
->bin_cl_size
!= 0;
601 if (args
->min_x_tile
> args
->max_x_tile
||
602 args
->min_y_tile
> args
->max_y_tile
) {
603 DRM_DEBUG("Bad render tile set (%d,%d)-(%d,%d)\n",
604 args
->min_x_tile
, args
->min_y_tile
,
605 args
->max_x_tile
, args
->max_y_tile
);
610 (args
->max_x_tile
> exec
->bin_tiles_x
||
611 args
->max_y_tile
> exec
->bin_tiles_y
)) {
612 DRM_DEBUG("Render tiles (%d,%d) outside of bin config "
614 args
->max_x_tile
, args
->max_y_tile
,
615 exec
->bin_tiles_x
, exec
->bin_tiles_y
);
619 ret
= vc4_rcl_render_config_surface_setup(exec
, &setup
,
625 ret
= vc4_rcl_surface_setup(exec
, &setup
.color_read
, &args
->color_read
,
630 ret
= vc4_rcl_surface_setup(exec
, &setup
.zs_read
, &args
->zs_read
,
635 ret
= vc4_rcl_surface_setup(exec
, &setup
.zs_write
, &args
->zs_write
,
640 ret
= vc4_rcl_msaa_surface_setup(exec
, &setup
.msaa_color_write
,
641 &args
->msaa_color_write
);
645 ret
= vc4_rcl_msaa_surface_setup(exec
, &setup
.msaa_zs_write
,
646 &args
->msaa_zs_write
);
650 /* We shouldn't even have the job submitted to us if there's no
651 * surface to write out.
653 if (!setup
.color_write
&& !setup
.zs_write
&&
654 !setup
.msaa_color_write
&& !setup
.msaa_zs_write
) {
655 DRM_DEBUG("RCL requires color or Z/S write\n");
659 return vc4_create_rcl_bo(dev
, exec
, &setup
);