|
@@ -45,6 +45,8 @@ struct vc4_rcl_setup {
|
|
|
|
|
|
struct drm_gem_cma_object *rcl;
|
|
struct drm_gem_cma_object *rcl;
|
|
u32 next_offset;
|
|
u32 next_offset;
|
|
|
|
+
|
|
|
|
+ u32 next_write_bo_index;
|
|
};
|
|
};
|
|
|
|
|
|
static inline void rcl_u8(struct vc4_rcl_setup *setup, u8 val)
|
|
static inline void rcl_u8(struct vc4_rcl_setup *setup, u8 val)
|
|
@@ -407,6 +409,8 @@ static int vc4_rcl_msaa_surface_setup(struct vc4_exec_info *exec,
|
|
if (!*obj)
|
|
if (!*obj)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj;
|
|
|
|
+
|
|
if (surf->offset & 0xf) {
|
|
if (surf->offset & 0xf) {
|
|
DRM_ERROR("MSAA write must be 16b aligned.\n");
|
|
DRM_ERROR("MSAA write must be 16b aligned.\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -417,7 +421,8 @@ static int vc4_rcl_msaa_surface_setup(struct vc4_exec_info *exec,
|
|
|
|
|
|
static int vc4_rcl_surface_setup(struct vc4_exec_info *exec,
|
|
static int vc4_rcl_surface_setup(struct vc4_exec_info *exec,
|
|
struct drm_gem_cma_object **obj,
|
|
struct drm_gem_cma_object **obj,
|
|
- struct drm_vc4_submit_rcl_surface *surf)
|
|
|
|
|
|
+ struct drm_vc4_submit_rcl_surface *surf,
|
|
|
|
+ bool is_write)
|
|
{
|
|
{
|
|
uint8_t tiling = VC4_GET_FIELD(surf->bits,
|
|
uint8_t tiling = VC4_GET_FIELD(surf->bits,
|
|
VC4_LOADSTORE_TILE_BUFFER_TILING);
|
|
VC4_LOADSTORE_TILE_BUFFER_TILING);
|
|
@@ -440,6 +445,9 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec,
|
|
if (!*obj)
|
|
if (!*obj)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ if (is_write)
|
|
|
|
+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj;
|
|
|
|
+
|
|
if (surf->flags & VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES) {
|
|
if (surf->flags & VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES) {
|
|
if (surf == &exec->args->zs_write) {
|
|
if (surf == &exec->args->zs_write) {
|
|
DRM_ERROR("general zs write may not be a full-res.\n");
|
|
DRM_ERROR("general zs write may not be a full-res.\n");
|
|
@@ -542,6 +550,8 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec,
|
|
if (!*obj)
|
|
if (!*obj)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj;
|
|
|
|
+
|
|
if (tiling > VC4_TILING_FORMAT_LT) {
|
|
if (tiling > VC4_TILING_FORMAT_LT) {
|
|
DRM_ERROR("Bad tiling format\n");
|
|
DRM_ERROR("Bad tiling format\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -599,15 +609,18 @@ int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec)
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
- ret = vc4_rcl_surface_setup(exec, &setup.color_read, &args->color_read);
|
|
|
|
|
|
+ ret = vc4_rcl_surface_setup(exec, &setup.color_read, &args->color_read,
|
|
|
|
+ false);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
- ret = vc4_rcl_surface_setup(exec, &setup.zs_read, &args->zs_read);
|
|
|
|
|
|
+ ret = vc4_rcl_surface_setup(exec, &setup.zs_read, &args->zs_read,
|
|
|
|
+ false);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
- ret = vc4_rcl_surface_setup(exec, &setup.zs_write, &args->zs_write);
|
|
|
|
|
|
+ ret = vc4_rcl_surface_setup(exec, &setup.zs_write, &args->zs_write,
|
|
|
|
+ true);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|