[Mesa-dev] [PATCH 1/2] radv: drop bo ptr from iview.
Dave Airlie
airlied at gmail.com
Fri Nov 4 01:29:19 UTC 2016
From: Dave Airlie <airlied at redhat.com>
This is needed to fixup some ordering issues with
when memory is bound to images.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/amd/vulkan/radv_cmd_buffer.c | 4 ++--
src/amd/vulkan/radv_descriptor_set.c | 2 +-
src/amd/vulkan/radv_device.c | 12 ++++++------
src/amd/vulkan/radv_image.c | 1 -
src/amd/vulkan/radv_private.h | 1 -
5 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 1783ddf..b37323b 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -800,7 +800,7 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
radv_set_optimal_micro_tile_mode(cmd_buffer->device,
att, dst_resolve_micro_tile_mode);
}
- cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->bo, 8);
+ cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->image->bo, 8);
assert(att->attachment->aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT);
radv_emit_fb_color_state(cmd_buffer, i, &att->cb);
@@ -817,7 +817,7 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
VkImageLayout layout = subpass->depth_stencil_attachment.layout;
struct radv_attachment_info *att = &framebuffer->attachments[idx];
struct radv_image *image = att->attachment->image;
- cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->bo, 8);
+ cmd_buffer->device->ws->cs_add_buffer(cmd_buffer->cs, att->attachment->image->bo, 8);
radv_emit_fb_ds_state(cmd_buffer, &att->ds, image, layout);
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index eb8b5d6..a4a12bf 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -618,7 +618,7 @@ write_image_descriptor(struct radv_device *device,
RADV_FROM_HANDLE(radv_image_view, iview, image_info->imageView);
memcpy(dst, iview->descriptor, 8 * 4);
memcpy(dst + 8, iview->fmask_descriptor, 8 * 4);
- *buffer_list = iview->bo;
+ *buffer_list = iview->image->bo;
}
static void
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 0a9373c..4c5e9c5 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1376,17 +1376,17 @@ radv_initialise_color_surface(struct radv_device *device,
memset(cb, 0, sizeof(*cb));
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset;
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset;
va += level_info->offset;
cb->cb_color_base = va >> 8;
/* CMASK variables */
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset;
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset;
va += iview->image->cmask.offset;
cb->cb_color_cmask = va >> 8;
cb->cb_color_cmask_slice = iview->image->cmask.slice_tile_max;
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset;
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset;
va += iview->image->dcc_offset;
cb->cb_dcc_base = va >> 8;
@@ -1413,7 +1413,7 @@ radv_initialise_color_surface(struct radv_device *device,
}
if (iview->image->fmask.size) {
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset + iview->image->fmask.offset;
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset + iview->image->fmask.offset;
if (device->instance->physicalDevice.rad_info.chip_class >= CIK)
cb->cb_color_pitch |= S_028C64_FMASK_TILE_MAX(iview->image->fmask.pitch_in_pixels / 8 - 1);
cb->cb_color_attrib |= S_028C74_FMASK_TILE_MODE_INDEX(iview->image->fmask.tile_mode_index);
@@ -1537,7 +1537,7 @@ radv_initialise_ds_surface(struct radv_device *device,
fprintf(stderr, "Invalid DB format: %d, disabling DB.\n", iview->vk_format);
}
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset;
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset;
s_offs = z_offs = va;
z_offs += iview->image->surface.level[level].offset;
s_offs += iview->image->surface.stencil_level[level].offset;
@@ -1602,7 +1602,7 @@ radv_initialise_ds_surface(struct radv_device *device,
/* Use all of the htile_buffer for depth if there's no stencil. */
ds->db_stencil_info |= S_028044_TILE_STENCIL_DISABLE(1);
- va = device->ws->buffer_get_va(iview->bo) + iview->image->offset +
+ va = device->ws->buffer_get_va(iview->image->bo) + iview->image->offset +
iview->image->htile.offset;
ds->db_htile_data_base = va >> 8;
ds->db_htile_surface = S_028ABC_FULL_CACHE(1);
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index b63792d..7e8b837 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -766,7 +766,6 @@ radv_image_view_init(struct radv_image_view *iview,
unreachable("bad VkImageType");
}
iview->image = image;
- iview->bo = image->bo;
iview->type = pCreateInfo->viewType;
iview->vk_format = pCreateInfo->format;
iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 7f84bf9..cfb913f 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1019,7 +1019,6 @@ radv_init_metadata(struct radv_device *device,
struct radv_image_view {
struct radv_image *image; /**< VkImageViewCreateInfo::image */
- struct radeon_winsys_bo *bo;
VkImageViewType type;
VkImageAspectFlags aspect_mask;
--
2.7.4
More information about the mesa-dev
mailing list